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

fix(build): build executables with correct dependency versions #654

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

padamstx
Copy link
Member

@padamstx padamstx commented Mar 22, 2024

PR summary

This commit modifies the create-binaries.sh script so that it removes the packages/validator/node_moduels/@IBM-Cloud directory prior to invoking pkg to build the executables.
This fixes a problem where the executables would end up with the "old" version of the openapi-ruleset dependency in situations where we're also publishing a new version of that dependency. Removing the dependency from packages/validator/node_modules means that pkg would end up using the dependencies in the project's top-level "node_modules" directory instead, which will have the correct version of the dependency.

PR Checklist

General checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Dependencies have been updated as needed
  • .secrets.baseline updated as needed?

Checklist for adding a new validation rule:

  • Added new validation rule definition (packages/ruleset/src/rules/*.js, index.js)
  • If necessary, added new validation rule implementation (packages/ruleset/src/functions/*.js, updated index.js)
  • Added new rule to default configuration (packages/ruleset/src/ibm-oas.js)
  • Added tests for new rule (packages/ruleset/test/*.test.js)
  • Added docs for new rule (docs/ibm-cloud-rules.md)

@padamstx padamstx self-assigned this Mar 22, 2024
@@ -22,18 +22,18 @@
},
"dependencies": {
"@ibm-cloud/openapi-ruleset-utilities": "1.3.1",
"@stoplight/spectral-formats": "^1.5.0",
"@stoplight/spectral-formats": "^1.6.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Seemed like a good time to bump some of our dependencies. This addressed the "ip"-related vulnerability that npm install was reporting.

Copy link
Member

@dpopp07 dpopp07 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

This commit modifies the create-binaries.sh script so that it
removes the packages/validator/node_modules/@IBM-Cloud and
packages/ruleset/node_modules/@IBM-Cloud directories
prior to invoking pkg to build the executables.
This fixes a problem where the executables would end up with
the "old" versions of the openapi-ruleset and
openapi-ruleset-utilities dependencies in situations
where we're also publishing a new version of those dependencies
in the same build.
Removing the dependencies from packages/[validator,ruleset] means
that pkg would end up using the dependencies in the project's
top-level "node_modules" directory instead, which will have the correct
versions of the dependencies, whether or not we've published a new
version of them during the same build.

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
@@ -50,9 +50,6 @@
"node": ">=16.0.0",
"npm": ">=8.3.0"
},
"pkg": {
Copy link
Member Author

Choose a reason for hiding this comment

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

This change gets rid of the warnings that are displayed by "pkg".

@padamstx padamstx merged commit 7b8192d into main Mar 22, 2024
3 checks passed
@padamstx padamstx deleted the fix-executables branch March 22, 2024 15:57
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.3.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.15.5 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

ibm-devx-sdk pushed a commit that referenced this pull request Mar 22, 2024
## ibm-openapi-validator [1.16.5](https://github.com/IBM/openapi-validator/compare/ibm-openapi-validator@1.16.4...ibm-openapi-validator@1.16.5) (2024-03-22)

### Bug Fixes

* **build:** build executables with correct dependency versions ([#654](#654)) ([7b8192d](7b8192d))

### Dependencies

* **@ibm-cloud/openapi-ruleset:** upgraded to 1.15.5
ibm-devx-sdk pushed a commit that referenced this pull request Mar 22, 2024
## @ibm-cloud/openapi-ruleset-utilities [1.3.2](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset-utilities@1.3.1...@ibm-cloud/openapi-ruleset-utilities@1.3.2) (2024-03-22)

### Bug Fixes

* **build:** build executables with correct dependency versions ([#654](#654)) ([7b8192d](7b8192d))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.16.5 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

ibm-devx-sdk pushed a commit that referenced this pull request Mar 22, 2024
## @ibm-cloud/openapi-ruleset [1.15.5](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset@1.15.4...@ibm-cloud/openapi-ruleset@1.15.5) (2024-03-22)

### Bug Fixes

* **build:** build executables with correct dependency versions ([#654](#654)) ([7b8192d](7b8192d))

### Dependencies

* **@ibm-cloud/openapi-ruleset-utilities:** upgraded to 1.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants