Skip to content

feat(java): expose manifest writer version - #8451

Open
everySympathy wants to merge 3 commits into
lance-format:mainfrom
everySympathy:codex/java-manifest-info
Open

feat(java): expose manifest writer version#8451
everySympathy wants to merge 3 commits into
lance-format:mainfrom
everySympathy:codex/java-manifest-info

Conversation

@everySympathy

@everySympathy everySympathy commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose the current manifest's writer library and semantic version metadata through Java
  • use a typed WriterVersion result with optional prerelease and build metadata
  • return Optional.empty() for older manifests that do not contain writer-version metadata

Compatibility coverage

DatasetTest exercises both compatibility directions through the public Dataset.getWriterVersion() JNI path:

  • a historical v0.7.5 manifest without writer_version returns Optional.empty()
  • the checked-in lance 2.0.0-beta.1 manifest verifies that library, core version, prerelease, and absent build metadata arrive in the correct Java fields

The prerelease fixture assertion catches dropped or swapped qualifier fields in the Rust-to-Java mapping.

Testing

  • cd java && ./mvnw -Dtest=DatasetTest test (54 Java tests and 17 JNI Rust tests)
  • cd java && cargo clippy --tests --manifest-path lance-jni/Cargo.toml -- -D warnings
  • cd java && ./mvnw spotless:check

@github-actions github-actions Bot added A-java Java bindings + JNI enhancement New feature or request labels Aug 10, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Gate recommendation: approve with a non-blocking risk.

The Java/JNI mapping is a thin, faithful projection of the existing manifest contract. The non-blocking risk is regression coverage: the new test proves only a present library/core version, not legacy absence or prerelease/build qualifiers. Targeted fixture assertions would lock down the advertised boundary behavior.

assertEquals(LanceConstants.FILE_FORMAT_VERSION_2_1, dataset.getLanceFileFormatVersion());
WriterVersion writerVersion = dataset.getWriterVersion().orElseThrow(AssertionError::new);
assertEquals("lance", writerVersion.getLibrary());
assertFalse(writerVersion.getVersion().isEmpty());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new API also promises Optional.empty() for legacy manifests and preserves prerelease/build qualifiers, but this coverage only exercises a newly written manifest’s present library/core version. Please add focused assertions for those boundary paths—existing legacy and prerelease fixtures can cover two of them—so JNI null/optional mapping regressions are caught.

@lance-gatekeeper lance-gatekeeper Bot Aug 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Partially addressed on 942f3fd: the historical v0.7.5 assertion now covers the JNI null → Optional.empty() path. The qualifier test constructs WriterVersion directly, so it would still pass if JNI swapped or dropped prerelease / buildMetadata; qualifier transport remains uncovered. This non-blocking thread remains open.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed on 7ae0f8e: the 2.0.0-beta.1 fixture now exercises prerelease presence and build-metadata absence through Dataset.getWriterVersion(). The focused suite passed 54 Java tests and 17 JNI Rust tests, closing the qualifier-mapping risk.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Aug 10, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Aug 10, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Gate recommendation: approve with a non-blocking risk.

Legacy absence is now covered end to end. The remaining non-blocking risk is that prerelease/build qualifier transport still lacks an end-to-end Java/JNI assertion; exercising a qualifier-bearing manifest through Dataset.getWriterVersion() would close it.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Aug 10, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Aug 11, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The qualifier-bearing historical fixture now exercises the remaining Java/JNI optional-field boundary, closing the prior regression-coverage risk while preserving the thin manifest projection.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant