Skip to content

chore: cut CI runtime with cached Rust dependencies and merge queue support - #559

Merged
RentnerKev merged 5 commits into
mainfrom
rentner/chore/ci-runtime
Nov 24, 2026
Merged

RentnerKev merged 5 commits into
mainfrom
rentner/chore/ci-runtime

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Why

Platform CI regularly took 25–33 minutes per PR. Measurements from recent runs:

Workflow Duration Main cost
Production Smokes 29–33 min Image build 15.6 min, of which the in-Docker Rust release compile alone took 714 s; then appliance smokes 12 min
ARM64 Appliance 33 min Native image build 19.8 min, then smokes
App Runtime Reference 25 min Appliance build 12–13 min per architecture (twice on PRs), Playwright apt refresh 6–8 min on AMD64
CI 12–20 min Rust 10–14 min, Web Tests 12 min

The Actions cache sat at 10.3 / 10 GB, and a single PR push started 42 jobs against the 20-runner limit, which caused up to 5.5 min queueing on the critical path.

What changes

Rust dependency layer (largest win)

  • The production, proxy-runtime and coverage Dockerfiles gain a controller-dependencies stage that compiles the locked dependency graph against placeholder targets. It depends only on core/Cargo.toml and core/Cargo.lock; the controller stage then rebuilds only the own crate. The placeholder crate is removed with cargo clean --package, so the real controller is always rebuilt.

Registry build cache

  • New Build Cache workflow (main pushes, weekly, manual) exports every stage of the production image (amd64, arm64) and the coverage image (amd64) to ghcr.io/rentnerproxy/platform-build-cache. It is the only job with packages: write for that package.
  • Runtime images, App Runtime Reference, the Web Tests coverage image, the Caddy/Beta 2 fixtures and PR previews read it anonymously; none of them writes it, and the smoke workflow keeps its read-only permissions. Appliance, proxy-runtime and coverage builds no longer export to the 10 GB Actions cache.

Actions cache hygiene

  • Rust coverage and release caches are keyed on manifests and toolchain only (no new 1 GB entry per main push), without incremental directories, and CARGO_INCREMENTAL=0.

Merge queue support (opt-in)

  • merge_group on every workflow that provides a required check. Change detection, Gitleaks and compatibility source selection handle the event; Dependency Review and PR Preview Source skip in the queue.
  • With the repository variable CI_MERGE_QUEUE=true, Production Smokes reports immediately on PRs and runs the full runtime verification once in the merge queue on the exact merge result. Without the variable, behaviour is unchanged.

Fewer jobs and less waiting

  • Removed the Fuzz Tests pass-through job (fuzz tests already run inside Web Tests); the exact-revision release verification no longer expects it.
  • PR previews are built only for PRs labelled preview; the trusted gate returns not-requested before polling required checks for up to 25 minutes.
  • Change detection clones history without blobs.
  • App Runtime Reference installs Chromium system packages only when a library is missing.

Toolchain (not changed here)

  • CI stays on Rust 1.99.1 like rust-toolchain.toml. Rust 1.100.0, which the Dockerfiles ship, merges well-covered coverage regions (38,706 instead of 57,183 for the same code) and pushes every Rust coverage group below the 90 percent region gate, so the bump needs its own decision on that gate.
  • Kept: core/src/runtime/acme_http.rs uses an irrefutable let Ok(..) for the uninhabited body error. It builds with 1.99.1 and clears the unreachable_code error that 1.100.0 reports.

Docs

  • .github/WORKFLOWS.md describes the build cache, merge queue switch, preview label and current versions.

Maintainer follow-up

  1. After the first Build Cache run on main, set the platform-build-cache package visibility to public so fork and Dependabot PRs can read it anonymously. Until then, image builds run without the registry cache.
  2. To move runtime verification into the merge queue: enable the merge queue in the main ruleset, turn off "require branches to be up to date", then set the repository variable CI_MERGE_QUEUE=true.

This PR's own run cannot use the registry cache yet (it does not exist before merge), so its image builds still compile everything.

Verification

  • Workflow and tooling tests in a Linux container: same 5 environment-related failures as on main (git history/tags, an existing cross-file mock.module import error), no new failures; the bash-based gate scenarios ran there.
  • typecheck:scripts, the web type check and oxlint (including type-aware rules) on the changed files.
  • Clippy with Rust 1.100.0 (--all-targets --all-features -D warnings) after the acme_http.rs fix, also on the tree merged with main.
  • Local Docker build of controller-build (amd64) including the static musl check. After a source-only change, the dependency stage was CACHED and only rentnerproxy-controller was compiled (1 instead of 286 crates). The controller crate itself still takes about 4 minutes locally, so expect the image build to shrink by the dependency share, not to near zero.
  • Not verifiable before merge: the Build Cache registry export, anonymous reads of the new package, and merge_group runs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Pull request previews are now requested by adding the preview label.
    • CI checks now support merge-queue runs, with runtime checks deferred to the queue when configured.
  • Improvements
    • Build caching is updated across CI and production-image workflows.
  • Documentation
    • Workflow documentation now reflects current triggers, checks, cache behavior, and preview requirements.

RentnerKev and others added 2 commits November 24, 2026 19:23
…upport

- Compile the locked Rust dependency graph in a manifest-keyed
  controller-dependencies stage (production, proxy-runtime, coverage), so
  source-only changes rebuild just the controller instead of ~12 minutes of
  dependencies.
- Add a main-only Build Cache workflow that exports those stages to
  ghcr.io/rentnerproxy/platform-build-cache; verification, coverage, fixture
  and preview builds only read it and stop exporting large layers into the
  10 GB Actions cache.
- Key Rust coverage and release caches on manifests and toolchain only,
  drop incremental state and set CARGO_INCREMENTAL=0.
- Add merge_group support to every workflow with a required check, and let
  Production Smokes defer pull request runtime verification to the merge
  queue when the repository variable CI_MERGE_QUEUE is true.
- Remove the Fuzz Tests pass-through job, build PR previews only for PRs
  labelled "preview", clone history without blobs for change detection and
  install Chromium system packages only when a library is missing.
- Align CI on Rust 1.100.0, the version the Dockerfiles ship, and fix its
  new unreachable_code finding in the ACME HTTP client.
- Document the build cache, merge queue switch and preview label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0539fae and c24281e.

Files selected for processing: 5

  • .github/WORKFLOWS.md
  • .github/workflows/app-runtime-reference.yml
  • .github/workflows/beta2-integration.yml
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml

No actionable comments were generated in the recent review.

Walkthrough

This change updates CI and merge-queue checks, adds a registry-backed BuildKit cache, gates pull-request previews on the preview label, updates Rust toolchain references, and changes ACME request-body collection error handling.

Changes: CI and Merge-Queue Checks

Layer / File(s) Summary
Merge-group detection and runtime deferral
.github/scripts/ci/changes.ts, .github/workflows/detect-changes.yml, web/src/tests/tooling/github/changes.test.ts
Change detection accepts merge-group revisions. Runtime checks can be deferred for opted-in pull requests. Tests cover comparisons and deferral conditions.
Merge-group workflow integration
.github/workflows/ci.yml, .github/workflows/{codeql,dependency-review,dependency-security,gitleaks,workflow-lint}.yml, .github/scripts/security/scan-commits.sh, scripts/compatibility/source-selection.ts, web/src/tests/tooling/github/{dependency-workflows,release-compatibility}.test.ts, .github/WORKFLOWS.md
Selected workflows and compatibility source selection handle merge-group events. The commit scanner uses queue SHAs. The workflow documentation updates trigger and workflow descriptions.
Production Smokes runtime deferral
.github/workflows/production-smokes.yml, web/src/tests/tooling/production-smokes-workflow.test.ts
Production Smokes passes the deferral setting to change detection and reports deferred verification separately from unchanged inputs.
CI job and toolchain updates
rust-toolchain.toml, .github/workflows/{app-runtime-reference,autofix,beta2-integration,ci,codeql}.yml, .github/scripts/{distribution/install-verifier.sh,release/verify-exact-revision-ci.ts}, web/src/tests/tooling/github/changes.test.ts
Rust references move to 1.100.0. CI removes the standalone Fuzz Tests job, revises Rust cache keys, and changes Chromium setup. Related verification tests and workflow documentation are updated.

Registry BuildKit Cache

Layer / File(s) Summary
Manifest-based controller dependency stages
docker/{production,proxy-runtime}/Dockerfile, docker/tooling/coverage/Dockerfile, web/src/tests/tooling/github/ci-build-cache.test.ts
Docker builds compile locked dependencies from manifests and placeholder source files before adding controller source. Tests check the dependency and build stages.
Registry cache refresh workflow
.github/workflows/build-cache.yml, web/src/tests/tooling/github/ci-build-cache.test.ts, .github/WORKFLOWS.md
The Build Cache workflow refreshes registry caches on main pushes, on a schedule, or manually. It exports cache data without publishing images.
Registry cache readers
.github/actions/runtime-images/action.yml, .github/scripts/deploy/build-preview-image.sh, .github/workflows/{app-runtime-reference,beta2-integration,ci}.yml, web/src/tests/tooling/github/{ci-build-cache,selective-workflows}.test.ts, web/src/tests/tooling/production-smokes-workflow.test.ts, .github/WORKFLOWS.md
Build workflows and scripts read production registry caches. Tests verify cache sources and check that listed consumers do not export cache data.

Label-Gated PR Previews

Layer / File(s) Summary
Preview label lookup and gating
.github/scripts/deploy/pr-preview/{commands,github-api}.ts, .github/workflows/pr-preview-source.yml, web/src/tests/tooling/github/{pr-preview-commands.coverage,pr-preview-workflows}.test.ts, .github/WORKFLOWS.md
The preview workflow responds to the preview label. The command fetches pull-request labels and reports not-requested when that label is absent.

ACME HTTP Request Collection

Layer / File(s) Summary
Request-body collection
core/src/runtime/acme_http.rs
Request-body collection no longer maps a collection error to Error::Other. The existing size check remains.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant GitHub as GitHub Actions
  participant DetectChanges as detect-changes workflow
  participant ChangesScript as changes.ts
  participant ProductionSmokes as Production Smokes gate
  GitHub->>DetectChanges: Provide event SHAs and deferral input
  DetectChanges->>ChangesScript: Select checks and pass CI_DEFER_RUNTIME
  ChangesScript-->>DetectChanges: Return selections and runtime_deferred
  DetectChanges-->>ProductionSmokes: Provide runtime selection and deferred status
  ProductionSmokes->>ProductionSmokes: Report deferred verification or unchanged inputs
Loading
sequenceDiagram
  participant GitHub as GitHub Actions
  participant PreviewWorkflow as pr-preview-source workflow
  participant PreviewCommand as commandGate
  participant GitHubApi as fetchPullRequestLabels
  GitHub->>PreviewWorkflow: Send labeled pull-request event
  PreviewWorkflow->>PreviewCommand: Run command for preview label
  PreviewCommand->>GitHubApi: Fetch pull-request labels
  GitHubApi-->>PreviewCommand: Return validated label names
  PreviewCommand->>PreviewCommand: Set not-requested when preview is absent
Loading

Possibly related PRs

  • RentnerProxy/platform#542: Both PRs change the production build path with Rust dependency caching and registry build-cache behavior, and both change Production Smokes check handling.
Merge Risk: Minimal · previous review 0539f

This change adds merge-queue support, a shared registry build cache, label-gated previews and a Rust 1.100.0 bump. The inspected code shows no concrete defect in these paths. Registry-cache behavior and live merge-queue runs can only be confirmed after merge, but they are opt-in or fall back safely.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore: cut CI runtime with cached Rust dependencies and merge queue support" matches the main changes. The PR adds a Rust dependency-layer stage in the Dockerfiles, a registry build cache w…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely. It has a Summary-equivalent ("Why" and "What changes" sections), a detailed Testing section with commands and results, and maintainer follow-up…
Full details: Title check

Explanation

The title "chore: cut CI runtime with cached Rust dependencies and merge queue support" matches the main changes. The PR adds a Rust dependency-layer stage in the Dockerfiles, a registry build cache workflow, opt-in merge-queue support, and fewer CI jobs. The title names two of these themes. It does not mention the registry build cache or the preview-label change, but it is still specific and accurate.

Full details: Description check

Explanation

The description follows the repository template closely. It has a Summary-equivalent ("Why" and "What changes" sections), a detailed Testing section with commands and results, and maintainer follow-up steps. It explains the motivation with measured CI durations and describes each change area. Gaps: the template's "Related issue" section is absent, so there is no N/A reason or issue link. The "Type of change" checkboxes are not ticked. The Checklist is not present as checked items. "Breaking changes" and "Screenshots" sections are not present. The Testing section lists commands and results, but the repository template's checklist items (for example, whether existing tests pass) are not explicitly marked. The author notes that merge-queue runs and registry cache behavior remain unverified before merge.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a75e4cc and 0539fae.

Files selected for processing: 36

  • .github/WORKFLOWS.md
  • .github/actions/runtime-images/action.yml
  • .github/scripts/ci/changes.ts
  • .github/scripts/deploy/build-preview-image.sh
  • .github/scripts/deploy/pr-preview/commands.ts
  • .github/scripts/deploy/pr-preview/github-api.ts
  • .github/scripts/distribution/install-verifier.sh
  • .github/scripts/release/verify-exact-revision-ci.ts
  • .github/scripts/security/scan-commits.sh
  • .github/workflows/app-runtime-reference.yml
  • .github/workflows/autofix.yml
  • .github/workflows/beta2-integration.yml
  • .github/workflows/build-cache.yml
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/dependency-security.yml
  • .github/workflows/detect-changes.yml
  • .github/workflows/gitleaks.yml
  • .github/workflows/pr-preview-source.yml
  • .github/workflows/production-smokes.yml
  • .github/workflows/workflow-lint.yml
  • core/src/runtime/acme_http.rs
  • docker/production/Dockerfile
  • docker/proxy-runtime/Dockerfile
  • docker/tooling/coverage/Dockerfile
  • rust-toolchain.toml
  • scripts/compatibility/source-selection.ts
  • web/src/tests/tooling/github/changes.test.ts
  • web/src/tests/tooling/github/ci-build-cache.test.ts
  • web/src/tests/tooling/github/dependency-workflows.test.ts
  • web/src/tests/tooling/github/pr-preview-commands.coverage.test.ts
  • web/src/tests/tooling/github/pr-preview-workflows.test.ts
  • web/src/tests/tooling/github/release-compatibility.test.ts
  • web/src/tests/tooling/github/selective-workflows.test.ts
  • web/src/tests/tooling/production-smokes-workflow.test.ts
Files with no reviewable changes: 1

  • .github/scripts/release/verify-exact-revision-ci.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

autofix-ci Bot and others added 3 commits November 24, 2026 18:47
main introduced rust-toolchain.toml with 1.99.1 while this branch moves CI
to 1.100.0, the version the Dockerfiles ship. Keep local builds, CI and the
image on the same compiler; clippy 1.100.0 is clean on the merged tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rust 1.100.0 merges well-covered coverage regions (38,706 instead of
57,183 regions for the same code), so every Rust coverage group drops
below the 90 percent region gate without any test change. Changing that
gate is a separate decision, so CI, the toolchain file and the docs stay
on main's 1.99.1. The ACME HTTP client fix remains: it builds with both
versions and clears the new unreachable_code finding ahead of the bump.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RentnerKev
RentnerKev merged commit 965fa9e into main Nov 24, 2026
76 of 80 checks passed
@RentnerKev
RentnerKev deleted the rentner/chore/ci-runtime branch November 24, 2026 19:57
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.

1 participant