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

sqlpackage path argument, dotnet tool sqlpackage #221

Merged
merged 19 commits into from
Jun 28, 2024

Conversation

dzsquared
Copy link
Collaborator

@dzsquared dzsquared commented May 13, 2024

3 changes lumped together in this PR (I let it get away from me):

  1. for dacpac and sqlproj action there's an optional action parameter sqlpackage-path which overrides any sqlpackage location detection by the action except to check that it exists. (fixes Support SqlPackage.exe at a specific path #211)
  2. dotnet tool location for a global install of sqlpackage is checked
  3. the full semantic version is parsed for version comparison, instead of just 150 vs 160, which was leading to the wrong version being picked (162.1 vs 162.2 would default to one based on who installed instead of the actual version)

also fixes #180

future PR needed to remove SSMS-related logic as it hasn't installed sqlpackage.exe for quite some time

@dzsquared dzsquared temporarily deployed to Automation test May 13, 2024 19:21 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test May 13, 2024 19:21 — with GitHub Actions Inactive
@dzsquared dzsquared marked this pull request as draft May 13, 2024 19:33
@dzsquared dzsquared temporarily deployed to Automation test May 14, 2024 20:27 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test May 14, 2024 20:27 — with GitHub Actions Inactive
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jun 4, 2024

This PR is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Jun 4, 2024
@dzsquared dzsquared temporarily deployed to Automation test June 13, 2024 18:52 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 13, 2024 18:52 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 14, 2024 16:33 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 14, 2024 16:33 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 14, 2024 18:12 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 14, 2024 18:12 — with GitHub Actions Inactive
@zijchen zijchen temporarily deployed to Automation test June 14, 2024 19:22 — with GitHub Actions Inactive
@zijchen zijchen temporarily deployed to Automation test June 14, 2024 19:22 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 14, 2024 23:00 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 16, 2024 20:15 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 16, 2024 20:15 — with GitHub Actions Inactive
@dzsquared dzsquared marked this pull request as ready for review June 16, 2024 20:18
@dzsquared dzsquared requested a review from zijchen June 17, 2024 18:03
zijchen
zijchen previously approved these changes Jun 19, 2024
__tests__/AzureSqlActionHelper.test.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
core.debug('Getting location of SqlPackage');

let sqlPackagePathInstalledWithDotnetTool = await this._getSqlPackageExeInstalledDotnetTool();
core.debug(`SqlPackage (installed with dotnet tool) found at location: ${sqlPackagePathInstalledWithDotnetTool[0]}, version ${sqlPackagePathInstalledWithDotnetTool[1]}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not really following this debug logic, and this could be confusing to customers - shouldn't we only say that sqlpackage was found if it was actually found (and instead, output a different message if it weren't found)?

core.debug('Getting location of SqlPackage');

let sqlPackagePathInstalledWithDotnetTool = await this._getSqlPackageExeInstalledDotnetTool();
core.debug(`SqlPackage (installed with dotnet tool) found at location: ${sqlPackagePathInstalledWithDotnetTool[0]}, version ${sqlPackagePathInstalledWithDotnetTool[1]}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is me being picky, but I much prefer an interface to be returned here instead of an array of a string + semver to prevent array lookups in various places

let globalDotnetToolsPath = path.join(process.env['USERPROFILE'] as string, '.dotnet', 'tools');
let sqlPackagePath = path.join(globalDotnetToolsPath, 'SqlPackage.exe');
if (fs.existsSync(sqlPackagePath)) {
core.debug(`SqlPackage (installed with dotnet tool) found at location: ${sqlPackagePath}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there going to be double debug statements (due to debug statements also existing in _getSqlPackageExecutablePath)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, that would have been too noisy - thanks - cleaned up and moved all positive case debug messages to the specific functions

src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
src/AzureSqlActionHelper.ts Outdated Show resolved Hide resolved
@dzsquared dzsquared temporarily deployed to Automation test June 28, 2024 19:07 — with GitHub Actions Inactive
@dzsquared dzsquared temporarily deployed to Automation test June 28, 2024 19:07 — with GitHub Actions Inactive
Copy link
Contributor

@chlafreniere chlafreniere left a comment

Choose a reason for hiding this comment

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

Looks great, thanks so much for being receptive to comments/suggestions 😄!

@dzsquared dzsquared merged commit 83d6b65 into master Jun 28, 2024
6 checks passed
@dzsquared dzsquared deleted the drskwier/dotnet-tool branch June 28, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle Inactive for 14 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support SqlPackage.exe at a specific path SSDT error while deploying it from GitHub self hosted runner
3 participants