Skip to content

fix(ci): expose ACTIONS_* runtime env so the e2e gha build cache engages - #1959

Merged
cyberantonz merged 4 commits into
constructorfabric:mainfrom
cyberantonz:fix/e2e-gha-cache-runtime-token
Jul 28, 2026
Merged

fix(ci): expose ACTIONS_* runtime env so the e2e gha build cache engages#1959
cyberantonz merged 4 commits into
constructorfabric:mainfrom
cyberantonz:fix/e2e-gha-cache-runtime-token

Conversation

@cyberantonz

@cyberantonz cyberantonz commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Problem

The Build runner image job in the E2E workflow takes ~13.5 min on every PR run — a full Rust recompile of analytics + identity-resolution + jira-enrich — even on PRs that touch no backend code and leave Cargo.lock unchanged (e.g. #1926, where all runs rebuilt from scratch).

BuildKit logs from those runs contain zero importing/exporting cache manifest steps: the type=gha cache wired in compose/docker-compose.cache.yml never engages.

Cause

The type=gha cache backend needs ACTIONS_RUNTIME_TOKEN / ACTIONS_CACHE_URL, which GitHub exposes only to JS actions. build-images.yml works because docker/build-push-action injects them; the E2E build runs ./e2e.sh build (docker compose build) in a plain run: step, so buildx finds no token and silently drops the cache_from/cache_to config.

Fix

Add crazy-max/ghaction-github-runtime@v3 (by the buildx maintainer, built for exactly this) before the build step — it exports the ACTIONS_* runtime env to run steps.

Expected effect

First run on this branch populates the cache; subsequent runs should show importing cache manifest from gha,scope=e2e-* and CACHED on the cargo dep layers, dropping the build job from ~13.5 min to ~2–4 min for PRs that don't touch backend code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved end-to-end build performance by enabling Docker build caching in the CI workflow.
    • Reduced unnecessary full rebuilds during automated builds.

The e2e build job builds via docker compose in a plain run step, which
never sees ACTIONS_RUNTIME_TOKEN/ACTIONS_CACHE_URL — buildx silently
drops the type=gha cache_from/cache_to wired in docker-compose.cache.yml,
so every PR run fully recompiled analytics + identity-resolution +
jira-enrich (~13.5 min) even with an unchanged Cargo.lock.

crazy-max/ghaction-github-runtime exports those env vars to run steps,
letting the existing cache overlay actually restore the dep layers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Anton Zelenov <antonz@constructor.tech>
@cyberantonz
cyberantonz requested a review from a team as a code owner July 28, 2026 05:29
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The E2E workflow now exposes GitHub Actions runtime cache variables before docker compose build, allowing Buildx cache configuration to be passed into the runner-image build.

Changes

E2E build cache runtime

Layer / File(s) Summary
Expose runtime cache values
.github/workflows/e2e-bronze-to-api.yml
Adds crazy-max/ghaction-github-runtime@v3 before the runner-image build to provide ACTIONS_RUNTIME_TOKEN and ACTIONS_CACHE_URL to Docker Compose.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: aleksdotbar, mozhaev-dev

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the workflow change and the cache-enabling runtime env exposure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@cyberantonz
cyberantonz enabled auto-merge (squash) July 28, 2026 05:37

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
.github/workflows/e2e-bronze-to-api.yml (1)

88-94: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Refresh and pin the runtime action revision.

The integration point is correct, but upstream currently documents crazy-max/ghaction-github-runtime@v4; this workflow still uses @v3. Update to the supported revision and preferably pin its commit SHA to prevent unreviewed action changes. (github.com)

Proposed change
-      - uses: crazy-max/ghaction-github-runtime@v3
+      - uses: crazy-max/ghaction-github-runtime@v4 # preferably pin to a verified commit SHA
🤖 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 @.github/workflows/e2e-bronze-to-api.yml around lines 88 - 94, Update the
crazy-max/ghaction-github-runtime action reference in the workflow from the
outdated v3 revision to the currently supported v4 revision, preferably pinned
to its reviewed commit SHA. Preserve the existing workflow step and
runtime-token exposure behavior.
🤖 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.

Nitpick comments:
In @.github/workflows/e2e-bronze-to-api.yml:
- Around line 88-94: Update the crazy-max/ghaction-github-runtime action
reference in the workflow from the outdated v3 revision to the currently
supported v4 revision, preferably pinned to its reviewed commit SHA. Preserve
the existing workflow step and runtime-token exposure behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9906fd16-d3e4-4281-af74-4e611ac1ca31

📥 Commits

Reviewing files that changed from the base of the PR and between dcec5bb and 8527d26.

📒 Files selected for processing (1)
  • .github/workflows/e2e-bronze-to-api.yml

@cyberantonz
cyberantonz merged commit 85bbfe7 into constructorfabric:main Jul 28, 2026
15 checks passed
@cyberantonz
cyberantonz deleted the fix/e2e-gha-cache-runtime-token branch July 29, 2026 03: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