Skip to content

Add UI for CI_JOB_TOKEN permission settings

Mireya Andres requested to merge ci/job-token-push-repo into master

What does this MR do and why?

Implements #465375. Depends on !154111 (merged).

This adds the UI and documentation for allowing jobs write access to the project when they use the CI_JOB_TOKEN. Since the feature uses the allow_push_repository_for_job_token feature flag, the UI setting is also hidden behind the same feature flag.

Documentation leads to https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html#push-to-a-project-repository-using-a-job-token.

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

FF disabled FF enabled
Screenshot_2024-06-28_at_16.14.01 Screen_Recording_2024-06-28_at_16.11.23

How to set up and validate locally

  1. Enable the feature flag
    rails c
    Feature.enable(:allow_push_repository_for_job_token, <project>)
  2. Go to /-/settings/ci_cd and expand the Token Access section.
  3. Allow push to the repository should be disabled by default.
  4. Check the checkbox and save the changes. A toast message should pop up when the update is successful.
  5. Changes persist when you refresh the page.
Edited by Mireya Andres

Merge request reports