Skip to content

Allow users to save pipeline execution policy

Alexander Turinske requested to merge 454281-allow-for-saving into master

What does this MR do and why?

Allow users to save pipeline execution policy

  • add flags for loading and removing
  • add code for network calls
  • add tests
  • standardize tests for network calls to allow for easier abstraction in the future

What does this MR not do and why?

  • the backend isn't ready, so this sets up the ability to save/edit/remove a pipeline execution policy on the frontend only following well defined patterns from other policies
  • this is the not final iteration of the design, so I am not going to ask for UX review yet
  • as seen from the code, the code added is similar to the other editor components (1, 2); I would like to investigate abstracting out the code now that there are three instances, but given the importance of making the major milestone, I would prefer to do that in a follow-up

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

save_pipeline_policy

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Upload a GitLab Ultimate license
  2. Enable feature flag
echo "Feature.enable(:pipeline_execution_policy_type)" | rails c
  1. Navigate to http://gdk.test:3443/gitlab-org/gitlab-test/-/security/policies/new?type=pipeline_execution_policy
  2. Verify the Update via merge request button is disabled by default
  3. Change the name
  4. Verify the Update via merge request button is enables
  5. Update any of the properties
  6. Click the Update via merge request button
  7. Verify the Update via merge request button shows a loading state
  8. Verify an error alert shows up at the top with a bunch of errors unrelated to this policy type because the schema on the backend hasn't been updated yet

Related to #454281 (closed)

Edited by Alexander Turinske

Merge request reports