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

ci: add custom check to run dependency checks #1227

Closed
petermetz opened this issue Aug 16, 2021 · 1 comment
Closed

ci: add custom check to run dependency checks #1227

petermetz opened this issue Aug 16, 2021 · 1 comment
Assignees
Labels
dependencies Pull requests that update a dependency file
Milestone

Comments

@petermetz
Copy link
Contributor

petermetz commented Aug 16, 2021

Description

If someone is using a dependency in one of the packages and forgets to declare said dependency in the package.json file of that package then the build should detect this and fail accordingly.

The main entrypoint for the custom checks is this file:
./tools/custom-checks/run-custom-checks.ts

Acceptance Criteria

  1. All of the packages are covered in a way that new packages added in the future are also included as they come (e.g. do not hardcode a list of packages to check only the patterns to find them)
  2. The missing packages and the unused ones need to be clearly mentioned in the error messages so that it's trivial to fix the problems highlighted
  3. The CI runs the checks for every pull request
  4. Dev dependencies are ignored, @types/* are ignored

Hint:

npx dependency-check ./packages/cactus-cmd-api-server/package.json \
   --entry ./packages/cactus-cmd-api-server/dist/lib/main/typescript/index.web.js \
   --entry ./packages/cactus-cmd-api-server/dist/lib/main/typescript/index.js \
   --no-dev \
   --ignore-module "@types/*" 
@petermetz petermetz added the dependencies Pull requests that update a dependency file label Aug 16, 2021
@petermetz petermetz added this to the v0.8.0 milestone Aug 16, 2021
@petermetz petermetz self-assigned this Aug 16, 2021
@petermetz petermetz modified the milestones: v0.8.0, v0.9.0 Aug 17, 2021
@petermetz petermetz assigned AzaharaC and unassigned petermetz Aug 30, 2021
@petermetz petermetz modified the milestones: v0.9.0, v0.10.0 Sep 2, 2021
@petermetz
Copy link
Contributor Author

This was implemented as a side-effect of https://github.com/hyperledger/cacti/pull/1475
(the yarn v3 migration)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants