Skip to content

Feature/gh 284 stories 1 8 moved - #292

Merged
PhilipWoulfe merged 28 commits into
mainfrom
feature/gh-284-stories-1-8-moved
Jul 7, 2026
Merged

Feature/gh 284 stories 1 8 moved#292
PhilipWoulfe merged 28 commits into
mainfrom
feature/gh-284-stories-1-8-moved

Conversation

@PhilipWoulfe

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 7, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the migration “write” pipeline to actually materialize canonical race-domain entities (drivers/races/selections/positions) and adds operational tooling around safety, diagnostics, parity/idempotency metadata, and rollback for admin workflows.

Changes:

  • Add a canonical write service invoked from the worker after reconciliation, including conflict policy handling and conflict diagnostics persistence.
  • Add parity snapshot checksums + idempotency metadata to MigrationImportRuns, and expand admin APIs/models/tests to expose kickoff preview metadata and rollback/audit details.
  • Update the admin web UI/models and add a runbook/epic references for traceability.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/F1.Web.Tests/AdminMigrationRunsTests.cs Updates web tests for expanded kickoff/detail models (conflict diagnostics + kickoff metadata).
tests/F1.Infrastructure.Tests/Relational/MigrationImportRunServiceTests.cs Adds/updates relational characterization and new assertions for parity/idempotency/canonical writes/conflict policy behavior.
tests/F1.Api.Tests/Services/MigrationRunAdminServiceTests.cs Adds unit tests for non-empty DB confirmation, kickoff metadata preview, rollback, and conflict diagnostics inclusion.
tests/F1.Api.Tests/Controllers/MigrationRunsControllerTests.cs Adds controller tests for rollback validation and OK payload behavior.
src/F1.Web/Pages/AdminMigrationRuns.razor Sends the new kickoff confirmation flag and refreshes UI behaviors around kickoff.
src/F1.Web/Models/AdminMigrationRunModels.cs Adds new DTO fields for conflict diagnostics and kickoff preview metadata.
src/F1.Infrastructure/Data/F1DbContext.cs Adds new DbSets and EF mappings for conflict diagnostics/rollback audits + new run metadata columns.
src/F1.Infrastructure/Data/Entities/MigrationImportRunEntity.cs Adds persisted parity/idempotency fields on migration runs.
src/F1.Infrastructure/Data/Entities/MigrationImportRollbackAuditEntity.cs New entity for rollback audit persistence.
src/F1.Infrastructure/Data/Entities/MigrationImportConflictDiagnosticEntity.cs New entity for canonical write conflict diagnostic persistence.
src/F1.DataSyncWorker/Services/MigrationImportRunService.cs Persists parity/idempotency metadata from completion metadata into MigrationImportRuns.
src/F1.DataSyncWorker/Services/MigrationImportOrchestrator.cs Integrates canonical writes, parity snapshot hashing/comparison, and idempotency metadata into the run lifecycle.
src/F1.DataSyncWorker/Services/MigrationCanonicalWriteService.cs New canonical writer that upserts race-domain entities with conflict policy + diagnostics and transactional behavior.
src/F1.DataSyncWorker/Services/IMigrationCanonicalWriteService.cs New abstraction for canonical writing.
src/F1.DataSyncWorker/Program.cs Registers the canonical write service in DI.
src/F1.DataSyncWorker/Options/MigrationImportOptions.cs Adds options for conflict policy and failure injection stage.
src/F1.DataSyncWorker/Models/MigrationImportModels.cs Extends run completion metadata with parity/idempotency fields.
src/F1.Api/Services/MigrationRunAdminService.cs Adds non-empty DB confirmation gate + kickoff preview metadata, rollback implementation, conflict diagnostics + rollback audits in run detail, and temp-path allowlist adjustment.
src/F1.Api/Services/IMigrationRunAdminService.cs Extends kickoff command and adds rollback command/result + interface method.
src/F1.Api/Dtos/AdminMigrationRunDtos.cs Adds rollback/conflict DTOs and extends kickoff request/response and run detail payload.
src/F1.Api/Controllers/MigrationRunsController.cs Threads the kickoff confirmation flag and adds the admin rollback endpoint.
docs/runbooks/migration-write-pipeline-trace.md Adds a runbook trace (currently inconsistent with updated pipeline behavior).
docs/epics/gh-284-migration-write-correctness-and-non-empty-db/epic-migration-write-correctness-and-non-empty-db.md References the new runbook artifact for acceptance criteria traceability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/F1.Api/Services/MigrationRunAdminService.cs
Comment thread src/F1.Api/Services/MigrationRunAdminService.cs Outdated
Comment thread src/F1.Infrastructure/Data/F1DbContext.cs
Comment thread src/F1.Web/Pages/AdminMigrationRuns.razor Outdated
Comment thread docs/runbooks/migration-write-pipeline-trace.md
Comment thread docs/runbooks/migration-write-pipeline-trace.md Outdated
Philip Woulfe added 16 commits July 7, 2026 17:26
…owlist hardening, explicit write confirmation UI, and runbook accuracy
…estionScores with migration and service updates
…ng fields and remove question score reason code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 85 changed files in this pull request and generated 3 comments.

Files not reviewed (5)
  • src/F1.Infrastructure/Migrations/20260707172350_AddCanonicalWriteFields.Designer.cs: Generated file
  • src/F1.Infrastructure/Migrations/20260707172723_RepairCanonicalWriteFieldsAfterEmptyApply.Designer.cs: Generated file
  • src/F1.Infrastructure/Migrations/20260707182836_AddQuestionBooleanNormalizationFields.Designer.cs: Generated file
  • src/F1.Infrastructure/Migrations/20260707184503_RemoveImportRunIdFromQuestionTables.Designer.cs: Generated file
  • src/F1.Infrastructure/Migrations/20260707185947_SimplifyQuestionAnswerActualAndScoreFields.Designer.cs: Generated file

Comment thread src/F1.Api/Services/MigrationRunAdminService.cs
Comment thread src/F1.Api/Services/MigrationRunAdminService.cs Outdated
auto-merge was automatically disabled July 7, 2026 20:00

Head branch was pushed to by a user without write access

@PhilipWoulfe
PhilipWoulfe merged commit 0718058 into main Jul 7, 2026
8 checks passed
@PhilipWoulfe
PhilipWoulfe deleted the feature/gh-284-stories-1-8-moved branch July 7, 2026 20:05
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