[DMS-1255] Publish and restore MSSQL database template packages (Minimal/Populated) at parity with PostgreSQL#1100
Open
simpat-jesus wants to merge 1 commit into
Open
[DMS-1255] Publish and restore MSSQL database template packages (Minimal/Populated) at parity with PostgreSQL#1100simpat-jesus wants to merge 1 commit into
simpat-jesus wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the PostgreSQL-only database-template pipeline to MSSQL — CI can now build, restore-verify, and publish
EdFi.Api.{Minimal,Populated}.Template.MsSql.{5.2.0,6.1.0}packages containing a nativeBACKUP DATABASE.bak— and homologates the local deployment topology: CMS and DMS now share one physical database on both engines (previously PostgreSQL-only behavior). Consuming the published template packages from the bootstrap flows (a wrapper restore phase) is deliberately not in this PR; that is DMS-1271, which builds on the-DbOnlystart-script slice introduced here.Changes
Template-Management.psm1(BACKUP DATABASE/RESTORE ... WITH MOVEviasqlcmdagainstdms-mssql, transient in-container backups cleaned up; PGpg_dump/psqlpath unchanged); multi-file.baksupport (one MOVE perRESTORE FILELISTONLYrow);pg_terminate_backendbefore the PG verify-restore DROP; template settings parameterized by engine token + artifact extension;verify-template-restore.ps1engine dispatch with T-SQL structural asserts and the serveability probe.build-{minimal,populated}-template.ymltake adatabase_engineinput (engine-dispatched credentials, registration, capture, verify; engine-dependent package-name validation; smoke templates stay PG-only); input-validation parity on the minimal workflow; post-load content gates (populated:edfi.School> 0; minimal: descriptors > 0) so an empty load can never be packaged or published; newEdFi.Api.{Minimal,Populated}.Template.MsSql.ymlcallers mirror the PG callers;provision-e2e-database.ps1gains the MSSQL lane the template workflows use..env.mssqlpoints the Configuration Service atDatabase=${MSSQL_DB_NAME}(was a dedicatededfi_configurationservicedatabase), matching PostgreSQL's existing shared default; OpenIddict identity init targets the shared database (ENV:MSSQL_DB_NAME); the contradictory compose fallbacks inlocal-config.yml/published-config.yml(which namededfi_configurationserviceeven for PG) now interpolate${POSTGRES_DB_NAME}. An opt-in separate-CMS-database mode is DMS-1270.bootstrap-published-dms.ps1/start-published-dms.ps1accept-DatabaseEngine(mssql.ymlswap, readiness wait, engine-aware OpenIddict init); the wrapper forwards the engine to both start scripts;start-published-dms.ps1's transitional direct-SQL-LoadSeedDataswitch is removed (wrapper-level API seeding is the seed path);build-dms.ps1 StartEnvironmentforwards-DatabaseEngine/-DataStandardVersion(nowValidateSet-guarded).-DbOnlyphase slice on both start scripts: database container + readiness wait only (PGpg_isreadypoll, MSSQLWait-MssqlReady), mutually exclusive with-InfraOnly/-DmsOnly. Introduced as the primitive the template-restore bootstrap branch (DMS-1271) sequences around..bootstrap/workspace against the effectiveSCHEMA_PACKAGESand re-stages on mismatch — previously a stale workspace was silently reused across Data Standard switches, serving one DS's content under another's label;load-dms-seed-data.ps1derives its sample-data ref tag from the selected Data Standard instead of hardcoding v5.2.0..env.mssqloverlay rewritesDATABASE_TEMPLATE_PACKAGE's engine token (PostgreSql→MsSql) via the newConvert-TemplatePackageToken, preserving DS-version/template variance.eng/docker-compose/README.md;command-boundaries.mddocuments the-DbOnlyslice and the published-flow engine contract; stale claims about the removed published-LoadSeedDataflag corrected in both design docs.Testing
eng/docker-compose/tests615 passed / 0 failed (new specs:-DbOnlyparameter surface + mutual exclusions on both start scripts, unconditional engine forwarding in the wrapper, workspace-revalidation matrix, seed ref-tag mapping,build-dms.ps1forwarding, shared-topology connection-string pins);eng/DatabaseTemplates/tests42 passed (dump/restore command contracts pinned to exact argument sequences incl. the multi-file.bakfixture, package-identity matrix).-LoadSeedDatalegs on the shared topology: MSSQL Minimal (seed exit 0; 19 descriptors served through a real token), PostgreSQL Minimal regression (seed exit 0; 19 descriptors), and MSSQL Populated (bootstrap phases and serving all healthy — 19 descriptors + 3 schools served; the BulkLoadClient itself exited nonzero under a pre-existing local rate-limiter storm unrelated to this change, reported separately as a follow-up). Topology verified on both engines:sys.databasescontains noedfi_configurationservice, and the shared DMS database holds the 24dmscsCMS tables (identical table set on both engines).Notes for Reviewers
DMS-1255-restore-donorbranch for DMS-1271 to draw from.EdFi.Api.*.Template.MsSql.*ids yet. Suggested CI validation post-merge: dispatch the MsSql callers withpublish_package=falsefirst, then re-dispatch a PostgreSQL caller to prove the now-shared reusable workflows regressed nothing.start-local-dms.ps1 -DatabaseEngine mssql -d -v). E2E env files keep their own explicit topology and are untouched.start-published-dms.ps1no longer accepts-LoadSeedData(it silently meant direct-SQL template restore, unlike the wrapper flag of the same name); wrapper-level-LoadSeedDataAPI seeding is the supported path..bakcouples to the pinnedmssql/server:2022-latestimage (documented at thedatabase_engineworkflow input), as the PG.sqldump couples to the PG major version.🤖 Generated with Claude Code