Use context config for secrets mutations
What does this MR do and why?
This is part of the refactoring effort for #577464.
The secrets manager is currently only scoped to projects, but we are working on providing the same feature on the group level as well. On the frontend side, the UX for both project and group secrets are largely the same, so the same Vue components will be reused. Only the GraphQL queries/mutations will be different.
A context configuration file (ee/app/assets/javascripts/ci/secrets/context_config.js) was introduced in !219061 (merged) that lists the different GraphQL queries, mutations, and event tracking options depending on if context === 'project' or context === 'group'. This allows us to easily swap these around while keeping the frontend behavior the same. The context config also allows us to easily see the differences between contexts, and what features have been implemented (or need implementation) in both.
This MR implements the use of the context config for creating, updating, and deleting project secrets. In future MRs, we will use the same config for the group context as well.
It touches on a lot of files, but the changes are actually quite small. It might be easier to review this by commit.
| Commit | Commit Message |
|---|---|
| !221837 (00e8f02f) | Inject fullPath and contextConfig instead of passing them as props. These are used in a lot of child components and are available from the root component, so it's easier in the long run to provide them than to manage passing them around as props |
| !221837 (7c4c9cbf) | Use context config for mutations. We are still using the same GraphQL mutations, so there shouldn't be any changes in the tests aside from fixing where we get the mutation. |
| !221837 (0e523d99) | Rename mutations (append/specify project to differentiate it from group mutations later) |
Implementation Plan
| MR | Description |
|---|---|
| !219061 (merged) | Create a context config that will house the project and group GraphQL queries and mutations and use it for queries |
|
|
Use the context config for GraphQL mutations (create/update/delete secrets) |
Screenshots or screen recordings
There are no feature changes, so pipelines/tests should pass and create/update/delete should work as expected.
How to set up and validate locally
- Upload a Premium license (or above).
- Set up openbao and enable the secrets manager on your gdk.
- Enable the
secrets_managerfeature flag. - Go to your project/group settings (Settings > General) and expand Visibility, project features, permissions or Permissions and group features and enable the group secrets manager.
- Go to
/path-to-project/-/secretsand verify that you can create, update, and delete secrets.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.