perf(ci): cache Caddy binary in e2e job - #43
Conversation
Replaces the apt-get keyring + install approach (~40-60s) with a direct tarball download cached by version, reducing cache hits to ~5s. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe CI/E2E workflow now installs Caddy v2.9.1 by resolving the runner architecture (amd64/arm64, failing on unsupported values), then using actions/cache keyed by OS+arch+version to store the downloaded Linux binary. The workflow downloads and extracts the GitHub release tarball only on cache miss, copies the Changes
Estimated code review effort🎯 Medium | ⏱️ ~30 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Confidence Score: 5/5Safe to merge — the implementation is correct and the previously raised arch-awareness concern has been fully addressed. No P0 or P1 issues remain. The cache key includes runner.arch, the download URL is arch-aware via the resolution step, runner.temp and RUNNER_TEMP refer to the same path so the cache/download/install chain is consistent, and the unconditional Install Caddy step is intentional since the binary always needs to be copied to /usr/local/bin regardless of cache hit or miss. No files require special attention. Reviews (2): Last reviewed commit: "fix(ci): fix Caddy cache path and add ar..." | Re-trigger Greptile |
ApprovabilityVerdict: Needs human review CI caching optimization for Caddy binary. An unresolved review comment raises a security concern about downloading executables without integrity verification (checksums/signatures), which warrants human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/ci-e2e.yml:
- Around line 128-130: The workflow currently streams and extracts the Caddy
tarball directly into /usr/local/bin (the curl | tar step for
caddy_2.9.1_linux_amd64.tar.gz and chmod +x /usr/local/bin/caddy); change this
to first download the tarball and the corresponding caddy_2.9.1_checksums.txt
(and its signature), verify the checksums file signature with cosign (or
Sigstore) to ensure authenticity, compute and compare the tarball SHA256 against
the verified checksums entry, and only if the checksum matches proceed to
extract the tarball and run sudo chmod +x /usr/local/bin/caddy. Include clear
failure exits on signature or checksum mismatch.
- Around line 118-126: The cache step "caddy-cache" currently caches
/usr/local/bin/caddy (root-owned) which causes permission errors; change the
cache path to a user-writable location such as $RUNNER_TEMP/caddy or
./.cache/caddy (update the actions/cache step's path and keep the same key
caddy-${{ runner.os }}-2.9.1), then after the cache restore (in the "Install
Caddy" or a new step) copy the cached file into /usr/local/bin/caddy using sudo
(e.g., sudo cp $RUNNER_TEMP/caddy /usr/local/bin/caddy && sudo chmod +x
/usr/local/bin/caddy) so the cache is read/written as the runner user and the
binary is placed with root permissions afterward.
🪄 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: 709c0aeb-4db5-4520-bd0a-cfb794724657
📒 Files selected for processing (1)
.github/workflows/ci-e2e.yml
| curl -fsSL "https://github.com/caddyserver/caddy/releases/download/v2.9.1/caddy_2.9.1_linux_amd64.tar.gz" \ | ||
| | sudo tar -xz -C /usr/local/bin caddy | ||
| sudo chmod +x /usr/local/bin/caddy |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's examine the workflow file to understand the full context
cat -n .github/workflows/ci-e2e.yml | head -150 | tail -30Repository: fluffyx/github-workflows
Length of output: 1328
🌐 Web query:
Caddy releases integrity verification checksums GPG signatures
💡 Result:
Caddy provides checksums and cryptographic signatures for verifying the integrity and authenticity of its release artifacts (binaries, source tarballs). Since v2.6.0, they use Sigstore (not traditional GPG) for signing. No GPG signatures on binaries or checksums themselves. Process: 1. Download from GitHub releases (e.g., https://github.com/caddyserver/caddy/releases): binary tar.gz/zip, caddy_VERSION_checksums.txt (SHA256 sums of binaries), checksums.txt.sig, checksums.txt.pem. 2. Verify checksums.txt integrity/authenticity first (protects all binary checksums): - Install cosign (https://github.com/sigstore/cosign). - Run: COSIGN_EXPERIMENTAL=1 cosign verify-blob --certificate caddy_VERSION_checksums.txt.pem --signature caddy_VERSION_checksums.txt.sig caddy_VERSION_checksums.txt - Expect "Verified OK" + tlog entry. 3. Compute SHA256 of your binary and match against checksums.txt (e.g., sha256sum caddy_VERSION_linux_amd64.tar.gz). 4. Optionally verify individual binary: cosign verify-blob --certificate binary.pem --signature binary.sig binary.tar.gz. Full details: https://caddyserver.com/docs/signature-verification. All logged in Sigstore Rekor transparency log. APT/Yum repos use separate GPG keys (Cloudsmith, rotated periodically). Git tags use GPG/SSH signatures (not for binaries).
Citations:
- 1: https://caddyserver.com/docs/signature-verification
- 2: http://caddyserver.com/docs/install
- 3: https://github.com/caddyserver/caddy/releases/tag/v2.11.1
- 4: https://github.com/caddyserver/caddy-docker/blob/master/getChecksums.sh
Add integrity checks before unpacking the release tarball.
This downloads an executable over the network and unpacks it directly into PATH without verification. Caddy provides SHA256 checksums and Sigstore signatures for release verification—download caddy_2.9.1_checksums.txt, verify its signature with cosign, then validate the tarball SHA256 before extraction.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/ci-e2e.yml around lines 128 - 130, The workflow currently
streams and extracts the Caddy tarball directly into /usr/local/bin (the curl |
tar step for caddy_2.9.1_linux_amd64.tar.gz and chmod +x /usr/local/bin/caddy);
change this to first download the tarball and the corresponding
caddy_2.9.1_checksums.txt (and its signature), verify the checksums file
signature with cosign (or Sigstore) to ensure authenticity, compute and compare
the tarball SHA256 against the verified checksums entry, and only if the
checksum matches proceed to extract the tarball and run sudo chmod +x
/usr/local/bin/caddy. Include clear failure exits on signature or checksum
mismatch.
Cache to RUNNER_TEMP (user-writable) instead of /usr/local/bin to avoid root-ownership issues with actions/cache. Add arch resolution step so the cache key and download URL stay in sync across amd64 and arm64 runners. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate b62a1ff
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/ci-e2e.yml (1)
134-143:⚠️ Potential issue | 🟠 MajorVerify the Caddy release artifact before extracting it.
This still streams a remote executable tarball straight into
tarand then installs it intoPATHwithout checksum or signature verification. Please add release integrity checks before unpacking the binary.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c77a565a-c5bc-4492-a2ac-e637422bd45d
📒 Files selected for processing (1)
.github/workflows/ci-e2e.yml
Replaces the apt-get keyring ceremony + install (~40-60s) with a direct tarball download from GitHub Releases, cached by pinned version (
2.9.1). On a cache hit the Install Caddy step is skipped entirely, reducing it to ~5s. On a cache miss it still runs faster than the old apt-get path. To upgrade Caddy, bump the version in both the cachekeyand thecurlURL.🤖 Generated with Claude Code
Note
Cache Caddy binary in e2e CI job to speed up workflow runs
RUNNER_TEMPand copied to/usr/local/bin.Macroscope summarized b62a1ff.