-
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 and do so on a per package basis #2736
Comments
@petermetz for the Like in case of java codegen, I used this inline argument to prevent timestamp comments (to prevent git diff pollution everytime codegen is run): |
@jagpreetsinghsasan Niceee, this could be a good alternative later to match/replace the clean script ignoring the ignore files. |
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 Fixes hyperledger-cacti#2736 Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
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 Fixes hyperledger-cacti#2736 Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
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 Fixes hyperledger-cacti#2736 Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
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 Fixes hyperledger-cacti#2736 Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
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 Fixes hyperledger-cacti#2736 Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
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 <peter.somogyvari@accenture.com> Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com> Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
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 <peter.somogyvari@accenture.com> Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com> Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
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 #2736 Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com> Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com> Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
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 <peter.somogyvari@accenture.com> Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com> Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Description
This is a follow-up with a longer term solution to the short term fix that we applied in #2730 for the same problem that the referenced issue is about (which could and will prop up again in the future in a different form for sure)
For the future: The current solution is kind-of lackluster, we have this giant npm script cleaning out a long list of directories and it is separate from the codegen script so the contributors are responsible for running both. A better long term solution would be to make sure that the codegen script calls the clean automatically before it starts generating the new code so that this situation we were in just now is impossible to happen (otherwise it will keep happening for sure)
Historically I've shied away from doing the above because we have some packages that have code generation that is not fully automated (the rust crates need a lot of customization that is manual IIRC) but if we do it right, it could be done right for most of the packages.
Acceptance Criteria
codegen
script works and it does NOT create any changes in the diff after repeated runs on the same code (assuming you've committed the changes after the first run).clean
script is refactored so that it calls the package's owncodegen:clean
script which is responsible for the package's generated code to be cleaned out and also for excluding files that do not need to be cleaned out such as theopenapi-generator-ignore
filesopenapi-generator-ignore
files are not deletedcc: @jagpreetsinghsasan
The text was updated successfully, but these errors were encountered: