ci: standardize release-plz workflow with robust path patching - #7
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughGitHub Actions workflow updated to checkout the client into Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as "GitHub Actions"
participant Checkout as "actions/checkout"
participant FS as "Workspace\n(aetheris-client/, aetheris-protocol/)"
participant Setup as "Setup Robust Cargo\nEnvironment (workflow step)"
participant CargoWrapper as "~/.local/bin/cargo (wrapper)"
participant Cargo as "real cargo"
participant Release as "release-plz action"
GH->>Checkout: checkout aetheris-client@repo -> aetheris-client/
GH->>Checkout: checkout aetheris-protocol@repo -> aetheris-protocol/
GH->>Setup: write ~/.cargo/config.toml with [patch.crates-io] pointing to protocol commit
GH->>Setup: install cargo wrapper at ~/.local/bin/cargo
Release->>CargoWrapper: invoke cargo (metadata/package/check)
CargoWrapper->>FS: scan and edit `Cargo.toml` to remove relative path deps
CargoWrapper->>Cargo: forward modified invocation
Cargo->>FS: build/metadata using patched config and checkouts
Cargo->>Release: return results
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/release-plz.yml (1)
37-46: Scope the cache key to the client checkout.After adding the protocol checkout,
hashFiles('**/Cargo.lock')now includes both repositories. That will invalidate the Cargo cache on unrelated protocol lockfile changes even though this job only cachesaetheris-client/target.♻️ Narrow the cache key
- key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1.95.0 + key: ${{ runner.os }}-cargo-${{ hashFiles('aetheris-client/Cargo.lock') }}-1.95.0 restore-keys: | - ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.os }}-cargo-${{ hashFiles('aetheris-client/Cargo.lock') }} ${{ runner.os }}-cargo-🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/release-plz.yml around lines 37 - 46, The Cargo cache step ("Cache Cargo") is using hashFiles('**/Cargo.lock') which picks up lockfiles from other checkouts; narrow the cache key to only the client checkout by replacing hashFiles('**/Cargo.lock') with a path restricted to the client (e.g. hashFiles('aetheris-client/Cargo.lock') or hashFiles('aetheris-client/**/Cargo.lock')) and make the same change for the restore-keys expression so the cache key/restore-keys only reflect changes inside aetheris-client while still caching aetheris-client/target.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/release-plz.yml:
- Around line 69-80: The wrapper currently hardcodes exec /usr/bin/cargo which
bypasses rustup's proxy and the selected toolchain; instead place the wrapper in
a separate directory earlier in PATH (keep using ~/.cargo/bin or create e.g.
~/.local/bin and add it to GITHUB_PATH before ~/.cargo/bin) and delegate to the
rustup-managed proxy by exec "$HOME/.cargo/bin/cargo" "$@" (or the same path as
$HOME/.cargo/bin/cargo) so the rustup-selected toolchain is honored; update the
script that creates the wrapper (the file written to ~/.cargo/bin/cargo and the
echo to $GITHUB_PATH) to reflect this delegation and avoid calling
/usr/bin/cargo directly.
- Around line 61-65: The current [patch.crates-io] entries for
aetheris-protocol, aetheris-encoder-serde and aetheris-encoder-bitpack use
floating git= URLs; capture the checked-out protocol commit SHA (set into a
variable like PROTOCOL_SHA when the repo is checked out) and change each entry
to include rev = "<SHA>" (use the captured PROTOCOL_SHA) so the config writes
git = "https://..." plus rev = PROTOCOL_SHA for deterministic resolution; update
the code that generates ~/.cargo/config.toml to insert rev = "${PROTOCOL_SHA}"
for the three package lines.
---
Nitpick comments:
In @.github/workflows/release-plz.yml:
- Around line 37-46: The Cargo cache step ("Cache Cargo") is using
hashFiles('**/Cargo.lock') which picks up lockfiles from other checkouts; narrow
the cache key to only the client checkout by replacing
hashFiles('**/Cargo.lock') with a path restricted to the client (e.g.
hashFiles('aetheris-client/Cargo.lock') or
hashFiles('aetheris-client/**/Cargo.lock')) and make the same change for the
restore-keys expression so the cache key/restore-keys only reflect changes
inside aetheris-client while still caching aetheris-client/target.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9ac753e2-190f-4fd1-811f-e4920971da76
📒 Files selected for processing (1)
.github/workflows/release-plz.yml
Standardizes the client's release workflow by introducing the same robust Cargo manifest patching logic used in the engine. This ensures historical path dependencies are resolved correctly even in temporary CI environments.
Summary by CodeRabbit