* Move call to STS move api into project.ts (#22071)
* move call to STS move api into project.ts
* remove undefined
* Remove convert to sdk style code (#22081)
* remove convert to sdk style code
* remove from package.json
* Merging latest from main (#22097)
* [SQL-Migration] Login migrations telemetry (#22038)
This PR enhances telemetry for login migrations (and in the following ways:
Add details for starting migration (number of logins migrating, type of logins)
Log Migration result (number of errors per step, duration of each step, type of logins, if system error occurred)
Add sql-migration extension to our telemetry
Adds details when trying to connect to target
Tracks clicking "done" from the wizard
Fixes bucketizing for navigating telemetry in the login migration wizard
Sample usage of kusto query for new telemetry:
RawEventsADS
| where EventName contains 'sql-migration'
| extend view = tostring(Properties['view'])
| extend action = tostring(Properties['action'])
| extend buttonPressed = tostring(Properties['buttonpressed'])
| extend pageTitle = tostring(Properties['pagetitle'])
| extend adsVersion = tostring(Properties['common.adsversion'])
| extend targetType = tostring(Properties['targettype'])
| extend tenantId = tostring(Properties['tenantid'])
| extend subscriptionId = tostring(Properties['subscriptionid'])
| where view contains "login"
//| where adsVersion contains "1.42.0-insider"
| where ClientTimestamp >= ago(18h)
| project EventName, ClientTimestamp, SessionId, view, pageTitle, action, buttonPressed, targetType
, tenantId, subscriptionId
, adsVersion, OSVersion, Properties
* Add Secure Enclaves dropdown with customizable Advanced options (#22019)
* Update extension READMEs (#22079)
* Fix query-history README images (#22084)
* [Loc] update to mssql and sql-migration xlf files (#22087)
* [Loc] small fix to Portuguese lcl file (#22088)
* [Loc] small fix to Portuguese lcl file
* remove newline
* Adding None bindings to the sqlProjects service (#22085)
* Adding None bindings
* updating names of None bindings
---------
Co-authored-by: AkshayMata <akam520@gmail.com>
Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com>
Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
Co-authored-by: Alex Ma <alma1@microsoft.com>
* Swap add and update sqlcmd variables in sql projects to use STS apis (#22086)
* delete sqlcmd variable working
* undo add
* remove variable from add and update sqlcmd variable apis
* hookup add and edit sqlcmd variable
* update vscode-mssql.d.ts
* move add and edit to project.ts
* update STS and tests
* move delete sqlcmd variable to project.ts (#22104)
* add test for add and edit sqlcmd variable (#22107)
* Swapping property access to STS (#22115)
* checkpoint
* Adding sqlproj property bindings
* Swapping out property loading and setting
* consolidating to this.sqlProjService
* Update dacpac reference to use STS api (#22116)
* Update add dacpac reference to use STS api
* remove changes for project ref
* validate unset settings from add database reference dialog
* update one more place getting sqlprojservice
* addressing comments
* fix path for dacpac reference (#22143)
* Swap add project reference to call STS (#22148)
* initial changes for swapping add project reference
* fix include path
* move common logic to helper function
* read sqlcmd variables from STS (#22147)
* Swapping .sqlproj- and crossplat compatibility-related functions to use STS (#22146)
* Supporting roundtrip
* Updating sqlproj style checks and cross-platform compatibility to use STS
* removing unnecessary awaits
* Fixing assertions
* Adding roundtrip update confirmations
* test cleanup
* cleaning up comment; localizing error
* Swap add system db reference (#22171)
* swap adding system database references
* fix tests
* remove only in test
* Read database references from STS (#22179)
* Read database references from STS
* fix system dacpac names
* fix project reference name
* Swap changeTargetPlatform to call STS (#22172)
* swap changeTargetPlatform to call STS
* Address comments
* De-duplicating enum for SystemDatabase (#22196)
* Deudping SystemDatabase enum
* simplifying enum refs
* Removing the now-unused imports code from SqlProjects (#22199)
* Removing unused importTargets entries
* whitespace; also to retrigger github checks on correct branch
* Hooking in Move() for Nones and PublishProfiles (#22200)
* Swap delete database reference to call STS (#22215)
* initial changes
* update contracts
* remove unnecessary info from SystemDatabaseReferenceProjectEntry
* uppercase master and msdb
* cleanup
* update test
* update comment
* undo change in projectController.ts
* remove unused system dacpac helper functions (#22204)
* more cleanup of project.ts (#22242)
* fix a couple database reference tests (#22248)
* Organizing sqlcmd variable and db reference code (#22284)
* organize database references and sqlcmd variable functions
* separate database reference tests
* Script and folder get + add support (#22166)
* Initial sqlobjectscripts
* adding mock filter
* test fixing
* another test passing
* swapping pre/post/none checkpoint
* awaiters
* convert addExistingItem
* swapping folders
* removing print
* stripping out project folder and file readers
* adding some regions
* Updating sqlproj style checks and cross-platform compatibility to use STS
* Updating sqlproj style checks and cross-platform compatibility to use STS
* added type property to tree items
* projectController swapovers
* removing imported targets
* Deleting the last of the TS XML parsing!
* Removing old functions
* renamed readNoneScripts to readNoneItems
* fixing path passed to STS calls
* remove system dacpac tests that were moved to DacFx (#22299)
* fix error when opening file after adding a file to sql project (#22309)
* fix error when opening file after adding a file to sql project
* remove unused import
* fix exclude for table and externalStreamingJob (#22310)
* add reload project (#22313)
* set DSP from STS (#22320)
* fix adding post-deployment script and existing item (#22317)
* Test cleanup for .sqlproj content operations (#22330)
* Fixing up tests
* sqlproj content operations tests
* remove only
* Cleanup
* Correcting collation
* cleanup constants.ts (#22336)
* fix folders not showing in project tree (#22319)
* Fix project controller tests (#22327)
* fixing ProjectController tests after swap
* remove only from database reference tests
* change system dbs back to lowercase in sql projects (#22353)
* Bump tools service
* Updated yarn.lock file
* pass SystemDacpacsLocation when building legacy style sql projects (#22329)
* Benjin/fix types (#22365)
* Updated yarn.lock file
* Fixing types
* fix projectController tests (#22375)
* Fixing the deletion flow for files and folders (#22366)
* checkpoint
* PR feedback
* Fixing up SDK-style operations project test group (#22377)
* Fixing up SDK-style project test group
* Removing .only
* Fixing up database reference tests (#22380)
* Fixing DB reference test group
* Extra cleanup
* removing only
* Consolidating None and PublishProfile; lighting up test (#22382)
* Lighting up project property tests (#22395)
* Checkpoint
* Lighting up project property tests
* removing timeout
* Fixing buildHelper test (#22400)
* Unskipping up roundtrip test (#22397)
* Refactoring database references to split literalVariable from databaseName (#22412)
* refactoring database references to split databaseVariableLiteralValue out from databaseName
* renaming more properties
* Removing branch in entry population
* removing only
* Fixing baselines for delete test
* PR feedback
* Fixing up ProjectTree tests (#22419)
* Fixing up projectTree tests
* remove only
* Updating projectController exclude test (#22413)
* Updating test
* moving filtering for external folders to readFolders() method
* Removing EntryType import
* fix ups (#22435)
* adding extra info for test failure
* hide exclude folder from context menu until it's supported (#22454)
* Adding current test name to generated folder to avoid conflicts (#22478)
* Adding current test name to generated folder to avoid conflicts
* passing correct test parameter in
* Adding trimming and entropy
* Deleting unused baselines (#22497)
* Replacing addToProject() with addSqlObjectScripts() (#22489)
* checkpoint
* Fixing test
* Updating file scraper function to filter only to .sql files (no folders, no txt)
* changing var names to reflect that the lists only contain .sql scripts
---------
Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Co-authored-by: AkshayMata <akam520@gmail.com>
Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com>
Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
Co-authored-by: Alex Ma <alma1@microsoft.com>
* Read publish profiles stored in sqlproj file and present it in the projects tree
* Save publish profile and add it to sqlproj file, and present it in the tree
* Fix context menu operations
* Add tests
* Address comments
* update the default Microsoft.Build.Sql version used by sql projects
* update Microsoft.Build.Sql SDK version
* update baselines and template to also use 0.1.7-preview
* Revert "Revert "Fix sql projects not using OutputPath in sqlproj for publishing (#19987)" (#20127)"
This reverts commit dc7522c661.
* read configuration from sqlproj
* Add more tests
* use last OutputPath in sqlproj
* add support for removing file in new style project
* fix test
* only load files, not whole project when checking if a <Build Remove> needs to be added
* merge changes
* fixes after merge
* use glob to get files for new style msbuild sdk sqlproj
* add tests
* cleanup
* fix test
* don't show bin and obj files and folders
* handle other glob patterns
* fix duplicate entries getting added for glob patterns in project's folder
* don't show SSDT update warning for new style projects
* update strings
* add checks for the 2 other ways to specify msbuild sdk
* add link to docs on how to use project sdk
Co-authored-by: Kim Santiago <kisantia@Kims-MacBook-Pro.local>
* Expose default database collation through 'sql-database-projects' extension API.
For the purpose of schema conversion we would need to know whether target database is configured as CI or CS. This will be used to produce a warning, if we detect a case-sensitive identifier, but database is configured as CI. In order to support this scenario we need to access `<DefaultCollation/>` property of the project.
This change adds new method to the `ISqlProject` interface that allows to read the value of the project property. There already was similar method for the SQL version/platform (`<DSP/>` property) and while working on the change, I took an opportunity to refactor the way project properties are extracted from the XML. Original code was hardcoded in the `getProjectTargetVersion` and I extracted it into separate `evaluateProjectPropertyValue` helper, that can be used in the future by any getter or access method that is supposed to return a value of the single property. This also allows us to improve the way properties are retrieved from the XML. Today the logic is very rudimentary - we read the first matching XML element with the required name. This is not correct as it does not verify the parent to be `<PropertyGroup/>`, neither it evaluates the `Condition` attributes nor property value itself. I did not invest in this, but added a TODO there explaining that the method may not perform as expected.
After the helper method was added, I updated the existing `getProjectTargetVersion` method to leverage it. The only complication here was the error throwing logic, as it was using custom error message. I preserved that, as there were tests verifying it already. For the new accessor method I did not introduce a special error message and rely on generic one I defined for use within the helper method. Additionally, for the collation we return default value of `SQL_Latin1_General_CP1_CI_AS`, if project does not have the property defined. This is what SSDT for Visual Studio shows in the UI when property is missing and I decided to align with that.
Finally, I added tests for both - original `getProjectTargetVersion` and new collation extraction method to make sure they work as expected. While working on the tests, I've noticed complaints that some rejected promises were not awaited. I added missing `await`s.
* Added Tools Service call for ValidateStreamingJob
* Partial addition of ESJ
* adding test mocks
* Validation working
* Modifying command visibility logic to submatch ESJs in addition to files
* Changed string literal to constant, corrected attribute order
* Added tests
* correcting casing that's causing test failures on linux
* Swapping Thenable for Promise
* excluded validate from command palette
* Update Open Project to display pre-post deployment scripts in the project tree
* Address comments
* Fixed tests
* Update nonDeployScripts to noneDeployScripts and throw a warning message instead of informational message for prePostDeployCount
* add support for AAD interactive for project data sources
* fix whitespace
* remove warning message
* choose azureMFA if a connection string has both integrated security=true and authentication=active directory interactive
* first changes for showing project references
* add tests
* fix interface and formatting
* add try so that project still gets loaded even if dependency project loading fails
* use instanceof
* add circular reference error
* allow relative paths in project file outside of project folder
* Adding some tests
* Adding error string to loc strings
* Fixed test
* fix error message
* PR comments and some more fixes
* initial changes for reading connection from profile
* connection string can now be read from publish.xml
* fix build errors and update test
* move publish profile tests to their own file
* cleanup
* update message
* fix string
* remove apiWrapper
* load database name from profile.xml
* load sqlcmd variables from profile
* Add warning text
* add tests
* fix file filter for windows
* add comments
* show SQLCMD variables in a table
* reset dialog before testing readPublishProfile callback
* add system database reference for VS
* a few fixes
* update tests
* update tests
* fix tests after merge
* addressing comment to make logic a little more clear
* fix replacing SSDT reference name in tree
* Adding reading SqlCmdVars from project file
* organized apiWrapper, added calls
* Adding test to confirm deployment/script gen profiles with sqlcmd vars
* convert system database references from SSDT
* remove empty ItemGroup if no other database references
* fix baseline files
* also update sqlproj if system database references were added in SSDT since the sqlproj got updated with ADS imports
* undo change
* move updating system db references out of updateProjectForRoundTrip()
* update test to have an already updated system db ref
* add clean target after merge from master
* add await
* addressing comments
* add database references to same itemgroup
* show database references in tree
* update tests
* refresh project tree after a reference is added
* addressing comments
* add validation
* Add test
* sort imports
* add dacpacs
* able to add reference to appropriate master dacpac
* able to add reference to a dacpac
* Add a few tests
* fix tests
* fix wording
* fix adding reference to same database
* add project tests
* fix test for windows
* addressing comments
* Adding another test
* update tests
* fix build error
* Test code for round tripping feature
* Fixed tests. Edited updateImportedTargetsToProjFile method to push newly added import target to the list.
* Added couple more tests
* Addressed comment
* Initial changes for Import database as new project
* Functionally complete code
* Initial changes for Import database as new project
* Functionally complete code
* Resolved conflicts with latest changes. Also did some code refactoring.
* Addressed comments. Added unit tests.
* Addressed comments
* Moved ExtractTarget enum from azdata to mssql
* Addressed comments
* Fixed indentation in project templates