Skip to content

MAINT: validate SQL Server migrations - #4246

Merged
Behnam (behnam-o) merged 6 commits into
microsoft:mainfrom
behnam-o:agents/ci-sqlserver-migration-check-pyrit
Nov 13, 2026
Merged

Behnam (behnam-o) merged 6 commits into
microsoft:mainfrom
behnam-o:agents/ci-sqlserver-migration-check-pyrit

Conversation

@behnam-o

@behnam-o Behnam (behnam-o) commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Catch SQL Server migration errors before merge using a disposable SQL Server Developer container on GitHub-hosted CI.

  • Run a standalone validation script on an empty database through the branch's Alembic head and compare its schema with models.
  • Check PRs and merge queues with bounded readiness/timeouts and failure logs. No Azure credentials or changes to the general integration suite.

Validated against real SQL Server after the separate fix in #4247; lint, type, and workflow checks pass.

Exercise fresh and populated SQL Server upgrades on GitHub-hosted runners without Azure credentials. Keep migration repairs separate so the check exposes existing failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 17:26

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.

🔵 Needs a closer look

The new SQL Server tests are blocked by an existing migration failure, requiring maintainer confirmation that the separate repair is included and GitHub-hosted execution succeeds before merging.

No open issues 🎉

What changed in this PR

Adds real SQL Server migration validation to PyRIT’s CI pipeline to catch database-specific failures before merge, including in the merge queue.

Changes:

  • Adds a disposable SQL Server 2022 job with readiness checks, timeouts, and failure diagnostics.
  • Adds fresh and populated-database migration tests covering retained data, relationships, Unicode, collation, repeat startup, and schema agreement.
  • Documents local execution, coverage limits, and required-check configuration.

The PR remains blocked on the separate repair for the known Unicode dataset-name migration syntax error.

File Description
tests/​integration/​memory/​test_sqlserver_migrations_integration.py Adds isolated SQL Server migration and data-preservation tests.
doc/​contributing/​4_running_tests.md Documents the migration check and maintainer setup.
.github/​workflows/​build_and_test.yml Adds the SQL Server service and migration validation job.

Review effort: Balanced

Behnam Ousat and others added 5 commits November 12, 2026 09:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove seeded historical-schema coverage and keep fresh-to-head migration execution plus schema comparison.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the migration check to a standalone build script so general integration pipelines do not require a disposable SQL Server. Preserve fail-closed configuration, schema validation and cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@behnam-o
Behnam (behnam-o) marked this pull request as ready for review November 12, 2026 22:49

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.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

@behnam-o
Behnam (behnam-o) added this pull request to the merge queue Nov 13, 2026
Merged via the queue into microsoft:main with commit 149395e Nov 13, 2026
63 checks passed
@behnam-o
Behnam (behnam-o) deleted the agents/ci-sqlserver-migration-check-pyrit branch November 13, 2026 16:13
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