-
Notifications
You must be signed in to change notification settings - Fork 6
PART 2: Generate events using jsonschema2pojo and mustache template #60
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
Conversation
Co-authored-by: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com>
Co-authored-by: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Co-authored-by: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Co-authored-by: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> update CDEventsGenerator file Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> update CDEventsGenerator file Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> Update phase for CDEventsGenerator main class Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> adding missing file to repo Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> Update src/main/java/dev/cdevents/CDEventsGenerator.java Co-authored-by: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> Update src/main/java/dev/cdevents/CDEventsGenerator.java Co-authored-by: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> update with review comments and some linter issues Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> fix linter issues Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> updating linter.yml Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> fix linter issues with MagicNumber Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> fix linter issues with MagicNumber Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> lint exclude list in array path Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> update FILTER_REGEX_EXCLUDE pattern Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> update MaginNumners with constants Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> ignoreFieldDeclaration for MagicNumber check-style Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> cleanup existing/manual events to keep only gererated events Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> Refacoring the code to use maven submodules for generator and sdk Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> fix minor lint issue Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech> updating release files as per comment Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
@afrittoli can you please review theses changes when you get some time. Thank you. |
@@ -84,10 +85,12 @@ | |||
</goals> | |||
<configuration> | |||
<sourcePaths> | |||
<sourcePath>${sdk.project.dir}/src/main/resources/schema/artifact-packaged-event.json | |||
</sourcePath> | |||
<sourcePath>${parent.project.dir}/spec/schemas/artifactpackaged.json</sourcePath> |
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.
The only slight issue I see with this approach is that new events will have to be added manually to this config.
It actually may be a positive thing to have a static configuration, but perhaps we should have some kind of check in place that verifies that a class has been generated for every schema available.
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.
Ok, I will create a separate issue to verify the number of generated files from schemas with unit testing.
</sourcePaths> | ||
<outputDirectory>${sdk.project.dir}/src/main/java</outputDirectory> |
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.
This is a bit long to properly review manually, did you generate it with a script, or do you have a script to verify its correctness?
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.
This file is created manually, but I can add a test to verify the number of generated files from schemas
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.
Nice, pointing to v0.1.2 for now! +1
} else { | ||
log.error("No schema files found in the specified directory {}", folder.getAbsolutePath()); | ||
} | ||
} else { | ||
log.error("No schema directory found in the specified directory {}", folder.getAbsolutePath()); |
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.
For automation purposes, it would be nice if the tool accumulated the various errors and failed at the end, rather than only logging errors.
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.
Thanks @rjalander - I left a couple of comments, but nothing blocking - perhaps we can iterate on this in another PR.
I did not review the pom.xml in details, let me know if you need to me to do that or if you have some script to verify it.
Could you squash the commits into a few ones (or one) before merging please?
🎉 This issue has been resolved in |
Continuation of the PR #58 to generate all other events using the mustache template,
Generating all events from schema repo