Add migration lifecycle E2E coverage - #9
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Valid false-valued revert fields are rejected, and cutover completion can be detected prematurely.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds end-to-end coverage for the complete GHES migration lifecycle.
Changes:
- Adds lifecycle orchestration, polling, and target-resource validation.
- Adds cutover-aware ownership, cleanup, and evidence handling.
- Runs control-plane and lifecycle scenarios sequentially.
File summaries
| File | Description |
|---|---|
.github/workflows/e2e.yml |
Runs and reports both scenarios. |
script/e2e/test-elm-ghes.sh |
Loads the selected scenario. |
script/e2e/scenarios/lifecycle.sh |
Defines the lifecycle flow. |
script/e2e/lib/common.sh |
Adds polling defaults and validation. |
script/e2e/lib/configuration.sh |
Validates lifecycle configuration. |
script/e2e/lib/evidence.sh |
Records scenario and timeout metadata. |
script/e2e/lib/ownership.sh |
Tracks cutover and cleanup state. |
script/e2e/lib/migration.sh |
Adds start, cutover, and revert operations. |
script/e2e/lib/polling.sh |
Polls asynchronous lifecycle states. |
script/e2e/lib/target.sh |
Validates target IDs and resources. |
script/e2e/lib/cleanup.sh |
Adds cutover-aware recovery. |
Review details
Suppressed comments (2)
script/e2e/lib/migration.sh:660
- This field may legitimately be
false, andjq -etreats that output as an unsuccessful command. In that case the remote revert has succeeded but the lifecycle scenario fails before marking cleanup complete. Usejq -rbecause the preceding validation already guarantees a boolean.
jq -er '.in_progress_migration_terminated' <<<"$output"
script/e2e/lib/cleanup.sh:283
jq -ealso rejects a validfalsevalue for this field. This preventscleanup_revert_cutoverfrom marking cleanup complete even though the API confirmed success and source restoration. Extract the already-validated boolean withjq -r.
jq -er '.in_progress_migration_terminated' \
- Files reviewed: 11/11 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
0d4bc6a to
6062417
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Both revert paths reject valid successful responses when optional termination fields are omitted.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Balanced
6062417 to
d97d544
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Target-ID polling can incorrectly abort after a transient lookup failure once migration status is completed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 1
- Review effort level: Balanced
d97d544 to
75e5a80
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Successful idempotent revert responses can currently be rejected, causing false scenario and cleanup failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
script/e2e/lib/migration.sh:645
- After accepting
falseas the valid “already unarchived” result,jq -estill turns that value into a failing exit status. The response shape and.successwere validated above, so extract this boolean without-e.
jq -er '.unarchived_source_repository' <<<"$output"
script/e2e/lib/cleanup.sh:266
- For an idempotent successful cleanup response,
unarchived_source_repositorymay validly befalse(“already unarchived”), butjq -econverts that value into failure. Extract it without-eafter the schema and success checks.
if ! source_unarchived="$(
jq -er '.unarchived_source_repository' \
<<<"$response" 2>>"$CLEANUP_LOG"
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Balanced
75e5a80 to
8559a0b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Polling evidence can retain stale data, and target-resource verification performs an unbounded buffered download.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Balanced
8559a0b to
742dc6c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The polling-budget calculation can overflow and bypass the documented 90-minute limit.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 1
- Review effort level: Balanced
742dc6c to
371bd6b
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces destructive lifecycle operations and extensive asynchronous cleanup logic against a protected GHES environment that requires final human validation.
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 0 new
- Review effort level: Balanced
dpmex4527
left a comment
There was a problem hiding this comment.
Can you add a step that posts a summary of the results as an issue comment on the PR? It's fine to link to the actions job for detailed info but it would be helpful to get a summary of the results as a comment.
dpmex4527
left a comment
There was a problem hiding this comment.
LGTM and 👍 with results being posted as a comment rolling in as followup PR
371bd6b to
4ca66bd
Compare
Summary
Add a full migration lifecycle E2E scenario for
gh elmagainst the protected GHES migration environment.This extends the existing control-plane harness with lifecycle coverage for migration start, target migration ID resolution, target resource inspection, cutover readiness and completion, cutover revert, and post-revert verification.
What changed
Lifecycle scenario
Add a new
lifecyclescenario that: