Added azure provisioning tests#22275
Closed
laurenastrid1 wants to merge 4 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds unit test coverage around Azure provisioning helpers and extends Azure SQL Database provisioning to pass a selectable max vCores value through to database creation, with accompanying localization updates. It also includes webview UI changes on the Azure SQL Database deployment flow.
Changes:
- Added new unit tests for
azureSqlDatabaseHelpersand expanded tests inazureHelpers. - Added
maxVcoresto the Azure SQL Database deployment form state, form components, and provisioning call intocreateAzureSqlDatabase. - Updated Azure SQL Database deployment webviews (notably removing the provisioning “What’s next” links card and removing the free-offer limit behavior selection UI).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Localization entries for new Azure SQL strings (auto-generated localization file). |
| extensions/mssql/test/unit/azureSqlDatabaseHelpers.test.ts | New unit tests covering Azure SQL Database deployment helper behaviors. |
| extensions/mssql/test/unit/azureHelpers.test.ts | Added unit tests for tenant/account helpers and standalone account/tenant loaders. |
| extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/azureSqlDatabaseProvisioningPage.tsx | Removes the completed-state docs links (“What’s next”) card from the provisioning page. |
| extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/azureSqlDatabaseFormPage.tsx | Removes the free-offer exhaustion behavior selection UI from the form page. |
| extensions/mssql/src/sharedInterfaces/azureSqlDatabase.ts | Adds maxVcores to the Azure SQL Database form state contract. |
| extensions/mssql/src/deployment/azureSqlDatabaseHelpers.ts | Initializes and wires maxVcores into provisioning, and adds a maxVcores dropdown component. |
| extensions/mssql/src/constants/locConstants.ts | Adds localized backend strings for “Max vCores” and “Select Max vCores”. |
| extensions/mssql/src/connectionconfig/azureHelpers.ts | Uses maxVcores to shape the ARM SKU name/capacity for free-offer DB creation. |
| extensions/mssql/l10n/bundle.l10n.json | Adds the new localization keys for the max vCores strings. |
Comment on lines
380
to
391
| {renderFormField("databaseName")} | ||
| {formState.authenticationType !== AuthenticationType.AzureMFA && | ||
| !serverCreatedWithAuth && ( | ||
| <> | ||
| {renderFormField("userName", { | ||
| readOnly: !!formState.userName, | ||
| })} | ||
| {renderFormField("password")} | ||
| {renderFormField("savePassword")} | ||
| </> | ||
| )} | ||
| <div className={classes.fieldContainer}> | ||
| <div style={{ flex: 1, width: "100%" }}> | ||
| <Label weight="semibold"> | ||
| {locConstants.azureSqlDatabase.freeLimitBehavior} | ||
| </Label> | ||
| <RadioGroup | ||
| value={localFreeLimitBehavior} | ||
| onChange={(_e, data) => { | ||
| setLocalFreeLimitBehavior(data.value); | ||
| context.formAction({ | ||
| propertyName: "freeLimitBehavior", | ||
| isAction: false, | ||
| value: data.value, | ||
| }); | ||
| }}> | ||
| <div> | ||
| <Radio | ||
| value={KnownFreeLimitExhaustionBehavior.AutoPause} | ||
| label={locConstants.azureSqlDatabase.autoPauseOption} | ||
| /> | ||
| <Text | ||
| size={200} | ||
| style={{ | ||
| display: "block", | ||
| color: "var(--vscode-descriptionForeground)", | ||
| marginLeft: "36px", | ||
| marginTop: "-4px", | ||
| }}> | ||
| {locConstants.azureSqlDatabase.autoPauseDescription} | ||
| </Text> | ||
| </div> | ||
| <div> | ||
| <Radio | ||
| value={KnownFreeLimitExhaustionBehavior.BillOverUsage} | ||
| label={locConstants.azureSqlDatabase.continueChargesOption} | ||
| /> | ||
| <Text | ||
| size={200} | ||
| style={{ | ||
| display: "block", | ||
| color: "var(--vscode-descriptionForeground)", | ||
| marginLeft: "36px", | ||
| marginTop: "-4px", | ||
| }}> | ||
| {locConstants.azureSqlDatabase.continueChargesDescription} | ||
| </Text> | ||
| </div> | ||
| </RadioGroup> | ||
| </div> | ||
| </div> | ||
| {localFreeLimitBehavior === KnownFreeLimitExhaustionBehavior.BillOverUsage && ( | ||
| <Card | ||
| style={{ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| backgroundColor: "var(--colorPaletteYellowBackground1)", | ||
| borderLeft: "3px solid var(--colorPaletteYellowForeground1)", | ||
| padding: "10px 12px", | ||
| gap: "6px", | ||
| marginLeft: "2px", | ||
| }}> | ||
| <div | ||
| style={{ | ||
| display: "flex", | ||
| flexDirection: "row", | ||
| alignItems: "center", | ||
| gap: "10px", | ||
| }}> | ||
| <WarningFilled | ||
| style={{ | ||
| color: "var(--colorStatusWarningForeground1)", | ||
| fontSize: "20px", | ||
| flexShrink: 0, | ||
| }} | ||
| /> | ||
| <span>{locConstants.azureSqlDatabase.continueChargesWarning}</span> | ||
| </div> | ||
| <Link | ||
| className={classes.linkDiv} | ||
| href={AzureSqlDatabaseLinks.freeOffer}> | ||
| {locConstants.common.learnMore} | ||
| <ArrowRight12Regular style={{ marginTop: "2px" }} /> | ||
| </Link> | ||
| </Card> | ||
| )} | ||
| {renderFormField("profileName")} |
Comment on lines
+419
to
428
| const skuName = options.maxVcores ? `GP_S_Gen5_${options.maxVcores}` : "GP_S_Gen5"; | ||
|
|
||
| const freeOfferOptions = options.useFreeLimit | ||
| ? { | ||
| sku: { | ||
| name: "GP_S_Gen5", | ||
| name: skuName, | ||
| tier: "GeneralPurpose", | ||
| family: "Gen5", | ||
| capacity: 2, | ||
| capacity: options.maxVcores ? Number(options.maxVcores) : 2, | ||
| }, |
Comment on lines
174
to
179
| )} | ||
| </div> | ||
| </DeploymentStepCard> | ||
| {isDeploymentComplete && ( | ||
| <DocsLinkCard | ||
| title={locConstants.azureSqlDatabase.whatsNext} | ||
| links={whatsNextLinks} | ||
| /> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); |
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
Added azure provisioning unit tests, and tests for the added azure functions.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines