Skip to content

Health report, report diff fixes#1254

Open
Kasinhou wants to merge 11 commits intodtq-devfrom
ufal/health-report-checks-fix
Open

Health report, report diff fixes#1254
Kasinhou wants to merge 11 commits intodtq-devfrom
ufal/health-report-checks-fix

Conversation

@Kasinhou
Copy link

@Kasinhou Kasinhou commented Feb 23, 2026

Problem description

Followed issues:
https://github.com/dataquest-dev/dspace-customers/issues/430
#1250

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Copy link

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 updates the Health Report and Report Diff CLI tooling in CLARIN-DSpace to improve comparison correctness when reports contain different check selections and to align CLI option handling/help output.

Changes:

  • Remove the legacy healthcheck CLI command from launcher.xml and rely on the Spring script-service based health-report.
  • Update report-diff to normalize report JSON to the intersection of check names, add a “Skipped Checks” section, and make key-field mappings independent of check ordering via selector-based paths.
  • Standardize help flags to -h/--help and update tests/fixtures accordingly.

Reviewed changes

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

Show a summary per file
File Description
dspace/config/launcher.xml Removes legacy healthcheck command entry.
dspace-api/src/test/java/org/dspace/scripts/ReportDiffIT.java Updates help flag usage and adds coverage for skipped checks / name-based comparisons.
dspace-api/src/main/resources/report-diff-fields.json Switches from index-based paths to selector-by-check-name paths.
dspace-api/src/main/java/org/dspace/app/reportdiff/ReportDiffScriptConfiguration.java Changes -i to -h and clarifies -c semantics for filtering comparisons.
dspace-api/src/main/java/org/dspace/app/reportdiff/ReportDiff.java Implements intersection normalization, skipped-check reporting, and selector-based field resolution.
dspace-api/src/main/java/org/dspace/app/healthreport/HealthReportScriptConfiguration.java Changes help flag to -h, supports multiple -c values, and renames output option to -r.
dspace-api/src/main/java/org/dspace/app/healthreport/HealthReport.java Implements multi-check -c parsing, help renaming, and output option rename.

Comment on lines 7 to 15
<class>org.dspace.storage.bitstore.BitStoreMigrate</class>
</step>
</command>
<command>
<name>healthcheck</name>
<description>Create health check report</description>
<step>
<class>org.dspace.health.Report</class>
</step>
</command>

<command>
<name>checker</name>
<description>Run the checksum checker</description>
<step>
<class>org.dspace.app.checker.ChecksumChecker</class>
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

launcher.xml no longer exposes the legacy healthcheck command, but the implementation class org.dspace.health.Report still exists in the codebase. If this removal is intentional, consider either removing/deprecating the legacy class as well, or adding a compatibility alias / release note so existing automation using dspace healthcheck doesn’t break unexpectedly.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@milanmajchrak In dspace/health, there are still many classes from LINDAT (version 5). Which of them do we not want? Does solving this issue also remove the old unused classes (for example, the healthcheck problem that may call a process with the error mentioned by Milan Kuchtiak)?

@Paurikova2
Copy link
Collaborator

Paurikova2 commented Feb 25, 2026

Problem (from issue) Class + Method Changed Test Name
1328 -i/--info renamed to -h/--help in health-report HealthReport#setup, HealthReport#internalRun, HealthReport#printHelp HealthReportIT#testHelpOption
1328 -h/--help option declared for health-report CLI HealthReportScriptConfiguration#getOptions HealthReportIT#testHelpOption
1328 -o/--output renamed to -r/--report; field fileNamereportFile HealthReport#setup, HealthReport#internalRun HealthReportIT#testReportFileSaved
1328 -r/--report option declared in CLI options HealthReportScriptConfiguration#getOptions HealthReportIT#testReportFileSaved
1328 -c accepts multiple values (List<Integer> replaces single int); uses getOptionValues HealthReport#setup HealthReportIT#testMultipleChecks, HealthReportIT#testLicenseCheck
1328 -c declared as multi-value with setArgs(Integer.MAX_VALUE) HealthReportScriptConfiguration#getOptions HealthReportIT#testMultipleChecks
1328 Validate -c: out-of-range index → logError + throw ParseException HealthReport#setup HealthReportIT#testInvalidCheckOutOfRange
1328 Validate -c: non-integer value → logError + throw ParseException HealthReport#setup HealthReportIT#testInvalidCheckNonInteger
1328 Validate -f: value ≤ 0 → logError + throw ParseException HealthReport#setup HealthReportIT#testInvalidForDaysZero
1328 Validate -f: non-integer value → logError + throw ParseException HealthReport#setup HealthReportIT#testInvalidForDaysNonInteger
1328 printCommandlineOptions updated to use getOptionValues for multi-value -c HealthReport#printCommandlineOptions HealthReportIT#testMultipleChecks
1328 -i/--info renamed to -h/--help in report-diff ReportDiff#setup, ReportDiff#internalRun, ReportDiff#printHelp ReportDiffIT#testHelpInformation
1328 -h/--help option declared for report-diff CLI ReportDiffScriptConfiguration#getOptions ReportDiffIT#testHelpInformation
1328 Legacy healthcheck CLI command removed from launcher dspace/config/launcher.xml
1334 Reports with different check lists produced null values — normalize both to intersection of check names ReportDiff#normalizeReportsToIntersection ReportDiffIT#testSkippedChecksSection, ReportDiffIT#testIntersectionComparisonNoNullsForCommonChecks
1334 Checks absent from one report silently ignored — "Skipped Checks" section added ReportDiff#generateReportComparison ReportDiffIT#testSkippedChecksSection, ReportDiffIT#testIntersectionComparisonNoNullsForCommonChecks
1334 -c in report-diff filtered by check name, not position, after normalization ReportDiff#normalizeReportsToIntersection ReportDiffIT#testCompareSpecificCheck
1334 report-diff-fields.json paths used numeric indices (/checks/0/…) breaking resolution when check order changed — replaced with name selectors (/checks/[name=Item summary]/…) report-diff-fields.json ReportDiffIT#testEnhancedKeyChangesTable, ReportDiffIT#testProfessionalReportFormat, ReportDiffIT#testSizeDifferenceFormatting
1334 resolveFieldPath did not support name-selector syntax — added XPath-like [attr=value] segment resolution ReportDiff#resolveFieldPath, ReportDiff#splitPathSegments ReportDiffIT#testEnhancedKeyChangesTable, ReportDiffIT#testProfessionalReportFormat, ReportDiffIT#testSizeDifferenceFormatting
1334 Key Changes table showed null for fields when one report had fewer checks — skip fields missing in either normalized report ReportDiff#generateEnhancedKeyChangesTable ReportDiffIT#testIntersectionComparisonNoNullsForCommonChecks, ReportDiffIT#testEnhancedKeyChangesTable

Copy link

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

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

@Paurikova2 Paurikova2 linked an issue Mar 5, 2026 that may be closed by this pull request
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.

UFAL/Health report bugs and improvements

3 participants