Add mutation for clearing project runner cache
What does this MR do and why?
Currently, clearing a project's runner cache is only possible via the UI. Users have requested that it be available via an API as well. This commit adds a new RunnerCacheClear
GraphQL mutation that can be used to clear a project's runner cache. It requires that the current user have admin_pipeline
permissions on the project, which is the same permission used in the UI.
Changelog: added
Issue: #390684 (closed)
How to set up and validate locally
-
Pick a project and check its
jobs_cache_index
in the Rails console. It should benil
or an integer. -
Run the
RunnerCacheClear
mutation ingraphql-explorer
.$projectId
must be the Global ID of the projectmutation RunnerCacheClear($projectId: ProjectID!) { runnerCacheClear(input: { projectId: $projectId }) { errors } }
-
Recheck the project and see that its
jobs_cache_index
has been incremented. If it wasnil
it should now be1
. If it was an integer it should now be one higher.