Commit Graph

278 Commits

Author SHA1 Message Date
Kim Santiago
b2be609c36 hook up add sql binding (#16838)
* hookup add sql binding

* fix typo

* addressing comments

* Addressing more comments

* add more comments
2021-08-23 13:49:05 -07:00
Kim Santiago
9e16a30ece bump sql database projects version to 0.13.0 (#16834) 2021-08-20 15:30:10 -07:00
Charles Gagnon
6b1cc85c9a Get tools service install location from extensions (#16796)
* Get STS install location from extensions

* Update error
2021-08-17 13:48:22 -07:00
Charles Gagnon
6b5c909f7f Fix connection prompt for publish database quickpick (#16767) 2021-08-14 11:57:41 -07:00
Leila Lali
32a71a2de6 SQL Database Project - Deploy db to docker (#16406)
Added a new command to deploy the project to docker
2021-08-12 13:24:16 -07:00
Sakshi Sharma
4250556023 Fix incorrect .NET error (#16694)
* Fix .NET Install state for error conditions

* Address comment- remove redundant constructor
2021-08-11 11:29:48 -07:00
Benjin Dubishar
d0bcba4cc0 Corrects workspace project tree refresh behavior for adding new projects to the workspace (#16650)
* bugfix and updates

* PR feedback

* Deferred promise for project disk scan

* fix casing

* fixing race condition on extension activation, test failure
2021-08-11 09:11:00 -07:00
Charles Gagnon
c891584fec Update ADS strings for sql-database-projects (#16683)
* Update ADS strings for sql-database-projects

* fix
2021-08-10 22:21:46 -07:00
Sakshi Sharma
e0143e0752 Update pop-up to be an error message instead of informational message (#16660)
* Update pop-up to be an error message

* Update message text

* Address comment

* Address comment
2021-08-10 15:24:09 -07:00
Charles Gagnon
b2ff8162e6 Add DB Reference quickpick dialog (#16601)
* Add DB Reference quickpick dialog

* pr comments & cleanup
2021-08-09 12:46:53 -07:00
Sakshi Sharma
9ee941eb12 Error out for unsupported dotnet versions for sql db projects (#16428)
* Merge conflict resolution

* Throw error for unsupported versions of Dotnet

* Fix for darwin

* Fix for all platforms

* Address comments

* Fix extensionsGaller.json

* Address comments

* Update default installation path for linux

* Fix test

* Revert default installation location change for Linux

* Address comments

* Removed extra try-catch block
2021-08-06 18:41:34 -07:00
Charles Gagnon
b8da94f9ef Add Create Proj from DB to VS Code context menus (#16584)
* Add Create Proj from DB to VS Code context menus

* Fix error

* add comment

* use constant
2021-08-06 08:59:35 -07:00
Kim Santiago
33baaa475d Insert sql binding into Azure function quick pick (#16553)
* initial quick pick

* move constants

* remove commented code for now

* addressing comments

* update name

* update name in other places

* remove azure functions from name and rename file
2021-08-05 12:11:30 -07:00
Charles Gagnon
2b103a79c3 Add Create Project from Database quickpick (#16572)
* Add Create Project from Database quickpick

* fix test

* pr comments

* Add comment
2021-08-05 10:34:49 -07:00
Alexander Ivanov
b35e78a07f Automatically add intermediate folders for SQL project items. (#16332)
* Automatically add intermediate folders for SQL project items.

While using the SQL database projects through the API, I noticed that project may end up in somewhat inconsistent state, where files will be added to the project, but their parent folders will not. This in turn resulted in failure to remove these folders from project - they will show up in the UI tree, but deleting them will cause an error. In order to align with how Visual Studio manages the projects, this change will ensure that all intermediate folders are present in the project, when new files or folders are added.

While this change improves project "correctness" when accessing it through SQL projects extension APIs, there is still a possibility that someone will open an "incorrect" previously created project. This change does not address it and folder removal may still fail.

* Update the code to never throw on duplicate items when adding files and folders to project.

After a conversation with the sqlproj owners, we agreed that there are no scenarios that would prompt us to throw an error, if duplicate item is being added to the project. Ultimately, the goal of such a request would be to have an item in the project file, which is already present, therefore the call becomes a no-op.

This allowed me to simplify the new code that was ensuring all intermediate folders are present in the project when adding files and folders.
2021-08-03 09:49:11 -07:00
Charles Gagnon
83af84774a Sql Proj VS Code fixes (#16506)
* Sql Proj VS Code fixes

* remove comment
2021-08-01 00:24:28 -07:00
Charles Gagnon
2427cbe3c6 Remove unused commands from vs code sql proj (#16507) 2021-07-30 19:23:40 -07:00
Charles Gagnon
a7c1bcaf93 Fix azdata API check when webpacked (#16505) 2021-07-30 16:06:50 -07:00
Charles Gagnon
1b073c6748 Package VS Code extensions (#16465)
* Package VS Code extensions

* fixes

* Add back in path

* remove extra indents

* Remove extra parens

* try fix
2021-07-29 08:33:46 -07:00
Kim Santiago
f01e9e2fc0 add api to open new project dialog with only one project type with filtered target platforms (#16315) 2021-07-27 10:03:44 -07:00
Charles Gagnon
b2c203eaef Hook up sql proj publish (#16444) 2021-07-27 09:32:42 -07:00
Kim Santiago
ce4fa98691 bump sql database projects version to 0.12.0 (#16401) 2021-07-22 15:53:48 -07:00
Charles Gagnon
0509f8f0c3 Separate connect and listdatabases call for publish (#16391)
* Separate connect and listdatabases call for publish

* add return value
2021-07-22 15:36:16 -07:00
Charles Gagnon
c1f4c50177 Combine project deploy settings into one (#16383) 2021-07-21 16:15:25 -07:00
nasc17
b472539646 Switch withProperties to be withProps (#16380)
* Transition to withProps in arc

* Transition to withProps inputbox

* Transition to withProps in checkbox

* Transition to withProps text

* Transition to withProps in declarative table

* Transition to withProps hyperlink

* Transition to withProps in button

* Transition to withProps radiobutton

* Transition to withProps in input

* Transition to withProps button

* Transition to withProps in text

* Transition to withProps image

* Transition to withProps declare table

* Transition to withProps in table

* Transition to withProps radio button

* Transition to withProps in image

* Transition to withProps radio button

* Transition to withProps in commit

* Transition to withProps div cont

* Transition to withProps in comp

* Transition to withProps radio card

* Transition to withProps in comp icon

* Transition to withProps card

* Transition to withProps list
2021-07-21 11:12:47 -07:00
Charles Gagnon
efa82650f8 List databases for publish quickpick (#16368)
* List databases for publish quickpick

* missed word
2021-07-21 08:36:34 -07:00
Charles Gagnon
a322c5be9d List connections for sql proj publish quickpick (#16233)
* List connections for sql proj publish quickpick

* cleanup
2021-07-20 13:30:32 -07:00
Kim Santiago
5059c94adc Add target platform dropdown to new project dialog (#16091)
* add target platform as an option in create project api

* move constant

* WIP

* show versions in dialog and create project with selected version

* validate version

* add error messages

* add test

* change version to target platform

* cleanup

* more cleanup

* use withProps
2021-07-15 13:43:48 -07:00
Charles Gagnon
d03fbbc066 Read publish profile using DacFX (#16110)
* Read publish profile using DacFX in VS Code

* Fixes

* complete promise on hide

* comment
2021-07-15 08:53:43 -07:00
Kim Santiago
b4ab73a636 bump ADS dependency for sql database projects (#16092) 2021-07-13 11:46:02 -07:00
Kim Santiago
affe3a838b Add target platform as an option in create project api (#16035)
* add target platform as an option in create project api

* add test

* move constant
2021-07-12 15:14:33 -07:00
Kim Santiago
c69c303a2b fix duplicate sqlcmd var header when loading publish profile multiple times (#16007)
* fix duplicate sqlcmd var header when loading publish profile multiple times

* remove variable to keep track of count
2021-07-08 14:37:07 -07:00
Charles Gagnon
922348b846 Add basic structure for publish project quickpick (#16008)
* Add basic structure for publish project quickpick

* fixes

* feedback
2021-07-07 22:00:44 -07:00
Alex Ma
30462dfb25 Webpack Extensions update (#15919)
* test for schemacompare

* added schema compare to package.json

* added arc for translation

* added admin-tool-ext-win

* added agent

* added cms to list of extensions webpacked

* removed dacpac

* added import

* added machine-learning

* removed profiler

* added server-report

* added sql-assessment

* added sql-migration

* added sql-database-projects

* added query-history

* fixed and updated dependencies in extensions for webpacking.

* fixed names of entry

* fixed webpack for machine-learning

* removed dependency external for dacpac

* reduced externals for server-report

* added back import

* removed extension.webpack.config.js

* removed useless handlebars function

* added todo message
2021-07-01 09:56:55 -07:00
Sakshi Sharma
e72ba26411 Bump Sql Db Projects extension version (#15688)
* Bump Sql Db Projects extension

* Bump azdata version for Sql Db projects

* Update package.json

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
2021-06-30 11:03:42 -07:00
Charles Gagnon
7ce791d826 Load all data workspace projects directly from workspace (#15921)
* Load all projects directly from workspace

* fixes

* Remove relativity and fix tests

* fix compile

* PR comments

* remove unused

* distro
2021-06-30 10:58:34 -07:00
Charles Gagnon
3a3d7f5271 withProperties -> withProps (#15876)
* withProperties -> withProps

* Fix errors

* remove ,

* fixes

* Update azdata-test

* Fix dacpac tests

* Add required and remove added layout
2021-06-23 14:26:14 -07:00
Charles Gagnon
4707c1601c Handle no azdata API in sql db proj extension gracefully (#15873)
* Update db proj ext to handle not having azdata API available

* Fixes

* Fix compile
2021-06-22 23:34:01 -07:00
Charles Gagnon
3cb2f552a6 Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898

* Fixes and cleanup

* Distro

* Fix hygiene yarn

* delete no yarn lock changes file

* Fix hygiene

* Fix layer check

* Fix CI

* Skip lib checks

* Remove tests deleted in vs code

* Fix tests

* Distro

* Fix tests and add removed extension point

* Skip failing notebook tests for now

* Disable broken tests and cleanup build folder

* Update yarn.lock and fix smoke tests

* Bump sqlite

* fix contributed actions and file spacing

* Fix user data path

* Update yarn.locks

Co-authored-by: ADS Merger <karlb@microsoft.com>
2021-06-17 08:17:11 -07:00
Charles Gagnon
c9850fe59f Remove en-us from links (#15722) 2021-06-15 11:51:35 -07:00
Sakshi Sharma
bc766698ee Fix create project from database for contained database (#15618) 2021-06-04 11:21:18 -07:00
Kim Santiago
5e62aea5d5 Filter out system dbs from create project from db dialog (#15610)
* filter out system dbs from create project from db dialog

* use includes instead of find
2021-06-02 17:22:28 -07:00
Alexander Ivanov
c6fec97819 Expose default database collation through 'sql-database-projects' extension API (#15538)
* 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.
2021-05-28 12:42:21 -07:00
Kim Santiago
faaf667439 Add DW master.dacpac (#15559)
* add DW master.dacpac

* add missing awaits in tests

* use ternary

* only show master in system db dropdown for dw
2021-05-27 10:03:33 -07:00
Kim Santiago
25352fa39c Fixing a couple database reference dialog bugs (#15523)
* fixing a couple database reference dialog bugs

* update comment
2021-05-25 11:37:13 -07:00
Kim Santiago
6b189be781 update comments and name for clarity (#15504) 2021-05-19 11:03:53 -07:00
Kim Santiago
e0d8b67fe4 bump schema compare and sql db proj versions (#15496) 2021-05-17 13:25:47 -07:00
Benjin Dubishar
7e8dccec82 Add setting to hide netcore installation prompt (#15470)
* Add setting to hide netcore installation prompt

* Shortened strings to fit toast

* Updating data workspace string for consistency
2021-05-17 09:59:08 -07:00
Kim Santiago
99fd1fbb5e fix typo in .net core message (#15410) 2021-05-11 13:27:19 -07:00
Alexander Ivanov
676296fbbb Allow to ignore duplicate entires when adding files to SQL project. (#15332)
This change introduces new boolean flag for `addToProject`, `addScriptItem` and `addFolderItem` APIs that allows to skip files/folders if they are already included in the project file. Original behavior was to throw an error if duplicate entry is encountered, so I kept that as a default (new flag is not set).

I started by fixing the original behavior, as it was not always working as expected. In our extension that relies on `addToProject` API we've hit an issue where duplicate items were added and no errors were thrown. There was a test for this scenario, but unfortunately the test had few bugs in it as well, so I addressed that first. First issue with the test code was missing `await` on the `testUtils.shouldThrowSpecificError` calls, so test was not actually testing anything. After adding missing keywords, I hit an issue where exception was not thrown, but this turned out to be different issue, compared to what we were hitting. In the test code, it was using the very first folder from the generate list of test entires. This folder wass actually the root of the project (where sqlproj file is located), and `addToProject` API had a special case to ignore the root. This means neither first call nor second call was actually adding anything to the project and no errors were produced. I fixed this problem by using next available folder in the generated files list.

After addressing the test code I could not reproduce the issue that we were seeing with duplicate entires being added, everything was working as expected and errors were thrown. I started adding more tests that better resemble our production scenario - add files in subfolders, add files to existing project, rather than a new one. Finally I was able to reproduce the problem in tests when adding a file in a subfolder to an existing project. After investigation this turned out to be an issue with mismatch in how `relativePath` is maintained within the `FileProjectEntry`. When loading an existing project, `relativePath` is populated based on the value of the `Include` attribute of the `Build` item. This attribute is normalized to Windows-style path, using `\`, so for nested file you will have `folder\file.sql`. When adding new item to the project, one could pass either Windows or Unix-style path (`folder/file.sql`), so the path comparison between loaded Windows-style path and newly added Unix-style path was failing, resulting in them being treated as different items. In fact, `addToProject` API that we were using was relying on `Uri` helpers to extract relative path, thus the path was forced to be Unix-style and path was never the same as the loaded one. After this discovery I added a dedicated test to validate the round-trip of the `relativePath` for serialized and desirialized project file.

In order to address this problem, I updated the factory method `createFileProjectEntry` to always run `utils.convertSlashesForSqlProj` on the relative path to ensure we have Windows-style path stored in there. I also optimized the helper code slightly to not do split/join, if there are no split points in the input string, which should eliminate unnecessary array instantiation. It is worth mentioning that I had to normalize the input relative paths in the `addScriptItem` and `addFolderItem` APIs, because there is no guarantee that they will be Windows-style when we try to compare them to `relativePath` of the existing project items.

Finally I was able to add a simply flag and update the condition to return existing record, if duplicates were allowed. I also updated typings file for the extension and added tests to cover this scenario.
2021-05-10 13:59:24 -07:00