Skip to content

Namespace build caches by environment identity - #1196

Open
kartikjoshi21 wants to merge 3 commits into
project-dalec:mainfrom
kartikjoshi21:kartik/1096-cache-identity
Open

kartikjoshi21 wants to merge 3 commits into
project-dalec:mainfrom
kartikjoshi21:kartik/1096-cache-identity

Conversation

@kartikjoshi21

@kartikjoshi21 kartikjoshi21 commented Aug 11, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

This PR changes user Build.Caches namespacing to use an explicit build-environment cache identity.

Before this change, RPM used the target key as part of the cache namespace. Windows also included the
target key in its cache namespace. That made cache behavior depend on the route name instead of the build
environment.

This could cause two problems:

  • false sharing when the environment changed but the target key stayed
    the same
  • false isolation when different target keys used the same environment

This PR adds CacheIdentity for deb, rpm, and Windows target configs. It also updates cache wiring so Build.Caches use that identity instead of the target key.

The alt_testing_targets registration now varies cache identity uniformly across deb, rpm, and Windows.

Fixes #1096

Copilot AI balanced review requested due to automatic review settings August 11, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Resolves #1096 by namespacing user build caches with explicit build-environment identities instead of route keys.

Changes:

  • Adds cache identities to DEB, RPM, and Windows configurations.
  • Propagates identities through package builders and cache mounts.
  • Uses one mechanism to isolate alternate testing targets.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cache.go Renames cache namespace inputs to environment identity.
docs/spec.schema.json Updates cache namespace documentation.
packaging/linux/deb/pkg.go Uses cache identity for DEB builds.
packaging/linux/rpm/rpmbuild.go Uses cache identity for RPM builds.
targets/linux/deb/debian/bookworm.go Defines Bookworm identity.
targets/linux/deb/debian/bullseye.go Defines Bullseye identity.
targets/linux/deb/debian/trixie.go Defines Trixie identity.
targets/linux/deb/distro/distro.go Adds DEB identity configuration methods.
targets/linux/deb/distro/pkg.go Resolves DEB build cache identity.
targets/linux/deb/ubuntu/bionic.go Defines Bionic identity.
targets/linux/deb/ubuntu/focal.go Defines Focal identity.
targets/linux/deb/ubuntu/jammy.go Defines Jammy identity.
targets/linux/deb/ubuntu/noble.go Defines Noble identity.
targets/linux/deb/ubuntu/resolute.go Defines Resolute identity.
targets/linux/rpm/almalinux/v8.go Defines AlmaLinux 8 identity.
targets/linux/rpm/almalinux/v9.go Defines AlmaLinux 9 identity.
targets/linux/rpm/azlinux/azlinux3.go Defines Azure Linux 3 identity.
targets/linux/rpm/azlinux/azlinux4.go Defines Azure Linux 4 identity.
targets/linux/rpm/distro/distro.go Adds RPM identity configuration methods.
targets/linux/rpm/distro/dnf_install.go Passes identity to dependency RPM builds.
targets/linux/rpm/distro/pkg.go Passes and validates RPM cache identity.
targets/linux/rpm/rockylinux/v8.go Defines Rocky Linux 8 identity.
targets/linux/rpm/rockylinux/v9.go Defines Rocky Linux 9 identity.
targets/linux/rpm/suse/sles15.go Defines SLES 15 identity.
targets/plugin/init.go Uniformly configures alternate-target identities.
targets/windows/handle_container.go Uses configuration-bound Windows handlers.
targets/windows/handle_zip.go Uses Windows environment identity for caches.
targets/windows/handler.go Defines and propagates Windows cache configuration.

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@DannyBrito DannyBrito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't have much context but looks lgtm. There is some test failures

@cpuguy83

Copy link
Copy Markdown
Collaborator

LGTM But you need to DCO sign each commit.

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.

Rework build cache key derivation: don't namespace by target key

4 participants