-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the normal hitobito API instead of the group_health endpoints #28
Draft
carlobeltrame
wants to merge
12
commits into
digio-ch:develop
Choose a base branch
from
carlobeltrame:oauth-import
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 23, 2021
This was referenced Sep 3, 2021
carlobeltrame
force-pushed
the
oauth-import
branch
2 times, most recently
from
September 28, 2021 19:26
95f99e4
to
7fec05f
Compare
… for groups, people and roles
…I, and clear existing data before syncing
Each sensitive data point is marked with the id of the sync group (Abteilung for now, maybe canton in the future). Also, the id column in the tables is no longer misused to store the id from MiData, because we potentially need to store the same entity twice for different sync groups (e.g. when the same person is in multiple Abteilungen).
carlobeltrame
force-pushed
the
oauth-import
branch
from
October 26, 2021 20:21
7b7ed8b
to
dba9484
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #22 for context.
Currently, the healthcheck fetches absolutely all the data every night. This leads to a lot of large API calls with very few changed data. Also, hitobito needs to offer a specialized API, which is only used by this one application, next to it's existing, general-purpose API. This PR is a first step towards changing the architecture of healthcheck to fetch only the necessary data only when it is needed, and only through the normal generic hitobito JSON:API.
The idea is to use hitobito's normal API via an OAuth access token. An Abteilungsleiterin is offered a "sync" button in the healthcheck application, which triggers API calls to fetch only the necessary data for that specific Abteilung on demand. This alleviates the need for an opt-in flag in hitobito, and the users don't have to wait for a whole night when using healthcheck for the first time. Also, healthcheck would become more of a true microservice, and hitobito wouldn't need to know anything about healthcheck internals anymore.
This new approach requires some changes to hitobito, and some fundamental changes to the importing system of healthcheck.
I have begun implementing all of these changes here and in hitobito/hitobito#1378, hitobito/hitobito_pbs#204 and digio-ch/pbs-healthcheck-web#11. It also requires the MiData admins to grant the
api
scope to the healthcheck OAuth application, and add another callback URI with?action=sync
appended to it.Any feedback is welcome.
Fix thestart_date
andend_date
filters in the hitobito events API, so we can fetch events from past years as wellFilter out participations of people that are not in that group?Import participations of unknown people as anonymous participations with null in the foreign key.