You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(e2e): multi-run isolation for real-provider E2E (Phase 2)
Centralize branch-namespace identity in scripts/e2e-namespace.sh
(e2e/pr/<n>/<provider>/run-<id>-<attempt> and
e2e/branch/<sanitized-id>/<provider>/run-<id>-<attempt>, with a
content-hash suffix so differently-slashed branch names can't collide),
sourced by e2e-harness.sh, the new e2e-namespace-cleanup.sh, and
e2e-janitor.sh -- one canonical implementation, not several drifting
apart.
Implement the three-layer cleanup hierarchy the isolation model needs:
- Layer 1 (scripts/e2e-harness.sh cleanup): unchanged in spirit, now
deletes only this run's own uniquely-named branch.
- Layer 2 (scripts/e2e-namespace-cleanup.sh + new
.github/workflows/e2e-pr-cleanup.yml / e2e-branch-cleanup.yml):
authoritative on PR close or source-branch delete, removes the whole
e2e/pr/<n>/** or e2e/branch/<id>/** namespace. PR cleanup uses
pull_request_target with no ref: override on checkout, so it only
ever runs this repo's own trusted code/secrets, never the closing
PR's branch.
- Layer 3 (scripts/e2e-janitor.sh + new .github/workflows/e2e-janitor.yml,
scheduled every 6h): TTL sweep (24h default) of any leftover e2e/**
branch via generic git for-each-ref/push --delete, tolerant of
already-deleted refs.
Removes e2e-harness.sh's old ad hoc sweep subcommand/gfs-e2e-<provider>-*
naming, superseded by the above.
ci.yml's provider-e2e job: E2E_WORKDIR now pinned per
run-id/run-attempt/provider under (was a shared
e2e-<provider> dir), E2E_PR_NUMBER/E2E_SOURCE_BRANCH passed through for
provision, and a per-source/provider concurrency group
(cancel-in-progress: true) so a repeated push/rerun cancels its own
predecessor -- cancellation is not a cleanup mechanism, so this is only
possible because every run still gets its own unique branch regardless.
Rewrites docs/testing/real-provider-e2e.md's isolation model with a
Mermaid diagram of the cleanup hierarchy.
Verification: npx eslint . -- 0 errors; npm run build -- clean;
npx vitest run -- 527 passed; yaml.safe_load on all touched/new workflow
files; bash -n on all new/changed scripts; functional dry-runs of the
namespace/janitor/cleanup logic against throwaway local git repos; real
end-to-end run against a live local Gitea sandbox (14/14 E2E tests
passed) with the new harness code.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments