Skip to content

feat: metadata for graal VM config#7429

Merged
manusa merged 9 commits into
fabric8io:mainfrom
ash-thakur-rh:graal/feat-metadata-creation
May 25, 2026
Merged

feat: metadata for graal VM config#7429
manusa merged 9 commits into
fabric8io:mainfrom
ash-thakur-rh:graal/feat-metadata-creation

Conversation

@ash-thakur-rh
Copy link
Copy Markdown
Member

@ash-thakur-rh ash-thakur-rh commented Feb 9, 2026

Description

Refs #5084

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@ash-thakur-rh ash-thakur-rh changed the title feat: create metadata generator plugin feat: metadata for graal VM config Feb 9, 2026
@ash-thakur-rh ash-thakur-rh marked this pull request as ready for review February 16, 2026 09:02
@ash-thakur-rh ash-thakur-rh force-pushed the graal/feat-metadata-creation branch from 4c4f765 to 932f105 Compare February 16, 2026 09:33
Copy link
Copy Markdown
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

Looking good, thx.
I don't think you need to do the convoluted call from one script to another, just extract the required method so that it can be called from either.
Then, in the wrapper, you can actually use JBang's //SOURCE annotation to create the dependency and import for the other class.
You can find an example of this at:
https://github.com/marcnuri-demo/blog-tutorials/blob/11ac44f167581f07e11d49d7e0192dfcbee71915/java-virtual-threads-project-loom-complete-guide/Test.java#L4-L9

Also, I'm not sure if we should add a Makefile target for this, the Makefile could easily check too if JBang is available and spit an error in case it isn't.

@ash-thakur-rh ash-thakur-rh requested a review from manusa May 8, 2026 08:32
- Refuse to write outside the module's target/classes when the
  auto-derived output path falls outside it (e.g. an artifactId in
  pom.xml containing path-traversal segments).
- Fail fast when artifactId can't be extracted from pom.xml instead of
  silently falling back to the hardcoded "kubernetes-client" path,
  which would corrupt the core module's metadata when merging.
- Switch the KUBERNETES_RESOURCES strategy from HasMetadata to
  KubernetesResource so Spec/Status/nested model classes (PodSpec,
  ObjectMeta, EnvVar, ...) are picked up. On kubernetes-model-core
  this raises the count from 19 to 295 classes.
- Replace the brittle pattern-to-regex translation (only escaped '.'
  and '*') with a proper glob translator that escapes every regex
  metacharacter, so include/exclude patterns containing '[', '+',
  '(', etc. no longer throw PatternSyntaxException at runtime.
- Replace System.exit(1) on unknown options with
  IllegalArgumentException so callers using //SOURCES (e.g. the batch
  wrapper) aren't terminated.
- Distinguish "wrote a file" from "no classes matched" in
  generate()'s return value (new Result enum) so the wrapper's
  summary doesn't claim success when nothing was written.

Signed-off-by: Marc Nuri <marc@marcnuri.com>
@manusa
Copy link
Copy Markdown
Member

manusa commented May 8, 2026

@ash-thakur-rh I went through the two scripts and put together a small PR against your branch with a handful of suggested fixes — feel free to take it as-is, cherry-pick, or use it as a reference and apply your own version:

👉 ash-thakur-rh#3

Six changes on the two scripts only (zero CHANGELOG / pom touches). Each one has the reasoning inline so you can see why before deciding. Once whatever subset you're happy with lands on your branch, this PR is ready for another pass.

@manusa manusa added this to the 7.8.0 milestone May 25, 2026 — with automated-tasks
Copy link
Copy Markdown
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

@manusa manusa merged commit 622b66d into fabric8io:main May 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants