-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add --update
option to tsp-client compare
#9608
Conversation
@@ -52,7 +52,7 @@ | |||
"dependencies": { | |||
"@autorest/core": "^3.10.2", | |||
"@autorest/openapi-to-typespec": "0.10.5", | |||
"@azure-tools/rest-api-diff": ">=0.1.0 <1.0.0", | |||
"@azure-tools/rest-api-diff": "^0.1.8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we had to explicitly specify the range so that minor version updates are allowed, since this package doesnt have a major version yet. If you want to specify a min version you could do:
"@azure-tools/rest-api-diff": "^0.1.8", | |
"@azure-tools/rest-api-diff": ">=0.1.8 <1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the tool has a major version we should be able to simplify this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I didn't actually manually change this file... Hmm.... I wonder if this command did.... Need to check that.
Logger.error(`Error occurred while attempting to compare: ${err}`); | ||
process.exit(1); | ||
if (argv["update"]) { | ||
execSync(`npm install @azure-tools/rest-api-diff@latest`, { stdio: "inherit" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were just discussing this with @mikeharder in this other PR: #9602. I dont think we need to have this functionality in tsp-client. It seems if a user is at the point of knowing that they need to update the package version then they should simply run the npm update command directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be as simple as updating your output message to be the following:
This tool is under active development. If you experience issues or have questions, please contact Travis Prescott direct
ly (trpresco@microsoft.com). [Tool version: 0.1.8]
Run npm update @azure-tools/rest-api-diff
to update @azure-tools/rest-api-diff to the latest version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe npm update @azure-tools/rest-api-diff@latest
should work as well to be very explicit but if it doesnt then npm install should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the problem is from what folks have told me, running npm update doesn't actually work. It still uses the original internal version that tsp-client originally pulled down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have had issues with npm update myself...maybe just recommending npm install, the same as the command you're wrapping under this command would be better?
Fixes #9498.
This PR adds a hidden
--update
flag totsp-client compare
to allow for easily updating the wrapped version of@azure-tools/rest-api-diff
in-place without having to uninstall and reinstalltsp-client
. Because the option is hidden, the command will always end with a message describing the ability to update the command.This tool is under active development. If you experience issues or have questions, please contact Travis Prescott direct
ly (trpresco@microsoft.com). [Tool version: 0.1.8]
Use
tsp-client compare --update
to update @azure-tools/rest-api-diff to the latest versionTODO