Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Provisioning #25426

Merged
merged 10 commits into from
Mar 19, 2024
Merged

Target Provisioning #25426

merged 10 commits into from
Mar 19, 2024

Conversation

sahuroshan
Copy link
Contributor

@sahuroshan sahuroshan commented Feb 27, 2024

This PR contains following changes

  1. UI changes for target provisioning experience as per below mocks.
    Mocks - https://www.figma.com/file/UaD2zc58Y2iGKxnqDFQY3Q/End-to-End-Design-GA---SQL-Migration-ADS?type=design&node-id=3298-119337&mode=design&t=v0BLyTpg5zdjtnlu-0

  2. Added RPC Request(GetSqlMigrationGenerateArmTemplateRequest) for the SQL tools service GenerateProvsioningScript API which generates the ARM Template.

Reference code for generating SAS URI to upload ARM template.
https://github.com/Azure-Samples/AzureStorageSnippets/blob/master/blobs/howto/JavaScript/NodeJS-v12/dev-guide/upload-blob-from-blob-sas-token.js

Screenshots of changes
1.
image

image

image

image

@coveralls
Copy link

coveralls commented Feb 27, 2024

Pull Request Test Coverage Report for Build 8340151881

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 41.76%

Files with Coverage Reduction New Missed Lines %
src/sql/workbench/services/connection/browser/connectionDialogWidget.ts 1 73.44%
Totals Coverage Status
Change from base Build 8291620447: 0.004%
Covered Lines: 30828
Relevant Lines: 69082

💛 - Coveralls


this._saveTemplateLink.onDidClick(async () => {
if (hasRecommendations(this.migrationStateModel)) {
const generateProvisioningScriptDialog = new GenerateProvisioningScriptDialog(this.migrationStateModel, this.migrationTargetType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Try catch here to catch any error, and log it. It will be helpful while debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

containerName,
blobName,
permissions: BlobSASPermissions.parse("racwd"),
expiresOn: new Date(new Date().valueOf() + 86400),
Copy link
Contributor

Choose a reason for hiding this comment

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

are we expecting 24 Hours expiration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just used some random value, can change based on suggestion.

azdata.window.openDialog(this.dialog);
await Promise.all(dialogSetupPromises);

await this.model.getArmTemplate(this._targetType);
Copy link
Contributor

Choose a reason for hiding this comment

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

this must be under try catch block. and log error if it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is a try catch block in the getArmTemplate function and error is also logged .

Copy link
Contributor

@stuti149 stuti149 left a comment

Choose a reason for hiding this comment

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

We have SaveTemplate string outside dialog and also one inside dialog but both has different function. one opens a dialog, other saves in file explorer. May be we should separate the strings? Abhishek can comment on this.


// source instance same would be same across all recommendations MI/DB/VM.
let instanceName = model._skuRecommendationResults.recommendations?.sqlMiRecommendationResults[0].sqlInstanceName;
let fileName = `ARMTemplate-${targetType}-${instanceName}-${date}-${time}.json`;
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good to me, hope name is recommended or approved by PM, as this customer facing.

@Ramudaykumar
Copy link
Contributor

Update config.json under sql-migration extension with latest sqltoolsservice build version.

Copy link
Contributor

@Ramudaykumar Ramudaykumar left a comment

Choose a reason for hiding this comment

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

Looks good to me, just take remaining comments.

@sahuroshan sahuroshan merged commit bfa507c into main Mar 19, 2024
9 of 11 checks passed
@sahuroshan sahuroshan deleted the roshansahu/targetProvisioning branch March 19, 2024 09:53
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.

None yet

6 participants