Skip to content

ci(e2e): delete leaked repo-level FULLSEND_MINT_URL from test-repo - #6112

Merged
ralphbean merged 1 commit into
mainfrom
fix/6037-cfmint-mint-url-leak
Aug 11, 2026
Merged

ci(e2e): delete leaked repo-level FULLSEND_MINT_URL from test-repo#6112
ralphbean merged 1 commit into
mainfrom
fix/6037-cfmint-mint-url-leak

Conversation

@ralphbean

Copy link
Copy Markdown
Member

Summary

  • cfmint (the behaviour-test CF Worker preview mint driver from ci(#5346): add CF Worker preview mint to BT driver #6037) writes FULLSEND_MINT_URL as a repo-level variable on test-repo via fullsend github setup
  • Repo-level variables take precedence over org-level ones, and nothing ever deleted this variable — since e2e admin tests and behaviour tests share the same org pool and both use a repo named test-repo, a leaked value from a prior behaviour-test run shadows the org-level FULLSEND_MINT_URL that admin install sets
  • Because the CF Worker preview mint is ephemeral (torn down at the end of its run), the leaked URL is dead, so dispatch fails with a DNS resolution error for any run that later reuses the org — this is currently breaking TestAdminInstallUninstall's triage-dispatch phase intermittently across PRs
  • Delete the repo variable in TeardownPerRepoInstall (immediate cleanup) and CleanupStaleResources (defensive cleanup so already-poisoned orgs in the pool self-heal)

Test plan

  • go build ./pkg/e2etest/... ./pkg/behaviourtest/...
  • go test ./pkg/e2etest/... ./pkg/behaviourtest/... ./internal/forge/...
  • pre-commit run --files pkg/e2etest/cleanup.go

Assisted-by: Claude Opus 4.6 noreply@anthropic.com

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 <noreply@anthropic.com>
Signed-off-by: Ralph Bean <rbean@redhat.com>
@ralphbean
ralphbean requested a review from a team as a code owner August 11, 2026 18:23
@ralphbean ralphbean added the fullsend-fix Enables automatic bot-triggered fix runs on human-authored PRs label Aug 11, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 11, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:24 PM UTC · Completed 6:34 PM UTC

Commit: 4144510 · View workflow run →

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

CI(e2e): remove leaked repo-level FULLSEND_MINT_URL to stop pooled-org dispatch flakes

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Delete repo-level FULLSEND_MINT_URL during per-repo teardown to avoid shadowing org variables.
• Add defensive stale-resource cleanup for already-poisoned pooled orgs’ test-repo.
• Prevent intermittent triage/dispatch failures caused by dead, ephemeral preview mint URLs.
Diagram

graph TD
  A["E2E test runner"] --> B["CleanupStaleResources()"] --> D["forge.Client"] --> E[("Repo Actions variables")]
  A --> C["TeardownPerRepoInstall()"] --> D --> E
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Fix at the source (cfmint) to avoid writing repo-level FULLSEND_MINT_URL
  • ➕ Eliminates the root cause; no cleanup required to prevent future leaks
  • ➕ Reduces hidden precedence issues between org vs repo variables
  • ➖ Doesn’t self-heal orgs already polluted in the pool
  • ➖ Requires coordinating changes across test drivers and potentially other tooling
2. Make repo variable driver-scoped (e.g., FULLSEND_MINT_URL_CFMINT)
  • ➕ Avoids clobbering the admin-install variable name
  • ➕ Allows multiple drivers to coexist without precedence collisions
  • ➖ Requires downstream consumers/dispatch logic to handle multiple names or selection rules
  • ➖ Still needs cleanup to prevent accumulation of stale values
3. Avoid shared repo identity in the pool (unique repo per run)
  • ➕ Prevents cross-run contamination from any repo-scoped artifacts, not just this variable
  • ➖ Increases resource churn and cleanup complexity
  • ➖ May be slower/costlier and require broader harness changes

Recommendation: This PR’s defense-in-depth cleanup is the right immediate fix because it both prevents new leaks (per-repo teardown) and self-heals already-poisoned pooled orgs (stale-resource cleanup). A follow-up to address the root cause in the per-repo driver (stop writing the shared variable name or reliably delete it) would further reduce future risk, but shouldn’t replace the defensive cleanup given the shared-org pool realities.

Files changed (1) +18 / -0

Bug fix (1) +18 / -0
cleanup.goDelete leaked FULLSEND_MINT_URL repo variable during e2e cleanup/teardown +18/-0

Delete leaked FULLSEND_MINT_URL repo variable during e2e cleanup/teardown

• Adds deletion of the repo-level FULLSEND_MINT_URL variable in both pooled-org stale cleanup (for test-repo) and per-repo driver teardown. This prevents a stale repo-scoped variable from overriding the org-level FULLSEND_MINT_URL and breaking later dispatch when the leaked value points at an ephemeral, already-destroyed mint endpoint.

pkg/e2etest/cleanup.go

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ralphbean
ralphbean added this pull request to the merge queue Aug 11, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@ralphbean
ralphbean added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 5462c12 Aug 11, 2026
26 checks passed
@ralphbean
ralphbean deleted the fix/6037-cfmint-mint-url-leak branch August 11, 2026 21:39
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 11, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 9:41 PM UTC · Completed 9:54 PM UTC

Commit: 4144510 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6112ci(e2e): delete leaked repo-level FULLSEND_MINT_URL from test-repo

What happened

PR #6037 (authored by fullsend-ai-coder, merged 2026-08-11 12:27 UTC) introduced the cfmint behaviour-test driver. This driver calls fullsend github setup --mint-url which writes FULLSEND_MINT_URL as a repo-level variable on test-repo, but the driver's Teardown() only tears down the CF Worker preview — it never deletes the repo-level variable. Because repo-level variables shadow org-level variables, and the preview mint is ephemeral, the leaked variable pointed to a dead URL, causing intermittent DNS failures in TestAdminInstallUninstall for subsequent test runs reusing the same org.

PR #6112 (authored by ralphbean, assisted by Claude Opus 4.6) added cleanup in both TeardownPerRepoInstall (immediate) and CleanupStaleResources (self-healing for already-poisoned orgs). The fix is surgical and defensive — errors are logged as warnings but don't fail cleanup.

Timeline

Time (UTC) Event
18:23 PR #6112 created by ralphbean
18:24 Review agent started (run 31522475917)
18:25 Qodo review: 0 bugs, 0 violations
18:31 Human review (ifireball): APPROVED (~8 min from creation)
18:34 Review agent: APPROVED ("Looks good to me"), ready-for-merge label applied
18:35 First merge queue attempt bounced after ~79 seconds
21:16 Second merge queue attempt
21:39 Merged

Workflow quality

PR #6112's review went well. The review agent ran 4 sub-agents (correctness, style-conventions, intent-coherence, docs-currency) in parallel. The docs sub-agent identified two real documentation gaps (e2e-testing.md and behaviour-drivers.md don't document the FULLSEND_MINT_URL repo-variable precedence or cleanup requirement), but the challenger sub-agent correctly removed them as scope creep for a bug fix PR. The final verdict was a clean APPROVE with no actionable findings — the correct outcome.

The interesting quality gap is upstream, on PR #6037's review. The review agent on #6037 caught several resource-leak issues (Worker preview leak on partial failure, teardownPreview naming asymmetry), but missed the cross-boundary repo variable leak. The miss is understandable: the variable is created as a side effect of calling fullsend github setup (defined in internal/repos/install.go, not in the diff), and catching it required tracing CLI command side effects across subsystems plus understanding the shared-pool interaction between behaviour tests and admin tests.

Existing issues that cover the identified gaps

All improvement opportunities from this retro are already tracked:

Assessment

No new proposals are warranted. The workflow on PR #6112 executed correctly — the human diagnosed the flake, wrote a clean fix with good documentation, and the review agent reached the right verdict. The upstream gap (PR #6037's missed cleanup) is already tracked by existing improvement issues in the agents repo. The reviewer's follow-up issue (#6119) demonstrates good engineering practice by addressing the architectural root cause.

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

Labels

fullsend-fix Enables automatic bot-triggered fix runs on human-authored PRs ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants