From 4144510a7adf907233f0d818b83adb9d8e83fafd Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 11 Aug 2026 14:19:03 -0400 Subject: [PATCH] ci(e2e): delete leaked repo-level FULLSEND_MINT_URL from test-repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cfmint behaviour-test driver (#6037) writes FULLSEND_MINT_URL as a repo-level variable on test-repo via `fullsend github setup`. Repo variables take precedence over org-level variables of the same name, but nothing deleted it afterward. Since e2e admin tests and behaviour tests share the same org pool and both use a repo named test-repo, a leaked repo-level FULLSEND_MINT_URL from a prior behaviour-test run shadows the org-level value that admin install sets, and points to an already-torn-down CF Worker preview mint — breaking dispatch with a DNS resolution failure for any run that later reuses the org. Delete the repo variable in TeardownPerRepoInstall (immediate cleanup after a per-repo driver run) and in CleanupStaleResources (defensive cleanup so already-poisoned orgs in the pool self-heal). Assisted-by: Claude Opus 4.6 Signed-off-by: Ralph Bean --- pkg/e2etest/cleanup.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/e2etest/cleanup.go b/pkg/e2etest/cleanup.go index 923be5c783..309215a22b 100644 --- a/pkg/e2etest/cleanup.go +++ b/pkg/e2etest/cleanup.go @@ -104,6 +104,16 @@ func CleanupStaleResources(ctx context.Context, client forge.Client, token, org t.Logf("[cleanup] Warning: could not delete per-repo guard variable: %v", delErr) } + // 8. Delete stale repo-level FULLSEND_MINT_URL variable from test-repo. + // Per-repo install drivers (e.g. cfmint) write this as a repo variable, + // which takes precedence over the org-level FULLSEND_MINT_URL set by + // admin install. Ephemeral preview mints (cfmint) are torn down at the + // end of their run, so a leaked repo variable points to a dead URL and + // breaks dispatch for any later run that reuses this org. + if delErr := client.DeleteRepoVariable(ctx, org, TestRepo, "FULLSEND_MINT_URL"); delErr != nil { + t.Logf("[cleanup] Warning: could not delete stale repo-level mint URL variable: %v", delErr) + } + t.Log("[cleanup] Stale resource scan complete") } @@ -117,6 +127,14 @@ func TeardownPerRepoInstall(ctx context.Context, client forge.Client, token, org deleteBranch(ctx, token, org, repo, "fullsend/onboard", log) deleteBranch(ctx, token, org, repo, "fullsend/offboard", log) deleteShimWorkflow(ctx, token, org, repo, log) + // Delete the repo-level FULLSEND_MINT_URL variable written by + // per-repo install drivers. It takes precedence over org-level + // FULLSEND_MINT_URL, so leaving it behind breaks dispatch for any + // later run (e.g. an org-level admin install) that reuses this repo + // from a shared org pool. + if delErr := client.DeleteRepoVariable(ctx, org, repo, "FULLSEND_MINT_URL"); delErr != nil { + log.Logf("[cleanup] Warning: could not delete repo-level mint URL variable: %v", delErr) + } prs, err := client.ListRepoPullRequests(ctx, org, repo) if err != nil { log.Logf("[cleanup] Warning: could not list PRs: %v", err)