Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions Cache refresh cannot be triggered from the main branch #16561

Closed
1 of 4 tasks
JunTaoLuo opened this issue Dec 22, 2023 · 0 comments · Fixed by #16562
Closed
1 of 4 tasks

Github Actions Cache refresh cannot be triggered from the main branch #16561

JunTaoLuo opened this issue Dec 22, 2023 · 0 comments · Fixed by #16562
Assignees
Labels
DevOps CMS team practice area

Comments

@JunTaoLuo
Copy link
Contributor

JunTaoLuo commented Dec 22, 2023

User Story or Problem Statement

This was an unplanned work item and was a bug discovered after the original PR was merged.

Description or Additional Context

This is a bug introduced in #16279. Due to the scoped nature of Github Actions Cache, cron jobs cannot restore the cache entries created in pull request scope since cron jobs are triggered from the main branch scope. As such we need a mechanism for the cron job to trigger a build from the pull request scope. The current proposal is to use labels to trigger a workflow from the PR scope to refresh tokens.

Steps for Implementation

Alternative considered included trying to workaround the scope limitation by manipulating the cache scope inside the workflow on main and PR branches but this was too complicated and not likely possible.

Another alternative considered was to trigger a workflow directly in the PR branch from the cron job in the main branch but there's a limitation to the scopes that can be specified from a PR workflow. The required scope is refs/pull/<PR>/merge whereas triggering a workflow is only possible with refs/heads/<PR branch>.

Acceptance Criteria

Cache entries for each Preview ID associated with an open PR must be refreshed to ensure GHA is able to rebuild and delete Tugboat previews as necessary.

Team

Please check the team(s) that will do this work.

  • CMS Team
  • Public Websites
  • Facilities
  • Accelerated Publishing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps CMS team practice area
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant