DD-2110 Custom properties support.#17
Conversation
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
VersionInfoReadertoVersionPropertiesReaderand refactored it to handle both standard version info and custom properties - Updated
OcflRepositoryProviderto 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.
| 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"); | ||
| }}); |
There was a problem hiding this comment.
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.
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:
VersionInfoReadertoVersionPropertiesReaderand refactored it to handle both standard version info and custom propertiesOcflRepositoryProviderto read and apply custom properties to OCFL object versionsRelated PRs
Notify
@DANS-KNAW/core-systems