Skip to content

DD-2110 Custom properties support.#17

Merged
janvanmansum merged 5 commits intoDANS-KNAW:masterfrom
janvanmansum:DD-2110
Jan 10, 2026
Merged

DD-2110 Custom properties support.#17
janvanmansum merged 5 commits intoDANS-KNAW:masterfrom
janvanmansum:DD-2110

Conversation

@janvanmansum
Copy link
Copy Markdown
Contributor

@janvanmansum janvanmansum commented Jan 9, 2026

Fixes DD-2110

Description of changes

This PR adds support for custom properties in version properties files. The main change is updating the system to allow properties prefixed with "custom." to be passed through as OCFL object version properties, alongside the required version info fields (user name, email, and message).

Changes:

  • Renamed VersionInfoReader to VersionPropertiesReader and refactored it to handle both standard version info and custom properties
  • Updated OcflRepositoryProvider to read and apply custom properties to OCFL object versions
  • Added comprehensive test coverage for custom properties functionality

Related PRs

Notify

@DANS-KNAW/core-systems

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.80%. Comparing base (49de639) to head (2fe4853).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...aw/dans/datavault/core/OcflRepositoryProvider.java 90.00% 1 Missing ⚠️
...w/dans/datavault/core/VersionPropertiesReader.java 96.42% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #17      +/-   ##
============================================
+ Coverage     39.50%   40.80%   +1.30%     
- Complexity       67       76       +9     
============================================
  Files            30       30              
  Lines           605      620      +15     
  Branches         42       44       +2     
============================================
+ Hits            239      253      +14     
  Misses          337      337              
- Partials         29       30       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@janvanmansum janvanmansum marked this pull request as ready for review January 10, 2026 10:06
@janvanmansum janvanmansum requested a review from a team as a code owner January 10, 2026 10:06
@janvanmansum janvanmansum requested a review from Copilot January 10, 2026 10:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for custom properties in version properties files. The main change is updating the system to allow properties prefixed with "custom." to be passed through as OCFL object version properties, alongside the required version info fields (user name, email, and message).

Changes:

  • Renamed VersionInfoReader to VersionPropertiesReader and refactored it to handle both standard version info and custom properties
  • Updated OcflRepositoryProvider to read and apply custom properties to OCFL object versions
  • Added comprehensive test coverage for custom properties functionality

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/nl/knaw/dans/datavault/core/VersionPropertiesReader.java Refactored to support reading and separating custom properties from standard version info properties
src/main/java/nl/knaw/dans/datavault/core/OcflRepositoryProvider.java Updated to use the new VersionPropertiesReader and apply custom properties to object versions
src/test/java/nl/knaw/dans/datavault/core/VersionPropertiesReaderTest.java Renamed from VersionInfoReaderTest and added new test cases for custom properties
src/test/java/nl/knaw/dans/datavault/core/OcflRepositoryProviderTest.java Added test cases to verify custom properties are correctly added to OCFL objects
pom.xml Added commons-validator dependency for email validation
docs/index.md Added documentation about custom properties support
mkdocs.yml Added reference link for Object Version Properties extension

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +148 to +152
var reader = new VersionPropertiesReader(null, new nl.knaw.dans.datavault.config.DefaultVersionInfoConfig() {{
setUsername("user");
setEmail(new java.net.URI("mailto:user@mail.com"));
setMessage("msg");
}});
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

Using fully qualified class names and anonymous inner classes with double-brace initialization is less readable than extracting the config creation to a helper method or using a variable.

Copilot uses AI. Check for mistakes.
@janvanmansum janvanmansum merged commit 41e17cd into DANS-KNAW:master Jan 10, 2026
3 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