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

chore(cacti): use lerna 8.1 instead of lerna lite #3369

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions epics/2024-06-ci-refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# CI Build and Test Refactoring

This epic builds on the proof of concept here: https://github.com/hyperledger/cacti/pull/3348

Intention is to refactor the cacti ci scripts to push logic from ci jobs to commonly defined targets in the base packages, to simplify ci logic and minimize changes to ci when new packages are introduced. These targets may be, for instance:

- test
- build:docker

### Task Breakdown
- [x] Switch from lerna-lite to lerna 8.1 to take advantage of the lerna --since syntax, which unlike 'lerna-lite changed', can use git to compute changed packages. This allows ci to easily identify cascading changes.
- [ ] Programatically refactor ci.yaml:
- [ ] Parse and output ci.yaml with no changes to prepare for programatic changes
- [ ] Add test targets to individual package.json files to run jest and tape tests
- [ ] Add build:docker targets to individual package:json files for scanning in ci
- [ ] Add test:long target (or custom variable?) to individual packages which returns the name of long tests which must be run as individual jobs in ci
- [ ] Integrate weaver packages (TBD)
- [ ] Add package.json and nx.json files to the weaver fabric go SDK so file changes are visible to lerna
- [ ] Expose weaver tests in ci as packages/cacti-test packages

1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
],
"version": "2.0.0-rc.3",
"npmClient": "yarn",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it the case that with lerna we do not need this configuration option (as vs lerna lite)?

Copy link
Contributor

Choose a reason for hiding this comment

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

@RafaelAPB Good question, I'm not sure TBH. It could be that lerna ignores this option, but I didn't look up their docs. Maybe @jenniferlianne knows.

"useWorkspaces": "true",
"command": {
"version": {
"message": "chore(release): publish"
Expand Down
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"reset:git": "git clean -f -X",
"reset:yarn-lock": "yarn run init-registries && yarn install --update-checksums --force",
"reset": "run-s reset:git reset:node-modules reset:yarn-lock configure",
"configure": "npm run init-registries && yarn install && yarn build:dev:backend",
"configure": "npm run init-registries && NODE_OPTIONS=\"--max_old_space_size=3072\" yarn install && yarn build:dev:backend",
"set-yarn-version": "yarn set version stable",
"enable-corepack": "npm i -g corepack && corepack enable && corepack prepare yarn@4.3.1 --activate",
"custom-checks": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/custom-checks/run-custom-checks.ts",
Expand Down Expand Up @@ -129,12 +129,6 @@
"@commitlint/config-conventional": "17.7.0",
"@connectrpc/connect": "1.4.0",
"@connectrpc/protoc-gen-connect-es": "1.4.0",
"@lerna-lite/cli": "3.7.0",
"@lerna-lite/exec": "3.7.0",
"@lerna-lite/list": "3.7.0",
"@lerna-lite/publish": "3.7.0",
"@lerna-lite/run": "3.7.0",
"@lerna-lite/version": "3.7.0",
"@openapitools/openapi-generator-cli": "2.7.0",
"@redocly/openapi-core": "1.15.0",
"@types/adm-zip": "0.5.0",
Expand Down Expand Up @@ -311,5 +305,8 @@
"built": false
}
},
"packageManager": "yarn@4.3.1"
"packageManager": "yarn@4.3.1",
"dependencies": {
"lerna": "^8.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

@jenniferlianne One more thing I just notced: Please put this under devDependencies. It doesn't really matter which one it is since all dependencies are dev dependencies in the root package.json anyway but still it's much better to have them organized into a single section.

One more thing: Please pin it to an exact version, auto-upgrades open us up to nasty software-supply-chain attacks.

}
}
Loading
Loading