Skip to content

Define merge functions for project fields

Miranda Fluharty requested to merge add-cache-config-to-token-access-app into master

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
Screenshot_2023-11-01_at_15.33.28 Screenshot_2023-11-01_at_16.27.29

How to set up and validate locally

  1. navigate to the CI/CD settings for a project
  2. 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
  3. 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.

Edited by Miranda Fluharty

Merge request reports