Skip to content

feat(cache): parse save_scopes from cache.yml#4048

Open
buildkate wants to merge 1 commit into
mainfrom
kates/A-1420-save-scopes
Open

feat(cache): parse save_scopes from cache.yml#4048
buildkate wants to merge 1 commit into
mainfrom
kates/A-1420-save-scopes

Conversation

@buildkate

@buildkate buildkate commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Adds save_scopes support to cache.yml. On save, the enabled scopes (branch, build, pipeline) are resolved from env vars sent to the cache registry as a scopes object on the store request. Config-driven only; no CLI flag.

Context

Resolves A-1420

Changes

  • config (internal/cache/configuration): add SaveScopes map[string]bool to Cache
  • resolver: ResolveSaveScopes resolves enabled scopes to env vars, skips disabled ones
  • api (api/cache.go): add Scopes to CacheEntryCreateReq
  • save (internal/cache/save.go): resolve scopes in Save() and populate the create request;

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go tool gofumpt -extra -w .)

Affiliation (optional, external contributors)

Buildkite

Disclosures / Credits

Claude

@buildkate
buildkate requested review from a team as code owners July 3, 2026 06:47

@buildsworth-bk-app buildsworth-bk-app 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.

I didn't find any code findings to raise. I'm leaving this as a comment rather than an approval because this changes cache save scoping / the agent cache API wire protocol, which I read as above the AI approval ceiling.

Want to dig deeper? The full session log is attached to this Buildkite build. Download the session file and open a new pi session with it:

Download the buildsworth logs from build 2648, then answer my questions about the findings.

@buildkate buildkate added the internal Non-user facing, internal change. label Jul 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b5b3e8fab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cache/client.go Outdated
@buildkate
buildkate force-pushed the kates/A-1420-save-scopes branch 2 times, most recently from 85a0195 to 9f390ba Compare July 5, 2026 23:29
buildsworth-bk-app[bot]

This comment was marked as outdated.

@buildsworth-bk-app buildsworth-bk-app 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.

I found one scope-resolution question around CLI/env overrides. I'm leaving this as a comment rather than an approval because this changes the cache save API wire protocol, which is above the AI approval ceiling.

Want to dig deeper? The full session log is attached to this Buildkite build. Download the session file and open a new pi session with it:

Download the buildsworth logs from build 2766, then answer my questions about the findings.

Comment thread internal/cache/client.go Outdated
@buildkate buildkate changed the title kates/A 1420 save scopes feat(cache): parse save_scopes from cache.yml Jul 7, 2026
@buildsworth-bk-app
buildsworth-bk-app Bot dismissed their stale review July 7, 2026 04:02

Previous concerns have been addressed.

@buildsworth-bk-app buildsworth-bk-app 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.

The previous scope-resolution concern is fixed: save_scopes now sends the boolean scope selection instead of client-resolved branch/pipeline values. I didn't find new issues; I'm leaving this as a comment rather than an approval because this changes the cache save API wire protocol, which is above the AI approval ceiling.

Want to dig deeper?

The full session log is attached to this Buildkite build. Download the session file and open a new pi session with it:

Download the buildsworth logs from build 3165, then answer my questions about the findings.

@buildkate
buildkate force-pushed the kates/A-1420-save-scopes branch from 867e1bb to 9fa89a9 Compare July 7, 2026 04:11

@buildsworth-bk-app buildsworth-bk-app 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.

I didn't find any code findings on this pass. I'm leaving this as a comment rather than an approval because this changes the cache save API wire protocol, which is above the AI approval ceiling.

Want to dig deeper?

The full session log is attached to this Buildkite build. Download the session file and open a new pi session with it:

Download the buildsworth logs from build 3173, then answer my questions about the findings.

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

Labels

internal Non-user facing, internal change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant