-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Linter should check for SDK_VERSION in code and package.json #15643
Comments
cc @ramya-rao-a |
Thanks @YoDaMa @deyaaeldeen Do we have any checks like this today? If not, can you share some details we can go about doing this? |
Hey @YoDaMa The bot can increment the Regarding lint checking versions, we do not have a check for version consistency between package.json and src/constants.ts. In order to make such a check, we need to parse package.json as a JS object and pass it (or just the version bit) to a new rule that checks |
I was thinking more of making sure the linter checks for the constants entry in the metadata entry in the package.json file |
In the latest version of the code generator, we will be forming the user agent string in the generated code and there would be no need to have a separate SDK_VERSION defined in the convenience layer. See #15777 for example. So this issue would no longer be applicable. Closing. |
The automated PR for incrementing version number after release. For the
@azure/iot-modelsrepository
package, I created a test that would validate that the version number in package.json incremented in lockstep with the version number in my contants. Because the automated PR only updates package.json, this PR will fail and cause problems. See:#15464
The problem is in the modelsrepository code I did not define the constant SDK_VERSION and it was not declared in the package.json file. The linter should catch this and raise an error, since this is the proper way to define the SDK_VERSION for constants.
The text was updated successfully, but these errors were encountered: