Commit Graph

126 Commits

Author SHA1 Message Date
Cory Rivera
63a78e62aa Handle some server properties not being supported for certain SQL versions (#24587)
* Co-authored-by: Benjin Dubishar <benjind@microsoft.com>
2023-10-09 13:28:08 -07:00
Kim Santiago
42a0622d93 Add vscode support for System database package references for SDK-style sql projects (#23383)
* changes for supporting system db package references in vscode

* cleanup

* address comments
2023-06-14 16:30:03 -07:00
Kim Santiago
1ff0a07217 Add support for System database package references for SDK-style sql projects (#23309)
* add package reference type for system db references

* Add radio buttons

* hookup

* add test

* handle changing reference type radio buttons

* cleanup

* update strings

* change style to type

* change more places with style to type

* blank lines
2023-06-13 16:06:12 -07:00
Charles Gagnon
50e08e11df Add back common extension linting rules (#23271)
* Add back common extension linting rules

* Fix lint issues
2023-05-31 14:31:00 -07:00
Benjin Dubishar
6b1dd0e468 Changing "files" to "sqlObjectScripts" to be more accurate (#22899)
* Changing "files" to "sqlObjectScripts" to be more accurate

* fixing func call
2023-05-01 08:31:13 -07:00
Benjin Dubishar
29ff6ca16c Adding Move, Exclude, and Rename support for folders (#22867)
* Adding exclude folder and base for move folder

* checkpoint

* rename

* Fixing up tests

* Adding exclude test to projController

* Adding tests

* fixing order of service.moveX() calls

* Updating move() order in sqlproj service

* PR feedback

* unskipping

* reskipping test

* Fixing folder move conditional

* updating comments
2023-04-28 16:05:38 -07:00
Sakshi Sharma
757067b132 Required changes to make sql projects extension work with vscode (#22847)
* Update CreateProject api

* More updates

* Fix a few comments

* Address comments

* Remove package.json changes

* Fix error

* Fix testUtil
2023-04-28 10:27:59 -07:00
Kim Santiago
2dcbdc9c63 Handle nukpg database references in project.ts (#22762)
* changes in project.ts for adding nupkg database references

* Add tests

* more tests

* fix comment

* remove it.only
2023-04-18 11:11:42 -07:00
Benjin Dubishar
02e61d1598 Swapping Record usage to Map in SQL Projects (#22758)
* Changing SqlCmdVars from Record to Map

* Converting the rest

* Updating tests

* more cleanup

* Updating test to use new test creation API
2023-04-17 12:56:39 -07:00
Sakshi Sharma
91ea2b43d6 Save publish profile in Publish UI workflow (#22700)
* Add profile section in Publish project UI

* Move publish profile row below Publish Target

* Add contract for savePublishProfie and SaveProfileAs button functionality

* Make the DacFx contract functional

* Send values from UI to DacFx service call

* Fix build error

* Address comment, remove print statements

* Address comments

* Set correct connection string

* Fix functionality for rename, exclude, delete publish profiles. Add new profile to the tree and sqlproj.

* Address comment to update alignement of button

* Address comments

* Update button to use title casing
2023-04-13 17:08:24 -07:00
Benjin Dubishar
4d3d74e3da Fix for issue where bulk-adding scripts could perform a rescan after each script (#22665)
* Changed bulk script add to delay reloading file list until end of operation.

* Adding style name to sqlproj typing file

* vBump to 1.0.1
2023-04-10 16:28:53 -07:00
Benjin Dubishar
efd489ecde Adding patch to rename backup file when it already exists (#22613) 2023-04-04 13:20:12 -07:00
Benjin Dubishar
cec349d2a4 Fix issue where errors during project update were swallowed (#22612)
* adding errors

* Fixing bug where errors occurring during updating project got swallowed

* removing unnecessary "vscode"
2023-04-04 13:19:07 -07:00
Benjin Dubishar
15ecdc8653 Fixing smattering of issues regarding updating projects for cross-plat (#22575)
* Fixing smattering of issues regarding updating projects for cross-plat

* Adding both options for modal

* Removing quickpick
2023-04-03 10:10:31 -07:00
Benjin Dubishar
15c0c68e44 SQL Database Projects backend swap to DacFx/Tools Service (#22451)
* 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>
2023-03-28 13:39:57 -07:00
Sakshi Sharma
41e2767880 Add publish profile to sql proj and tree (#22008)
* 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
2023-02-23 22:32:12 -08:00
Sakshi Sharma
2626f24d5a Remove fs.promises.rmdir (#21356)
* Remove fs.promises.rmdir

* Add force flag
2022-12-12 11:04:31 -08:00
Kim Santiago
83043dadcc move checking if a file contains a create table statement to utils (#20512) 2022-08-31 10:21:30 -07:00
Kim Santiago
06a3bf6718 Handle output path and configuration in .sqlproj (#20426)
* 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
2022-08-25 10:25:12 -07:00
Kim Santiago
dc7522c661 Revert "Fix sql projects not using OutputPath in sqlproj for publishing (#19987)" (#20127)
This reverts commit 70f0e7264b.
2022-07-21 08:11:23 -07:00
Kim Santiago
70f0e7264b Fix sql projects not using OutputPath in sqlproj for publishing (#19987)
* fix sql projects not using output path in sqlproj for publish

* add tests

* Addressing comments
2022-07-13 16:58:37 -07:00
Alan Ren
416e607f32 resend previous PR with test fixes (#19912)
* Revert "Revert "use reliable way to detect createtable statements (#19897)" (#19906)"

This reverts commit c211fb981c.

* fix tests

* fix test cases
2022-07-02 11:25:09 -07:00
Alan Ren
c211fb981c Revert "use reliable way to detect createtable statements (#19897)" (#19906)
This reverts commit 9a22c429a9.
2022-07-01 11:47:21 -07:00
Alan Ren
9a22c429a9 use reliable way to detect createtable statements (#19897)
* use reliable way to detect createtable statements

* PR comments

* comments
2022-06-30 18:23:12 -07:00
Charles Gagnon
5b95a47ca6 Add launchPublishToDockerContainerQuickpick to extension API (#19834)
* Initial

* remove namespace

* minor fixes
2022-06-27 15:29:43 -07:00
Charles Gagnon
f22c9a02ab Update xmldom to 0.8.2 (#19625)
* Update xmldom to 0.8.2

* Fix test

* Comments
2022-06-06 12:59:09 -07:00
Kim Santiago
1bbf5a78c1 enable table designer for table script in sql database project (#19237)
* add 'open in designer' to context menu of tables in sql projects

* fix tests

* Address comments

* enable table designer for sql database proj

* update label and issues on init

* vbump sts

* use promisified fs

* pr comments

Co-authored-by: Alan Ren <alanren@microsoft.com>
2022-06-02 13:27:47 -07:00
Charles Gagnon
6ae380b65d Remove unnecessary awaits from extensions (#19571)
* Remove unnecessary awaits

* fix ignore

* revert eslintignore

* try

* increase size

* Increase sql lint size
2022-05-31 15:36:44 -07:00
Charles Gagnon
f2b623b3b2 Move promptAddItem to extension API (#19423)
* Move addItem to extension API

* add noneDeployScripts
2022-05-19 11:25:10 -07:00
Kim Santiago
d122e7636c remove default VS properties when converting legacy to SDK-style sql project (#19255) 2022-05-04 12:00:38 -07:00
Alexander Ivanov
0f598dd30b Add sqlproj property to trace the origin of the project. (#18670)
* Add sqlproj property to trace the origin of the project.

As part of the database migration process (schema conversion, in particular) we want to be able to tell when converted schemas are being built/deployed to the actual database server. Given that we rely on the SQL Database Projects ADS extension for the compilation/deployment, we don't have too many options other than updating the said extension.

The suggested approach is to make the following changes:
1) Add new property to the sqlproj file (called `DatabaseSource`), which will maintain the origin(s) of the project. The property can contain multiple values (separated by semicolon), in case same project contains objects produced by multiple sources (extract schema, convert from another database, etc.).
2) During build and deploy actions, send the well-known values from the newly added property to the telemetry. We don't want to send any random value of the property, as it may raise some privacy concerns. Instead we define a list of the well-known values that we know do not carry any personal information and send those, if they are specified.

This change adds all necessary APIs to the SQl Database projects extension which will be consumed by our migration extensions to populate new `DatabaseSource` property.

* Use `undefined` instead of `null`

Co-authored-by: Kim Santiago <kisantia@microsoft.com>
2022-04-18 11:38:10 -07:00
Kim Santiago
d6dab3dd18 Remove build and folder includes when converting to SDK-style project (#18889)
* remove Build and Folder Includes

* add tests

* cleanup

* rollback if there was an error during the conversion
2022-04-01 21:04:18 -04:00
Kim Santiago
2f825f8a97 add initial SDK-style project migration (#18827)
* add initial SDK-style project migration

* addressing comments
2022-03-28 16:29:14 -07:00
Kim Santiago
d24a289af5 fix SDK style projects not being able to find system dacpacs (#18218)
* fix SDK style projects not being able to find system dacpacs

* fix tests
2022-02-16 09:36:01 -08:00
Z Chen
9e574ae602 Database Projects - Add existing file (#18066)
* Add existing file to sqlproj

* Address PR comments

* Fix failing test

* Add convertSlashesForSqlProj to test failure
2022-02-14 15:04:57 -08:00
Charles Gagnon
1c9ba64ee0 check-param-names (#18189) 2022-01-31 12:39:22 -08:00
Kim Santiago
f0dd31c457 fix excluding pre/post/none deploy scripts in sdk style projects (#18117) 2022-01-25 11:49:52 -08:00
Kim Santiago
6a288dcaa5 add types instead of using any in project.ts (#18091) 2022-01-14 12:53:57 -08:00
Kim Santiago
cd6b39ffee add a project guid if a sql project doesn't have one (#18009) 2022-01-07 16:01:39 -08:00
Kim Santiago
443257e699 Handle delete folder for SDK style sql projects (#17961)
* handle delete folder for sdk style projects

* cleanup

* compare original sqlproj contents

* remove redundant checks
2021-12-20 12:43:30 -08:00
Kim Santiago
b6d38e6e58 fix pre/post deploy scripts getting double counted in the files for sdk style projects (#17954)
* fix pre/post deploy scripts getting double counted in the files for sdk style projects

* add test

* update comment
2021-12-16 15:32:32 -08:00
Kim Santiago
703a925a92 Add folder for SDK style sql projects (#17918)
* update add folder for sdk style sql projects

* fix tests

* add test for add folder to sdk style project

* handle nested folders

* update helper function name
2021-12-16 09:35:29 -08:00
Kim Santiago
2b1acbc2c7 Handle exclude folder for sdk style sql projects (#17826)
* handle exclude Folder for sdk style projects

* update comment

* fix tests

* cleanup

* handle nested folders

* cleanup

* addressing comments
2021-12-14 11:29:42 -08:00
Kim Santiago
33f01054c0 Update remove file for sdk style sql projects (#17688)
* 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
2021-11-22 14:45:43 -10:00
Kim Santiago
a79c61ff4e Fix ordering of reading sqlproj Build Includes and Removes (#17712)
* evaluate includes and removes in order in sqlproj

* fix after merge

* fix comment

* update comment
2021-11-22 11:50:06 -10:00
Kim Santiago
6725e07ece update names for msbuild sdk style projects (#17677)
* update names for msbuild sdk style projects

* remove msbuild from names

* update comments
2021-11-16 11:23:19 -10:00
Kim Santiago
5fccd8ebcd update add file/folder for msbuild sdk style projects (#17660)
* update add file for msbuild sdk style projects

* also handle add folder

* fix comment
2021-11-15 15:00:50 -10:00
Kim Santiago
bf1cc057be Refactoring readProjFile() (#17637)
* move reading project parts to different helper functions

* cleanup

* remove comment

* addressing comments
2021-11-12 15:02:52 -08:00
Kim Santiago
b6047ad87d Move project entry classes to separate file (#17629)
* moving ProjectEntry stuff to another file

* cleanup
2021-11-09 16:03:39 -08:00
Kim Santiago
8057bf855b add support for Build Remove (#17610) 2021-11-09 10:45:56 -08:00