Skip to content

Commit ac1eeec

Browse files
Port #1307 to dtq-dev-9-base: [Port to dtq-dev] Issue ufal#1317 metadata health check (#1307) (#1436)
Source: 6e0ed0c (dtq-dev PR #1307) Adds the health check org.dspace.health.MetadataCheck, registered as "Metadata check". It runs the `metadataqa` curation task (ItemMetadataQAChecker) over the whole repository through a Curator, classifies every reported line against metadata-check-patterns.json, prints per-type error/warning statistics plus a size-capped list of messages, and writes errorCount / warningCount and the per-type errors / warnings arrays into the health-report JSON. Report size is bounded by four healthcheck.metadata.* keys, all read with the two-argument getIntProperty(key, default), so no further configuration is required. MetadataCheck.java and metadata-check-patterns.json are copied verbatim: both blobs are identical to origin/dtq-dev tip (f3793e6, fb2ba73) and every API they use is unchanged on this branch -- Check.run(ReportInfo) (protected abstract, widened to public here, which is legal), Curator.addTask/setReporter/curate(Context,String)/getResult, Check.getReportJson/setReportJson, and org.json:json:20231013, an explicit dspace-api dependency. org.apache.commons.collections.ListUtils (collections 3) is left as the source has it; swapping it for collections4 is a repo-wide cleanup, not part of this port. healthcheck.cfg is hand-merged, not taken from the source hunk. The source hunk also renames License -> License summary and Embargo info -> Embargo check and drops Checksum from the enabled list, because dtq-dev (7.6.x) and this branch (vanilla 9.3 plus two CLARIN entries) name and order the checks differently. This branch's names are kept and "Metadata check" is appended to both lists, so it becomes -c 7 here, not -c 5 as on dtq-dev. HealthReportIT gains this commit's two tests (testMetadataCheck, testMetadataCheckWithRestrictedReportSize) and its three helpers (findItemUri, and the package-private findLastReportResult and findCheckByName), reaching 12 @test. The one adaptation: the source tests hardcode -c 5, which addresses the License check here, so both resolve the index through the checkIndex(String) helper this branch already carries, via a new METADATA_CHECK constant. Everything else in the two tests is byte-identical with the source; the only other difference in the whole file is the added constant and its javadoc. report-diff-fields.json is deliberately untouched. It was restored in full by card X-01 (#1425), is byte-identical with dtq-dev and already contains the four "Metadata check" lines this commit would otherwise add; this port is what makes those mappings resolve. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent ad3c136 commit ac1eeec

4 files changed

Lines changed: 800 additions & 2 deletions

File tree

0 commit comments

Comments
 (0)