-
Notifications
You must be signed in to change notification settings - Fork 295
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(plugins): unify package json fields #3714
base: main
Are you sure you want to change the base?
Conversation
@petermetz As mentioned in the commit messasge, this is part of #3670 where I plan to add common package json fields check. I've followed your recommendation to use Joi, please have a look at proposed schema and let me know if you'd like to change / add anything to it. I also have the following questions:
@VattiPraveen @sandeepnRES I've added... "publishConfig": {
"access": "public"
}, ... to your package.json files in weaver, is that OK? I think that was required by @petermetz at least for cacti-native packages at some point (if I recall correctly), but I'm not sure if it doesn't affect weaver release process in any substantial way. I don't think it should, but please confirm it before the merge so I don't mess up your build by accident. |
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.
LGTM
@petermetz when are we planning to change the package names themselves? (from cactus-cmd-api-server to cacti-cmd-api-server...)
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.
@outSH Very sorry for the slow response and review! LGTM overall but I'm omitting the approval because Jagpreet already approved it from our organization.
To answer the specific questions:
- If you could parse it out of either the lerna.json or root package.json I would be forever grateful. That way it's completely on auto-pilot instead of having any manual steps at all. I really appreciate the consideration for the reduction of manual release steps, thank you very much for checking in about this! A good example of how easy it can be to pull the version data from lerna.json is shown in this file:
tools/custom-checks/check-package-json-sort.ts
where I do an import like this:
import lernaCfg from "../../lerna.json" assert { type: "json" };
- I would say enforce for all packages that are set to public that are in the scope of the lerna/yarn workspace. So in other words, if the array of blogs in lerna.json matches a package then it should be checked by the CI for it to be set to public.
Currently the array of glob looks like this so both the test package you mentioned, the example/* packages and the weaver packages are captured by it and therefore my ask would be to check all of them for ensuring that it is set to public:
"packages": [
"packages/cactus-*",
"examples/cactus-*",
"extensions/cactus-*",
"packages/cacti-*",
"examples/cacti-*",
"extensions/cacti-*",
"weaver/common/protos-js",
"weaver/sdks/fabric/interoperation-node-sdk",
"weaver/sdks/besu/node",
"weaver/core/drivers/fabric-driver",
"weaver/core/identity-management/iin-agent",
"weaver/samples/fabric/fabric-cli",
"weaver/samples/besu/besu-cli",
"weaver/samples/besu/simpleasset",
"weaver/samples/besu/simplestate"
],
If someone really wants to have their package private then they should remove it from the lerna.json glob array so that the release process doesn't crash due to us trying to release a private package. (but then they are also excluded from all script executions and other CI checks so to be honest I would advocate strongly against this workaround and instead just considering that all of the code is out on the internet anyway so what's the point of having a private setting in the publish config)
Overall, thank you again, this is an awesome improvement to the CI!
@jagpreetsinghsasan As soon as possible. My plan is to stabilize the release automation first just so that we have the ability to reliably and with low effort issue patch and minor releases for all the packages. |
@outSH Not sure but I'm guessing you wanted to cc @VRamakrishna and @sandeepnRES there. |
ae68fa4
to
36ce72d
Compare
@petermetz Thanks for the info! I've changed all packages from lerna to public as suggested, the CI will enforce it as well. @VRamakrishna and @sandeepnRES Please review and respond to my previous concern, that is:
|
- Unify common fields among all cacti plugin package.json files. - Use Cacti instead of Cactus whenever possible. - Use current github URL and mailing list addresses. - Add publishConfig access public to all packages. Prerequisite for hyperledger-cacti#3670 where I plan adding a CI check that will assert that all package.json files are correct. Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
36ce72d
to
d0bd21b
Compare
Fixes #3666 |
Prerequisite for #3670 where I plan adding a CI check that will assert that all package.json files are correct.
I'm using the following Joi schema as our standard:
Pull Request Requirements
upstream/main
branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.-s
flag when usinggit commit
command. You may refer to this link for more information.Character Limit
A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.