Fix CI permissions for external fork pull requests - #829
Open
hughcars wants to merge 4 commits into
Open
Conversation
hughcars
force-pushed
the
hughcars/fork-cache-permissions
branch
from
July 21, 2026 15:29
b9b8d7f to
4940468
Compare
Sbozzolo
added a commit
that referenced
this pull request
Aug 3, 2026
* Serialize Spack buildcache index writers `buildcache update-index` is a read-modify-write of the mirror's single `index.spack` tag: it lists every spec tag, rebuilds the index, and overwrites. Individual spec tags are immutable and safe to push concurrently, but two concurrent index writers are last-writer-wins, and specs banked by the loser can drop out of the index. The workflow-level concurrency groups are keyed on github.ref, so they serialize runs within a branch or PR but not across them. The index is one shared object per mirror, so two different PRs -- or a PR and a push to main -- could refresh it at the same time. Give each mirror's refresh a job-level concurrency group that deliberately omits github.ref, with cancel-in-progress: false so a second writer queues instead of clobbering. In lookahead.yml this requires promoting the refresh step to its own job, since steps cannot carry `concurrency`; it rebuilds a minimal mirror-only Spack environment the same way spack.yml already does. Its previous comment claimed no writer could race it, which held for jobs (nothing else builds against Spack develop) but not for concurrent runs. This narrows but does not close the window: the parent workflow's cancel-in-progress can still cancel a queued refresh. The index remains best-effort, and binaries stay reachable meanwhile through Spack's direct OCI-tag lookup. Extracted from #829, which bundles this with unrelated fork-permission changes. * Update .github/workflows/lookahead.yml Co-authored-by: Hugh Carson <114775781+hughcars@users.noreply.github.com> * Update .github/workflows/spack.yml Co-authored-by: Hugh Carson <114775781+hughcars@users.noreply.github.com> --------- Co-authored-by: Hugh Carson <114775781+hughcars@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix external-fork CI failures by separating read-only builds from trusted publication.
Validation
All applicable checks pass: 55 passed, with 2 expected skips.