From 519ee596dd0c8639bc5ea98269598002bfa4055e Mon Sep 17 00:00:00 2001 From: Bastien Abadie Date: Thu, 18 Jul 2024 16:01:44 +0200 Subject: [PATCH] Setup checkout cache for code review testing hook (#32) * Setup checkout cache for code review testing hook * Request cache scope for code-review-testing hook * Set scope on runtime role too --- grants.yml | 1 + hooks.yml | 1 + hooks/project-relman/code-review-testing.yml | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/grants.yml b/grants.yml index f65d46ec..43b7dd75 100644 --- a/grants.yml +++ b/grants.yml @@ -2583,6 +2583,7 @@ - grant: - secrets:get:project/relman/code-review/runtime-testing - hooks:trigger-hook:project-relman/code-review-testing + - generic-worker:cache:code-review-testing-checkout to: - roles: - project:relman:code-review/runtime/testing diff --git a/hooks.yml b/hooks.yml index 8eefb2dc..1adf3e34 100644 --- a/hooks.yml +++ b/hooks.yml @@ -138,6 +138,7 @@ project-relman/code-review-testing: - queue:route:notify.email.* - queue:scheduler-id:relman - secrets:get:project/relman/code-review/runtime-testing + - generic-worker:cache:code-review-testing-checkout template_file: hooks/project-relman/code-review-testing.yml bindings: - exchange: exchange/taskcluster-queue/v1/task-completed diff --git a/hooks/project-relman/code-review-testing.yml b/hooks/project-relman/code-review-testing.yml index f5578be7..681e316a 100644 --- a/hooks/project-relman/code-review-testing.yml +++ b/hooks/project-relman/code-review-testing.yml @@ -16,12 +16,15 @@ payload: public/results: path: /tmp/results type: directory - cache: {} + cache: + code-review-testing-checkout: '/checkouts' capabilities: {} command: - code-review-bot - '--taskcluster-secret' - project/relman/code-review/runtime-testing + - '--mercurial-repository' + - '/checkouts' env: $merge: - $if: firedBy == 'triggerHook' @@ -54,5 +57,6 @@ scopes: - 'secrets:get:project/relman/code-review/runtime-testing' - 'index:insert-task:project.relman.testing.code-review.*' - 'notify:email:*' + - 'generic-worker:cache:code-review-testing-checkout' tags: {} workerType: bot-gcp