From 28696fb9bbb550cf0fb42505fb39bf19ad2d5c99 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 21 Jul 2026 10:18:32 -0400 Subject: [PATCH] ENG-1924: Promote staging files without adding a release/ prefix The S3 promoter stripped the staging/ prefix and then prepended release/, so every promoted object landed under release/... instead of at the bucket root. Beta update files went to release/update/state/beta/ rather than update/state/beta/, and release-channel files gained a doubled release/ segment. Since the updater only ever fetches from update/state//, the prefix broke updates for every channel. Promotion now maps staging/ to : the channel is already encoded in the path, so no prefix is added. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/ci/s3-promoter/main.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/ci/s3-promoter/main.go b/scripts/ci/s3-promoter/main.go index a283fe6133..73b199cc7d 100644 --- a/scripts/ci/s3-promoter/main.go +++ b/scripts/ci/s3-promoter/main.go @@ -75,8 +75,7 @@ func run() { // Copy each staging object to production location and delete the staging version for _, obj := range stagingObjects { stagingKey := *obj.Key - relativeKey := strings.TrimPrefix(stagingKey, basePrefix+"staging/") - destinationKey := basePrefix + "release/" + relativeKey + destinationKey := productionKey(stagingKey, basePrefix) fmt.Printf("Promoting %s -> %s\n", stagingKey, destinationKey) @@ -94,6 +93,14 @@ func run() { fmt.Printf("Successfully promoted %d files from staging to production.\n", len(stagingObjects)) } +// productionKey maps a staging object key to its production location. The +// channel (beta, release, ...) is already encoded in the key, so promotion only +// drops the staging/ segment and adds no prefix of its own. +func productionKey(stagingKey, basePrefix string) string { + relativeKey := strings.TrimPrefix(stagingKey, basePrefix+"staging/") + return basePrefix + relativeKey +} + func createClient() { var err error