Allow Developers to clear project runner caches by default

What does this MR do and why?

Developers often need to clear a project's runner cache when dependencies or tests leave it in a bad state. Previously, they had to ask a Maintainer to do so. This MR grants the existing clear_runner_cache permission to project Developers by default. Maintainers and Owners inherit it; Guests and Reporters remain denied.

The existing controller action, pipeline UI, and RunnerCacheClear GraphQL mutation now check this permission. Granular personal access tokens still require the clear_runner_cache scope. There is no project opt-in setting or API for configuring one.

Successful resets now record a project_runner_cache_cleared project audit event. Clearing a cache can also make the next pipeline, including a protected-branch pipeline, fetch dependencies again. The documentation recommends pinning dependencies to avoid fetching an unreviewed upstream release.

References

Resolves #221634

Screenshots or screen recordings

Not applicable. No new UI control was added; the existing Clear runner caches button becomes available to Developers.

How to set up and validate locally

  1. As a Developer on a project, visit Build > Pipelines. Confirm Clear runner caches is visible and that clearing the cache succeeds without changing project settings.
  2. Confirm a Maintainer or Owner can clear the cache, while a Guest or Reporter cannot.
  3. Confirm the RunnerCacheClear GraphQL mutation follows the same role permission and that granular personal access tokens still require clear_runner_cache authorization.
  4. On Premium or Ultimate, confirm a successful reset appears as project_runner_cache_cleared under the project's Secure > Audit events page.

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.

Edited by Jimmy Spagnola

Merge request reports

Loading
Loading