Skip to content

Make bucket-url optional for cache commands#3690

Merged
wolfeidau merged 1 commit intomainfrom
optional-bucket-url-for-hosted-agents
Feb 3, 2026
Merged

Make bucket-url optional for cache commands#3690
wolfeidau merged 1 commit intomainfrom
optional-bucket-url-for-hosted-agents

Conversation

@mitchbne
Copy link
Member

@mitchbne mitchbne commented Feb 1, 2026

Summary

Makes the --bucket-url flag optional for cache save and cache restore commands.

Why

The bucket-url flag is not required when using the LocalHostedAgents store type (used by Buildkite hosted compute). The zstash library already handles validation based on the store type returned by the API:

  • S3 stores: bucket-url is required
  • LocalHostedAgents: bucket-url is forbidden (zstash returns an error if set)

This allows hosted compute jobs to use cache commands without needing to specify a bucket URL.

Changes

  • Removed validate:"required" tag from BucketURL in CacheConfig struct

Testing

  • Existing tests pass
  • Validation is handled by zstash at runtime based on store type

The bucket-url flag is not required when using the LocalHostedAgents
store type. The zstash library handles validation based on the store
type returned by the API - requiring bucket-url for S3 stores while
explicitly rejecting it for LocalHostedAgents.

This allows hosted compute jobs to use cache commands without needing
to specify a bucket URL.

Amp-Thread-ID: https://ampcode.com/threads/T-019c1779-ae35-7259-b2eb-860fb137fdd3
Co-authored-by: Amp <amp@ampcode.com>
@mitchbne mitchbne self-assigned this Feb 1, 2026
@mitchbne mitchbne requested a review from wolfeidau February 1, 2026 04:40
Copy link
Member

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@wolfeidau wolfeidau merged commit 96edd7b into main Feb 3, 2026
2 checks passed
@wolfeidau wolfeidau deleted the optional-bucket-url-for-hosted-agents branch February 3, 2026 01:57
@zhming0 zhming0 mentioned this pull request Feb 3, 2026
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