Skip to content

[ci] Separate testing from privileged publication - #3513

Open
joshlf wants to merge 1 commit into
mainfrom
Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq
Open

[ci] Separate testing from privileged publication#3513
joshlf wants to merge 1 commit into
mainfrom
Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq

Conversation

@joshlf

@joshlf joshlf commented Jul 31, 2026

Copy link
Copy Markdown
Member

Same-repository PRs previously gave the core image builder
package-write authority, and Anneal tests received repository-write
authority only to store timing data. Make both producers read-only.
Publish the Docker cache from a successful default-branch workflow and
validated benchmarks from the trusted docs coordinator.

Add a semantic workflow check which rejects any write-capable
GITHUB_TOKEN in pull-request or merge-group workflows. This makes the
trust boundary a repository invariant instead of a job convention.

Split manual Anneal toolchain releases into immutable source
resolution, unprivileged patch and archive production, trusted artifact
review, release publication, and PR submission. Validate the archive
set, metadata, hashes, URLs, sizes, release target, and final patch at
each boundary. No job which executes selected-branch code receives a
write credential.

Make asset publication resumable: reuse a correctly targeted draft,
accept matching assets, repair missing draft assets, and reject any
mismatch before publishing the prerelease and opening its release PR.


Latest Update: v7 — Compare vs v6

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v6 v5 v4 v3 v2 v1 Base
v7 vs v6 vs v5 vs v4 vs v3 vs v2 vs v1 vs Base
v6 vs v5 vs v4 vs v3 vs v2 vs v1 vs Base
v5 vs v4 vs v3 vs v2 vs v1 vs Base
v4 vs v3 vs v2 vs v1 vs Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq && git checkout -b pr-Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq FETCH_HEAD

Checkout

git fetch origin refs/heads/Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq

Stacked PRs enabled by GHerrit.

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (5a907c2) to head (a06310f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3513   +/-   ##
=======================================
  Coverage   91.85%   91.85%           
=======================================
  Files          20       20           
  Lines        6093     6093           
=======================================
  Hits         5597     5597           
  Misses        496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 305a98b058

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +456 to +457
if not events.intersection(_UNTRUSTED_EVENTS):
return []

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject untrusted workflows without an explicit permission cap

When a pull_request or merge_group workflow omits permissions entirely, this path returns only the collected explicit permission issues, so the checker accepts it. GitHub then applies the organization or repository's default GITHUB_TOKEN permissions; where that default is read/write, a same-repository PR can execute proposed code with write authority, defeating the guard's stated purpose. Require an explicit workflow-level permissions: {} or read-only mapping for every untrusted workflow instead of treating absence as safe.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/anneal-release.yml Outdated
Comment on lines +311 to +313
retention-days: 1
archive: false
overwrite: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retain release artifacts through environment approval

When the release environment requires manual approval and approval arrives more than a day after the matrix finishes, these toolchain archives—and the metadata artifacts configured the same way below—have already expired because their retention is only one day. The gated publish-release-assets job then cannot download its required inputs, so an otherwise successful multi-platform release must be rebuilt and reapproved; retain these artifacts for at least the maximum expected approval delay.

Useful? React with 👍 / 👎.

Comment on lines +175 to +178
uses: ./.github/actions/upload-file-artifact
with:
name: CI Durations
tool: 'customSmallerIsBetter'
output-file-path: output.json
gh-pages-branch: benchmark-data
auto-push: true
save-data-file: true
benchmark-data-dir-path: dashboard
fail-on-alert: false
github-token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ env.ANNEAL_BENCHMARK_ARTIFACT }}
path: ${{ env.ANNEAL_BENCHMARK_ARTIFACT }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve benchmarks long enough for delayed CI reruns

When one CI workflow succeeds but the other is repaired by a rerun more than 24 hours later, docs.yml deliberately selects the original successful Anneal run, but this composite uploader hard-codes retention-days: 1; the benchmark download therefore fails and blocks the repaired documentation deployment. Use a longer-lived artifact for this cross-workflow contract or make the benchmark publisher tolerate an expired benchmark input.

Useful? React with 👍 / 👎.

@joshlf
joshlf force-pushed the Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq branch 3 times, most recently from e166a02 to 43998f3 Compare July 31, 2026 23:45
@joshlf
joshlf force-pushed the Gythmn2x4ak26nzocje3gxts44y7itqe6 branch 2 times, most recently from 0be71f6 to a49d29d Compare August 1, 2026 00:04
@joshlf
joshlf force-pushed the Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq branch from 43998f3 to df82b8b Compare August 1, 2026 00:04
Base automatically changed from Gythmn2x4ak26nzocje3gxts44y7itqe6 to main August 1, 2026 00:08
Same-repository PRs previously gave the core image builder
package-write authority, and Anneal tests received repository-write
authority only to store timing data. Make both producers read-only.
Publish the Docker cache from a successful default-branch workflow and
validated benchmarks from the trusted docs coordinator.

Add a semantic workflow check which rejects any write-capable
GITHUB_TOKEN in pull-request or merge-group workflows. This makes the
trust boundary a repository invariant instead of a job convention.

Split manual Anneal toolchain releases into immutable source
resolution, unprivileged patch and archive production, trusted artifact
review, release publication, and PR submission. Validate the archive
set, metadata, hashes, URLs, sizes, release target, and final patch at
each boundary. No job which executes selected-branch code receives a
write credential.

Make asset publication resumable: reuse a correctly targeted draft,
accept matching assets, repair missing draft assets, and reject any
mismatch before publishing the prerelease and opening its release PR.

gherrit-pr-id: Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq
@joshlf
joshlf force-pushed the Grlosy5kwxiwxexwdtdxzx7i2ezmymtrq branch from df82b8b to a06310f Compare August 1, 2026 00:08
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