fix/archive toggle no longer respects change request #6882
Merged
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.
What
This changes the UI flow in archive toggle to ignore the SKIP_CHANGE_REQUEST permission. Salient change is in the second commit.
Background
Currently we have a bug where having the SKIP_CHANGE_REQUEST permission will force the UI to attempt to directly archive a toggle, however the backend does not respect this permission and raises an error. This means a user with SKIP_CHANGE_REQUEST can neither archive the toggle directly, nor add it to a change request.
This is caused by an asymmetry in the way permissions work for archiving a toggle; SKIP_CHANGE_REQUEST is an environment level permission but archiving a toggle is a project level permission since it affects every environment.
Alternatives considered
The obvious alternative here is to allow the backend to respect this permission. We decided not to pursue this path for two reasons (discussed with @sjaanus and @FredrikOseberg).
The first is danger - that this requires quite invasive changes to the way the backend handles permissions for SKIP_CHANGE_REQUEST that would potentially have knock effects on the entire change request flow, which is already quite complex.
The second is that the SKIP_CHANGE_REQUEST permission is built to serve a particular purpose - allow trusted users who are working on time sensitive tasks like on-call to get the velocity they need. Archiving a toggle should never be a thing that needs to be done in an emergency situation. Ultimately skipping change requests here doesn't make a lot of sense
Considerations for discussion