Skip to content

Fix CI permissions for external fork pull requests - #829

Open
hughcars wants to merge 4 commits into
mainfrom
hughcars/fork-cache-permissions
Open

Fix CI permissions for external fork pull requests#829
hughcars wants to merge 4 commits into
mainfrom
hughcars/fork-cache-permissions

Conversation

@hughcars

@hughcars hughcars commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix external-fork CI failures by separating read-only builds from trusted publication.

  • Fork PRs may read Spack caches but cannot publish caches, indices, or containers.
  • Trusted jobs publish dependencies separately and serialize index updates.
  • Long Tests run in the read-only PR workflow; a metadata-only trusted workflow reports their status without executing fork code.

Validation

All applicable checks pass: 55 passed, with 2 expected skips.

@hughcars
hughcars requested a review from Sbozzolo July 21, 2026 12:57
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants