Skip to content

perf(ci): stop the cache export of pull request image builds #4646

Closed

Description

@dan-petty

Problem or Motivation

The Service, Runner and MCP jobs export a type=gha cache (.github/workflows/ci.yml:501, 726, 821). The repository cache holds 12.3 GB in 307 entries, more than the 10 GB limit, so an entry that nobody reads lives for about 47 min (measured).

PR caches go to refs/pull/<n>/merge, and other PRs cannot read them. Each build gets 2 CACHED layers. The Service export takes about 73 s on average. The ci.yml comment says that runner-image shares the builder stage through the cache, but the Runner build takes 140.5 s and builds that stage again (measured).

Saving: 2.5-4 runner-min per push (estimated).

Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.

Proposed Solution & Architectural Design

  • Remove cache-to from the three PR image jobs.
  • Keep one scoped cache-to in release.yml on main. A PR can read the cache of its base branch, so each PR can read the builder layers.
  • Correct the ci.yml comment (AGENTS.md rule 8).

Risk: Low. The smoke tests and the Trivy scans stay.

Target Subsystem

SDLC, Git & PR Governance (.github/workflows/ci.yml, .github/workflows/release.yml).

Existing Tool Considered

The BuildKit gha cache backend and the GitHub Actions cache scope rules (a branch reads the cache of its base branch). No new tool. Cost: about 15,000 tokens and 1 hour.

Acceptance Criteria

  • No PR job writes the gha cache.
  • One day after the merge, the Actions cache uses 10 GB or less.
  • The mean of the Service Image job is 2.2 min or less (from 3.05 min).
  • A comment on this issue gives the CACHED layer count of the builder stage one day after the merge.

Dependencies

None.

Activity

  1. added
    source/agent
    type/infra
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/infra. The perf prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P2-Medium. Saves 2.5-4 runner-min per push and keeps cache under the 10 GB limit, but does not block functionality.
    • Value: Medium. Reduces queue wait time and prevents cache eviction of useful entries.
    • Effort: Low. Remove cache-to from three jobs, keep one in release.yml, and fix one comment.
    • Related: perf(infra): optimize caching configuration across all github workflows #99, which asks for a different change. Both optimize caching in ci.yml and release.yml, but the candidate removes BuildKit gha cache export while #99 tunes setup-uv and DevContainer cache settings.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 11, 2026
  4. removed
    status/in-progress
    owner/agent
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 15:46 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/cisource/agenttype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions