Skip to content

Treat literal "null" string as null when reading marketplace CSV#6826

Merged
timtebeek merged 3 commits intomainfrom
fix-csv-null-literal-version
Feb 26, 2026
Merged

Treat literal "null" string as null when reading marketplace CSV#6826
timtebeek merged 3 commits intomainfrom
fix-csv-null-literal-version

Conversation

@timtebeek
Copy link
Copy Markdown
Member

Summary

  • RecipeMarketplaceReader already normalizes blank CSV values to null, but does not handle the literal string "null". This causes RecipeBundle.version and requestedVersion to become the string "null" after a CSV round-trip, leading to display artifacts like file:///path/to/file.yml:null in mod config recipes list.
  • Fix the reader's value normalization to treat "null" the same as blank — one extra condition applied uniformly to all columns.
  • Add two tests: one for direct parsing of literal null in CSV, one for round-trip preservation of null versions.

Test plan

  • RecipeMarketplaceReaderTest.nullLiteralVersionIsTreatedAsNull — parses CSV with literal null in version columns, asserts they become Java null
  • RecipeMarketplaceReaderTest.roundTripPreservesNullVersions — write → read round-trip with null versions stays null
  • All existing RecipeMarketplaceReaderTest tests continue to pass

RecipeMarketplaceReader already normalizes blank CSV values to null,
but does not handle the literal string "null". This can cause
RecipeBundle.version and requestedVersion to become the string "null"
after a CSV round-trip, leading to display artifacts like
"file:///path/to/file.yml:null" in mod config recipes list.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Feb 26, 2026
@timtebeek timtebeek added the bug Something isn't working label Feb 26, 2026
Remove setNullValue("") so univocity returns null for empty fields
natively, eliminating the need for the redundant StringUtils.isBlank
check in the reading loop.
@timtebeek timtebeek requested review from mtthwcmpbll and pstreef and removed request for mtthwcmpbll February 26, 2026 11:12
@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Feb 26, 2026
@timtebeek timtebeek merged commit 998e8c3 into main Feb 26, 2026
1 check failed
@timtebeek timtebeek deleted the fix-csv-null-literal-version branch February 26, 2026 15:47
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants