Define merge functions for project fields
What does this MR do and why?
This MR defines merge functions for the Project.ciCdSettings
and Project.ciJobTokenScope
fields in the Apollo cache configuration for the token access app.
Why?: Apollo gives us a warning because it can't merge these fields in the cache automatically - it can't tell that the incoming field belongs to the same project as the field it has already cached, so it replaces the cached data with the incoming data. This doesn't seem to be causing any problems at the moment, but we should specify the behavior that we want so it doesn't cause problems in the future, and so we're not making additional requests for data that could have already been in the cache.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- navigate to the CI/CD settings for a project
- open the browser devtools console
- on
master
, there are warnings⚠ :Cache data may be lost when replacing the ciJobTokenScope field of a Project object.
Cache data may be lost when replacing the ciCdSettings field of a Project object.
- on this branch, those warnings should be gone
✨
- on
- check that the
Token Access
section still works as expected (a.k.a.token_access_app.vue
)-
Limit access _to_ this project
is toggle-able - Projects can be added to and removed from the allow list
-
Limit access _from_ this project
can only be turned off
-
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.