Skip to content
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

Try adding and removing repos when necessary #983

Closed

Conversation

jabrah
Copy link
Contributor

@jabrah jabrah commented Jul 3, 2019

Addresses part of #982

This PR has multiple changes centered around modifying effective policies and repositories on an active submission in a workflow. Description of the buggy behavior can be seen in the linked ticket. A few changes were made to get around the issue:

  • The Policies step will now fully refresh submission.effectivePolicies every time the Policy step is run based solely on the results of the policy service
    • The route clears effective policies before invoking the policy service. Any policy will appropriately be added back to the submission during this step. This removal and (re)adding of policies is done entirely client side in the Ember store, then persisted when the user clicks the Next button.
  • The Repositories step is now changed to compare submission.repositories to the repo list from the policy service, taking the policy service results as truth.
    • Repositories on the submission that do not appear in the results will be removed from the submission
    • Repositories that are not present on the submission, but appear as required will be automatically added to the submission.

There is a downside to the approach taken here: if for some reason a user removes a grant from the submission, then clicks Next to save the draft and leaves the workflow, the draft submission will be in a sort of limbo state, where effectivePolicies and repositories would not have been updated. However, current implementation of editing draft submissions forces the user to step through the entire workflow, so those inaccuracies would be taken care of as soon as they make it to the appropriate step.

@jabrah
Copy link
Contributor Author

jabrah commented Jul 10, 2019

Going to redo this to make it a bit more robust

@jabrah jabrah closed this Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant