-
Notifications
You must be signed in to change notification settings - Fork 285
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
build: codegen to call clean on a per pkg basis #2818
build: codegen to call clean on a per pkg basis #2818
Conversation
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.
@jagpreetsinghsasan Huge diff, I might need to take multiple passes on reviewing this, apologies in advance. Quick findings on the first pass that I'd like to ask if you could maybe change up:
- The
tools/clear-openapi-codegen-folders.js
script is not formatted (Prettier/ESLint) - Withing the logic of
tools/clear-openapi-codegen-folders.js
:
2.1. There is a brittleness in it in terms of having the directory depth hard-coded in the globs. Instead of the patterns you have right now, I would pull the list of package directories straight from lerna.json and then do something likesrc/main/**/generated/
or similar (I'm making this as I go so it most likely need tweaks). My reasoning is that there were already multiple proposals for us to completely revamp the monorepo package directory structure from flat to hierarchical (tree structure) which would mean that the packages would no longer be at a fixed 2 deep from the project root. So if/when that change takes place, the current globs will break because it doesn't start from the package dir globs defined in lerna.json - If we no longer use the localized openapi-generator-ignore files (see all of them were reverted back to the default spat out by the generator) then we should just 1) delete them AND 2) ignore them in the centralized openapi-generator-ignore file that we have in the root, so that the package specific ignore files won't even get generated. This (in my opinion) would make it less confusing because there is no ignore file that isn't being used (meaning that the package local ignore files are being ignored but their existence would imply otherwise to begin with)
- There are merge conflicts and for some reason not just in the yarn.lock file like the GitHub UI is suggesting; when I tried to rebase this to upstream/main it ran into hundreds of files being conflicted for some reason.
@petermetz all good suggestions! |
1c71bd5
to
7689ebb
Compare
|
7689ebb
to
673b38c
Compare
@jagpreetsinghsasan Sorry for the slow response! Please re-request review next time!
What's wrong with ignoring the ignore files in the root ignore file like I just did on my local branch of your PR (see below)?
Thank you for that as well! |
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.
@jagpreetsinghsasan Please see my comment above^^
673b38c
to
be9e82e
Compare
@petermetz , yes I was able to do it this way (It would have worked earlier too when I was trying, its just that the default globby options were not removing any files or folder with dot as the starting character ex |
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.
@jagpreetsinghsasan Nice, thank you very much for the updates! LGTM
be9e82e
to
a30ab60
Compare
Primary Changes --------------- 1. Updated codegen scripts of all affected packages to include a global openapi-generator-ignore file 2. Created script to clean openapi folders generated by codegen for typescript-axios and kotlin Secondary Changes ----------------- 1. Removed duplicated code generated previously when codegen clear wasn't enabled 2. Created openapi-generator-ignore file at project root for global ignore rules 3. Updated package.json of all affected packages, extensions and examples Peter's Additional Changes -------------------------- 1. The sawtooth connector's package.json's codegen script had to also be updated so that it uses the central ignore file from the root 2. yarn.lock update (because it's out of date on the main branch) Fixes hyperledger-cacti#2736 Co-authored-by: Peter Somogyvari <[email protected]> Signed-off-by: jagpreetsinghsasan <[email protected]> Signed-off-by: Peter Somogyvari <[email protected]>
a30ab60
to
6a0d479
Compare
Commit to be reviewed
build: codegen to call clean on a per pkg basis
Fixes #2736
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.