Fix release containers and restore sccache GHA caching - #1067
Conversation
📝 WalkthroughWalkthroughChangesThe release workflow now configures baked Release sccache backend contracts
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseJob
participant ConfigureAction
participant Sccache
ReleaseJob->>ConfigureAction: invoke local sccache configuration
ConfigureAction->>Sccache: probe GitHub Actions backend
Sccache-->>ConfigureAction: startup result
ConfigureAction->>Sccache: restart with local disk cache on failure
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/xtask/src/workflow_checks.rs`:
- Around line 462-475: Update release_container_job_names to recognize job-level
container declarations whose lines begin with " container:", including
shorthand values such as container: node:18, while preserving existing job
filtering. In tools/xtask/src/workflow_checks.rs lines 634-672, add a valid
shorthand-container fixture covering the SCCACHE and safe-directory contract
checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a9134667-4389-4454-936a-b8d8bd2dc12b
📒 Files selected for processing (2)
.github/workflows/release.ymltools/xtask/src/workflow_checks.rs
| fn release_container_job_names(release_workflow: &str) -> Vec<&str> { | ||
| release_workflow | ||
| .lines() | ||
| .filter_map(|line| { | ||
| let job_name = line.strip_prefix(" ")?.strip_suffix(':')?; | ||
| if job_name.is_empty() || job_name.starts_with(' ') || job_name.contains(' ') { | ||
| return None; | ||
| } | ||
| let job = workflow_job_section(release_workflow, job_name)?; | ||
| job.lines() | ||
| .any(|job_line| job_line == " container:") | ||
| .then_some(job_name) | ||
| }) | ||
| .collect() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n -C2 'container:|release_container_job_names|VALID_CONTAINER_WORKFLOW' \
tools/xtask/src/workflow_checks.rs .github/workflowsRepository: Mesh-LLM/mesh-llm
Length of output: 13197
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== workflow_checks outline =="
ast-grep outline tools/xtask/src/workflow_checks.rs --view expanded | sed -n '1,220p' || true
echo "== relevant checks implementation =="
sed -n '390,475p' tools/xtask/src/workflow_checks.rs
echo "== workflow parser/job section helpers =="
rg -n -C3 '(fn workflow_job_section|struct .*Yaml|serde|toml|yaml|Job|jobs:|container:)' tools/xtask/src/workflow_checks.rs
echo "== package deps for yaml parser =="
rg -n 'yaml|toml|serde|serde_yaml|kdl|ron' tools/Cargo.toml tools/xtask/Cargo.toml Cargo.tomlRepository: Mesh-LLM/mesh-llm
Length of output: 5432
🌐 Web query:
GitHub Actions jobs.<job_id>.container shorthand syntax container: node:18 allowed
💡 Result:
Yes, the shorthand syntax container: node:18 is valid and allowed in GitHub Actions [1][2][3]. When you only need to specify a container image, you can omit the image keyword and define the image directly as the value of the container key [2][3]. This is functionally equivalent to providing a configuration object with the image defined, such as: container: image: node:18 This shorthand is documented in official GitHub Actions resources as a valid way to simplify workflow configurations [2][3].
Citations:
- 1: https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/run-jobs-in-a-container
- 2: https://docs.github.com/actions/using-jobs/running-jobs-in-a-container
- 3: https://docs.github.com/en/enterprise-server@3.18/actions/how-tos/write-workflows/choose-where-workflows-run/run-jobs-in-a-container
Recognize shorthand container declarations.
The exact job_line == " container:" match skips supported declarations such as container: node:18, so shorthand container jobs miss the SCCACHE and safe-directory contract checks.
tools/xtask/src/workflow_checks.rs#L462-L475: detect any job-level line beginning withcontainer:.tools/xtask/src/workflow_checks.rs#L634-L672: add a valid shorthand-container fixture.
Proposed fix
- .any(|job_line| job_line == " container:")
+ .any(|job_line| job_line.strip_prefix(" container:").is_some())📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn release_container_job_names(release_workflow: &str) -> Vec<&str> { | |
| release_workflow | |
| .lines() | |
| .filter_map(|line| { | |
| let job_name = line.strip_prefix(" ")?.strip_suffix(':')?; | |
| if job_name.is_empty() || job_name.starts_with(' ') || job_name.contains(' ') { | |
| return None; | |
| } | |
| let job = workflow_job_section(release_workflow, job_name)?; | |
| job.lines() | |
| .any(|job_line| job_line == " container:") | |
| .then_some(job_name) | |
| }) | |
| .collect() | |
| fn release_container_job_names(release_workflow: &str) -> Vec<&str> { | |
| release_workflow | |
| .lines() | |
| .filter_map(|line| { | |
| let job_name = line.strip_prefix(" ")?.strip_suffix(':')?; | |
| if job_name.is_empty() || job_name.starts_with(' ') || job_name.contains(' ') { | |
| return None; | |
| } | |
| let job = workflow_job_section(release_workflow, job_name)?; | |
| job.lines() | |
| .any(|job_line| job_line.strip_prefix(" container:").is_some()) | |
| .then_some(job_name) | |
| }) | |
| .collect() |
📍 Affects 1 file
tools/xtask/src/workflow_checks.rs#L462-L475(this comment)tools/xtask/src/workflow_checks.rs#L634-L672
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tools/xtask/src/workflow_checks.rs` around lines 462 - 475, Update
release_container_job_names to recognize job-level container declarations whose
lines begin with " container:", including shorthand values such as container:
node:18, while preserving existing job filtering. In
tools/xtask/src/workflow_checks.rs lines 634-672, add a valid
shorthand-container fixture covering the SCCACHE and safe-directory contract
checks.
Summary
sccachebinary to GitHub Actions cache without downloading a second binarySCCACHE_GHA_ENABLED=false, then export the ephemeral cache URL/token and probe the remote backendsccachewith job-local disk storage when the GHA backend cannot initializeRoot cause
Release run 30058024843 exposed two regressions from the runner-image migration:
sccache, but the release workflow inheritedSCCACHE_GHA_ENABLED=truewithout the Actions cache URL/token normally exported by a setup action. Cargo therefore failed before invokingrustc.$GITHUB_WORKSPACE, sorelease-version.shfailed whengit ls-filesrejected the checkout as dubious ownership.The publish job requires every platform lane, so these failures prevented the tag, GitHub release, packaging dispatch, and crates.io publication.
Cache behavior
The repository-local
configure-sccache-ghaaction uses pinnedactions/github-scriptto expose the cache credentials already present in an Actions step to the bakedsccache. It probes the remote backend by starting the server. If initialization fails, it stops that server, disables the GHA backend, and requires a successful job-local restart before compilation continues.Validation
actionlint -config-file .github/actionlint.yamlgit diff --checkcargo fmt --all --checkcargo test -p xtask(9 passed)cargo check -p xtaskcargo clippy -p xtask --all-targets -- -D warningscargo run -p xtask -- repo-consistency release-targetsA full
canary=truerelease dispatch should be run after merge and before retryingv0.74.0; this PR does not dispatch a release.Summary by CodeRabbit