Skip to content

Add guarded migration rerun support - #2562

Merged
ejsmith merged 9 commits into
mainfrom
issue/rerun-completed-migrations
Sep 8, 2026
Merged

Add guarded migration rerun support#2562
ejsmith merged 9 commits into
mainfrom
issue/rerun-completed-migrations

Conversation

@ejsmith

@ejsmith ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member

Summary

  • add an explicit opt-in marker and shared service for rerunning completed migrations without changing migration history
  • expose guarded System Migrations actions with typed confirmation, background execution, and status polling
  • support the same rerun path from the job CLI with Migration --rerun <id> for instances that cannot start the UI
  • mark saved-view column migration 5 as rerunnable and document the self-hosted recovery workflow

Addresses #2551.

Safety

  • only explicitly marked, completed migrations can be rerun
  • reruns share the normal migration lock and reject concurrent running requests
  • operation status is tracked separately; the recorded current version and original completion timestamp remain unchanged
  • operation records precede active markers, and stale reservations plus terminal cleanup are recovered atomically
  • queued operations are reused for safe UI redispatch or CLI recovery after a process exits before dispatch
  • interrupted or infrastructure-blocked UI operations are retried by queue redelivery
  • split Web/Job deployments fail fast unless the UI and worker share a distributed queue and Redis-backed cache
  • completed, cancelled CLI, and durably recorded migration failures are not rerun automatically

Verification

  • dotnet build Exceptionless.slnx --no-restore
  • focused migration retry, migration, CLI parsing, and admin endpoint tests (22 passed)
  • endpoint manifest and OpenAPI snapshot tests (5 passed)
  • npm run validate
  • Playwright System Migrations confirmation flow (1 passed)
  • local Aspire frontend and browser-facing API health checks

Breaking changes

None.

@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T01:15:59.645373Z 3a2727d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef625de5f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Api/Handlers/AdminHandler.cs
Comment thread src/Exceptionless.Core/Migrations/MigrationRerunService.cs Outdated
@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32fe6c916e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Core/Migrations/MigrationRerunService.cs
@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68507626ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Core/Migrations/MigrationRerunService.cs Outdated
Comment thread src/Exceptionless.Core/Migrations/MigrationRerunService.cs Outdated
@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf6befdbf7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Core/Migrations/MigrationRerunService.cs Outdated
Comment thread src/Exceptionless.Web/Api/Handlers/AdminHandler.cs Outdated
@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b9cffa169

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Core/Migrations/MigrationRerunService.cs Outdated
@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@ejsmith

ejsmith commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: f7b884d022

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ejsmith
ejsmith marked this pull request as ready for review September 8, 2026 01:08
@ejsmith
ejsmith merged commit bd281c4 into main Sep 8, 2026
11 checks passed
@ejsmith
ejsmith deleted the issue/rerun-completed-migrations branch September 8, 2026 01:09

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a2727ddeb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +195 to +198
catch (Exception ex)
{
await migrationRerunService.FailQueuedOperationAsync(operation.Id, ex);
throw;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve reused operations when redispatch fails

When the first request has already enqueued an operation but its state is still Queued, a retry reuses that same operation ID; if the retry's EnqueueAsync then fails transiently, this catch marks the shared operation Failed and removes its reservation. The original queued item subsequently encounters the terminal-state guard and exits without running the migration. Track whether QueueAsync created or reused the operation, and only fail a newly created reservation when dispatch fails.

AGENTS.md reference: AGENTS.md:L72-L75

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Insulation 37% 35% 286
Exceptionless.Web 85% 70% 8102
Exceptionless.Core 76% 68% 10496
Exceptionless.AppHost 38% 41% 147
Summary 79% (26314 / 33335) 68% (12215 / 18003) 19031

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.

1 participant