Skip to content

Add migration lifecycle E2E coverage - #9

Merged
isaevt merged 1 commit into
mainfrom
isaevt/ghes-lifecycle-e2e
Aug 31, 2026
Merged

isaevt merged 1 commit into
mainfrom
isaevt/ghes-lifecycle-e2e

Conversation

@isaevt

@isaevt isaevt commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a full migration lifecycle E2E scenario for gh elm against 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 lifecycle scenario that:

  1. Creates and validates a migration.
  2. Starts the migration.
  3. Polls for and validates the target migration ID.
  4. Waits for cutover readiness.
  5. Validates a bounded sample of target resource records.
  6. Initiates cutover.
  7. Waits for cutover completion.
  8. Reverts cutover.
  9. Verifies the accessible post-revert terminal state.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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, and jq -e treats that output as an unsuccessful command. In that case the remote revert has succeeded but the lifecycle scenario fails before marking cleanup complete. Use jq -r because the preceding validation already guarantees a boolean.
    jq -er '.in_progress_migration_terminated' <<<"$output"

script/e2e/lib/cleanup.sh:283

  • jq -e also rejects a valid false value for this field. This prevents cleanup_revert_cutover from marking cleanup complete even though the API confirmed success and source restoration. Extract the already-validated boolean with jq -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.

Comment thread script/e2e/lib/migration.sh Outdated
Comment thread script/e2e/lib/cleanup.sh Outdated
Comment thread script/e2e/lib/polling.sh Outdated
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from 0d4bc6a to 6062417 Compare August 26, 2026 19:43
@isaevt
isaevt requested a balanced review from Copilot August 26, 2026 19:44
@isaevt
isaevt deployed to migration-e2e August 26, 2026 19:45 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread script/e2e/lib/migration.sh
Comment thread script/e2e/lib/cleanup.sh
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from 6062417 to d97d544 Compare August 26, 2026 19:59
@isaevt
isaevt requested a balanced review from Copilot August 26, 2026 19:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread script/e2e/lib/polling.sh Outdated
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from d97d544 to 75e5a80 Compare August 26, 2026 20:12
@isaevt
isaevt requested a balanced review from Copilot August 26, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 false as the valid “already unarchived” result, jq -e still turns that value into a failing exit status. The response shape and .success were 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_repository may validly be false (“already unarchived”), but jq -e converts that value into failure. Extract it without -e after 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

Comment thread script/e2e/lib/migration.sh Outdated
Comment thread script/e2e/lib/cleanup.sh Outdated
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from 75e5a80 to 8559a0b Compare August 26, 2026 20:24
@isaevt
isaevt requested a balanced review from Copilot August 26, 2026 20:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread script/e2e/lib/polling.sh
Comment thread script/e2e/lib/target.sh
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from 8559a0b to 742dc6c Compare August 26, 2026 20:42
@isaevt
isaevt requested a balanced review from Copilot August 26, 2026 20:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread script/e2e/lib/configuration.sh Outdated
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from 742dc6c to 371bd6b Compare August 26, 2026 20:55
@isaevt
isaevt requested a balanced review from Copilot August 26, 2026 20:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@isaevt
isaevt deployed to migration-e2e August 26, 2026 21:01 — with GitHub Actions Active
@isaevt
isaevt marked this pull request as ready for review August 26, 2026 21:21
@isaevt
isaevt requested a review from a team as a code owner August 26, 2026 21:21

@dpmex4527 dpmex4527 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dpmex4527 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and 👍 with results being posted as a comment rolling in as followup PR

Base automatically changed from isaevt/ghes-control-plane-e2e to main August 31, 2026 20:11
@isaevt
isaevt force-pushed the isaevt/ghes-lifecycle-e2e branch from 371bd6b to 4ca66bd Compare August 31, 2026 20:11
@isaevt
isaevt merged commit ff9a829 into main Aug 31, 2026
14 checks passed
@isaevt
isaevt deleted the isaevt/ghes-lifecycle-e2e branch August 31, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants