Use GraphQL in create_merge_request_button.vue instead of REST
Why are we doing this work
As the Security Configuration page gets more featureful, more scanners will need a UI control for enabling them (e.g., &4908 (closed) and #263251 (closed)).
There is an existing one, create_merge_request_button.vue
, but there are a number of issues with it:
- It's currently [only used for SAST](https://gitlab.com/gitlab-org/gitlab/blob/24a1f22b3abf659f2185e57937043a3288595750/ee/app/assets/javascripts/security_configuration/components/manage_feature.vue#L66-70
- In practice it's never displayed, because the SAST Configuration UI link/button supersedes it (which is enabled by default, although that feature flag should probably be removed entirely now)
- It uses requires a REST endpoint (contrary to our GraphQL-first policy)
The goal is a button that can be used for any scanner, and send the given GraphQL mutation (that matches the behaviour of Mutation.configureSast
), and redirects to the returned new MR path.
We also have a manage_sast.vue
component that's used in the Static (CE) Security Configuration page. This could also be replaced by this new component.
Relevant links
Non-functional requirements
- [-] Documentation:
- [-] Feature flag: Not necessary for a straight-forward component change
- [-] Performance:
-
Testing: Unit/component tests
Implementation plan
-
frontend Implement new button component (perhaps based on manage_sast.vue
) -
frontend Consume new component wherever manage_sast.vue
andcreate_merge_request_button.vue
are used
Edited by Mark Florian