Skip to content

chore(ci): allow failed test jobs to restore the cache on retry [EXT-00]#2977

Open
Jared Jolton (jjolton-contentful) wants to merge 1 commit intomasterfrom
fix/ci/allow-retry-from-failed-to-restore-cache
Open

chore(ci): allow failed test jobs to restore the cache on retry [EXT-00]#2977
Jared Jolton (jjolton-contentful) wants to merge 1 commit intomasterfrom
fix/ci/allow-retry-from-failed-to-restore-cache

Conversation

@jjolton-contentful
Copy link
Copy Markdown
Contributor

@jjolton-contentful Jared Jolton (jjolton-contentful) commented Apr 10, 2026

Summary

Fix the CI build cache key so rerunning failed jobs can restore the existing dist cache.

Description

This removes github.run_attempt from the build cache key in the reusable workflows, while keeping the cache scoped to the current workflow run via github.run_id.

Motivation and Context

Our integration jobs could not be rerun in GitHub because the cache restore step was using an attempt-specific key with fail-on-cache-miss: true. This keeps the same run-scoped cache available across reruns of failed jobs.

Tip

This is safe because the cache is still scoped to the current workflow run via github.run_id. We’re only removing github.run_attempt so rerun attempts can reuse the original build output instead of failing on a cache miss.

Summary by Bito

Fix the CI build cache key so rerunning failed jobs can restore the existing `dist` cache. This removes `github.run_attempt` from the build cache key in the reusable workflows, while keeping the cache scoped to the current workflow run via `github.run_id`.

Detailed Changes
  • Removes github.run_attempt from build cache keys in CI workflows (build.yaml, check.yaml, release.yaml, test-demo-projects.yaml, test-integration.yaml) to enable cache restoration on job retries.

@bito-code-review
Copy link
Copy Markdown

bito-code-review Bot commented Apr 10, 2026

Code Review Agent Run #19512c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: 335ac15..335ac15
    • .github/workflows/build.yaml
    • .github/workflows/check.yaml
    • .github/workflows/release.yaml
    • .github/workflows/test-demo-projects.yaml
    • .github/workflows/test-integration.yaml
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review
Copy link
Copy Markdown

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted Summary
Other Improvements - CI Workflow Cache Key Update
Removes github.run_attempt from build cache keys to allow failed jobs to restore cache on retry.

@bito-code-review
Copy link
Copy Markdown

Impact Analysis by Bito

Interaction Diagram
sequenceDiagram
participant Dev as Developer
participant GitHub as GitHub Actions
participant Workflow as GitHub Workflows<br/>🔄 Updated | ●●○ Medium
participant Cache as Cache System
participant Build as Build Process
participant Test as Test Process
Dev->>GitHub: Push code changes
GitHub->>Workflow: Trigger workflow
Workflow->>Cache: Check cache with updated key
Cache-->>Workflow: Cache miss
Workflow->>Build: Start build process
Build->>Build: Compile source code
Build->>Build: Package artifacts
Build-->>Workflow: Build complete
Workflow->>Cache: Store in cache
Cache-->>Workflow: Cache updated
Workflow->>Test: Run tests
Test-->>Workflow: Tests passed
Workflow-->>GitHub: Workflow success
Loading

No direct upstream/downstream impact detected in repository scan or cross-repo dependency analysis.

Code Paths Analyzed

Impact:
Modified CI/CD caching strategy by removing github.run_attempt from cache keys in multiple workflow files, potentially improving cache reuse across workflow re-runs while reducing cache fragmentation.

Flow:
GitHub Actions workflows (build, check, release, test-demo-projects, test-integration) use caching for 'dist' directory; changes affect cache key generation during workflow execution.

Direct Changes (Diff Files):
• .github/workflows/build.yaml [9-10] — Updated cache key from 'build-cache-${{ github.run_id }}-${{ github.run_attempt }}' to 'build-cache-${{ github.run_id }}' to enable cache reuse across workflow re-runs.
• .github/workflows/check.yaml [20-21] — Updated cache key from 'build-cache-${{ github.run_id }}-${{ github.run_attempt }}' to 'build-cache-${{ github.run_id }}' to enable cache reuse across workflow re-runs.
• .github/workflows/release.yaml [34-35] — Updated cache key from 'build-cache-${{ github.run_id }}-${{ github.run_attempt }}' to 'build-cache-${{ github.run_id }}' to enable cache reuse across workflow re-runs.
• .github/workflows/test-demo-projects.yaml [48-49] — Updated cache key from 'build-cache-${{ github.run_id }}-${{ github.run_attempt }}' to 'build-cache-${{ github.run_id }}' to enable cache reuse across workflow re-runs.
• .github/workflows/test-integration.yaml [62-63] — Updated cache key from 'build-cache-${{ github.run_id }}-${{ github.run_attempt }}' to 'build-cache-${{ github.run_id }}' to enable cache reuse across workflow re-runs.

Repository Impact:
CI/CD pipelines: Changes to cache key strategy may affect build performance and cache hit rates in GitHub Actions workflows.

Cross-Repository Dependencies:
None.

Database/Caching Impact:
• None

API Contract Violations:
None.

Infrastructure Dependencies:
• GitHub Actions caching mechanism for 'dist' directory in build, check, release, test-demo-projects, and test-integration workflows.

Testing Recommendations

Frontend Impact:
None.

Service Integration:
None.

Data Serialization:
None.

Privacy Compliance:
None.

Backward Compatibility:
None.

OAuth Functionality:
• None

Reliability Testing:
• None

Additional Insights:
• Trigger CI workflows manually to verify cache keys work correctly and cache is reused on re-runs.
• Monitor build times and cache hit rates in GitHub Actions to ensure performance improvement.
• Test workflow re-runs to confirm cache is shared between attempts of the same run.

Analysis based on known dependency patterns and edges. Actual impact may vary.

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