Skip to content

Conversation

@maybeec
Copy link
Member

@maybeec maybeec commented Dec 15, 2025

This PR fixes issue #1644 where pip was not working in the GraalVM native-image due to missing reflection configuration.

Changes

Core Fix

  • reflect-config.json: Added missing reflection entries for:
    • PypiJsonObject (pip JSON response model)
    • GithubTag (GitHub API tag model)
    • GithubTags (GitHub API tags list model)

Automated Validation

  • GraalVmReflectionConfigTest: New test class that:
    • Scans classpath for all JSON model classes (implementing JsonObject or JsonVersionItem)
    • Validates they're registered in reflect-config.json
    • Provides helpful error messages with copy-paste JSON snippets when missing entries detected
    • Uses vanilla Java (no external dependencies) for classpath scanning
    • Handles Windows path formatting correctly

Documentation Updates

  • graalvm-build-guide.adoc: Added Section 4 "Reflection Configuration" covering:
    • Automated validation workflow
    • Adding new JSON API tools
    • Manual registration guide
    • Common error troubleshooting
  • DoD.adoc: Added checklist requirement for JSON API tools to validate reflection config
  • IDEasy-contribution-getting-started.adoc: Added "JSON Deserialization and GraalVM" subsection explaining the validation workflow

Testing

  • mvn test -Dtest=GraalVmReflectionConfigTest passes ✅
  • Test initially detected missing PypiJsonObject (TDD red phase)
  • After adding reflection entries, test passes (TDD green phase)

DoD Checklist

  • Code follows coding conventions (no star imports, proper JavaDoc, CamelCase)
  • Added automated test (GraalVmReflectionConfigTest)
  • Documentation updated (graalvm-build-guide, DoD, contribution guide)
  • JSON model classes registered in reflect-config.json
  • Test validates future JSON classes automatically

Closes #1644

@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Dec 15, 2025
@maybeec maybeec added bugfix PR that fixes a bug issue pip Python package manager (Pip Installs Packages) labels Dec 15, 2025
@maybeec maybeec requested a review from hohwille December 15, 2025 12:00
@maybeec
Copy link
Member Author

maybeec commented Dec 15, 2025

spottet by the test that GitHub tool might also not work, thus fixed it directly as well.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 20231365932

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.09%) to 70.23%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%
Totals Coverage Status
Change from base Build 20115895339: 0.09%
Covered Lines: 10155
Relevant Lines: 13893

💛 - Coveralls

@hohwille
Copy link
Member

hohwille commented Dec 15, 2025

Thanks for your PR and the nice idea to prevent bugs like this again in the future via a JUnit test.
I created issue #1658 to rescue this wonderful idea. As described there the solution needs some further improvement.
In parallel I had already created a bugfix myself that follows our "old approach" that we always add an explicit hand-written JSON deserializer. That was PR #1656 that I decided to merge as hotfix for the bug #1644.
I therefore close this PR without merging but hope that we soon restore the valuable work and properly implement #1658 so we can remove the custom deserializers again that are rather boiler-plate code.

@hohwille hohwille closed this Dec 15, 2025
@github-project-automation github-project-automation bot moved this from Team Review to ✅ Done in IDEasy board Dec 15, 2025
@hohwille hohwille added this to the rejected milestone Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR that fixes a bug issue pip Python package manager (Pip Installs Packages)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

pip not working in native-image

3 participants