feat(runtime): Add option to disable Document Schema upgrades#26713
Merged
scottn12 merged 5 commits intomicrosoft:mainfrom Mar 19, 2026
Merged
feat(runtime): Add option to disable Document Schema upgrades#26713scottn12 merged 5 commits intomicrosoft:mainfrom
scottn12 merged 5 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new runtime option to disable document schema upgrades, preventing outgoing DocumentSchemaChange ops and rejecting incoming ones to avoid mid-session schema transitions.
Changes:
- Introduces
disableSchemaUpgradeonContainerRuntimeOptions(defaulting tofalse) and threads it into schema controller behavior. - Updates schema controller logic to no-op on send and throw on receive when schema upgrades are disabled.
- Extends tests and option matrices to exercise the new flag and updates API/type-validation artifacts.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/test/test-service-load/src/optionsMatrix.ts | Adds the new flag to load-test runtime option permutations. |
| packages/service-clients/azure-client/src/test/AzureClient.spec.ts | Updates expected runtime options to include the new flag. |
| packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts | Marks the API type compatibility break as expected. |
| packages/runtime/container-runtime/src/test/documentSchema.spec.ts | Adds coverage for disabled-upgrade behavior and updates controller construction calls. |
| packages/runtime/container-runtime/src/test/containerRuntime.spec.ts | Updates expected runtime options and telemetry assertions to include the new flag. |
| packages/runtime/container-runtime/src/summary/documentSchema.ts | Implements the disable-upgrade behavior in the schema controller and updates docs. |
| packages/runtime/container-runtime/src/containerRuntime.ts | Adds the new option to the public runtime options API and wires it into construction. |
| packages/runtime/container-runtime/src/containerCompatibility.ts | Excludes the new option from doc-schema-affecting runtime options. |
| packages/runtime/container-runtime/package.json | Records the API compatibility break in type validation configuration. |
| packages/runtime/container-runtime/api-report/container-runtime.legacy.beta.api.md | Updates the API report to include the new option. |
Comments suppressed due to low confidence (1)
packages/runtime/container-runtime/src/summary/documentSchema.ts:1
- Adding another positional boolean parameter to an already-long constructor signature increases the chance of call-site mistakes (especially since many call sites now pass a bare
false). Consider making this parameter optional with a default (disableSchemaUpgrade = false) or switching to an options object for the trailing parameters so call sites are self-documenting and future additions don’t require broad mechanical edits.
/*!
You can also share your feedback on Copilot code review. Take the survey.
packages/runtime/container-runtime/src/summary/documentSchema.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
anthony-murphy
approved these changes
Mar 19, 2026
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.
Description
This PR adds an option
disableSchemaUpgradetoContainerRuntimeOptions. When enabled, it will prevent the runtime from sendingDocumentSchemaChangeops and will throw on incomingDocumentSchemaChangeops.This is useful for applications that don't require schema upgrades, as it guarantees that no mid-session errors can arise from schema upgrades.
Misc
AB#53703
Spec