v4-migrator: Add completion logs and annotate row-count diffs in verify phase#6261
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 25 |
| Duplication | 2 |
🟢 Coverage ∅ diff coverage
Metric Results Coverage variation Report missing for f1cbaa81 Diff coverage ✅ ∅ diff coverage (70.00%) Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (f1cbaa8) Report Missing Report Missing Report Missing Head commit (eebeb52) 41742 35925 86.06% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#6261) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
This PR improves the operator experience of the support/v4-migrator by adding explicit “completion” logs for key phases and enhancing the verify phase output with per-table notes that explain expected row-count deltas (aligned with the migration guide), addressing issue #6260.
Changes:
- Add explicit completion logging (duration + table/row totals) for extract/transform/load and a completion terminator for verify.
- Enhance verify row-count reporting with a “Note” column that classifies reductions (expected vs. probe-attributed vs. neutral pointer).
- Add/extend tests to validate the new verify output behavior, including post-bootstrap verify runs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| support/v4-migrator/src/test/java/org/dependencytrack/v4migrator/VerifyIT.java | Extends integration coverage to assert the new verify terminator and row-count note output, and adds a post-bootstrap verify test. |
| support/v4-migrator/src/test/java/org/dependencytrack/v4migrator/verify/VerifyNoteTest.java | Adds unit tests for the discrepancy-note classifier used in verify output. |
| support/v4-migrator/src/main/java/org/dependencytrack/v4migrator/verify/VerifyPhase.java | Adds verify completion terminator, row-count “Note” column, and probe-derived note classification. |
| support/v4-migrator/src/main/java/org/dependencytrack/v4migrator/verify/RowCountNotes.java | Introduces a central mapping of per-table “expected delta” explanations for verify output. |
| support/v4-migrator/src/main/java/org/dependencytrack/v4migrator/transform/TransformPhase.java | Adds transform completion summary logging and returns per-table row counts for aggregation. |
| support/v4-migrator/src/main/java/org/dependencytrack/v4migrator/load/LoadPhase.java | Adds load completion summary logging and additional progress logs in post-load finalization steps. |
| support/v4-migrator/src/main/java/org/dependencytrack/v4migrator/extract/ExtractPhase.java | Adds extract completion summary logging and returns per-table row counts for aggregation. |
| support/v4-migrator/src/main/java/org/dependencytrack/v4migrator/cli/RunCommand.java | Adds a final “migration completed” log message after successful run. |
…fy phase * Adds explicit logs after completion of each stage, including how long they took to run. * Annotates verify output with delta explanations. This effectively repeats information from the upgrade guide so it's kept brief. Note that by design, there can't be any delta in the load phase, because it uses plain `INSERT ... SELECT ...` statements with no `ON CONFLICT DO NOTHING` clause. So there is no way to drop rows there. Rows dropped during the transform phase are all intentional, i.e. for de-duplication. Trying to figure out which row reduction is intentional and which is accidental would blow up the complexity of this tool without need. Signed-off-by: nscuro <nscuro@protonmail.com>
Description
Adds completion logs and annotate row-count diffs in
verifyphase of v4-migrator:Addressed Issue
Closes #6260
Additional Details
Note that by design, there can't be any delta in the load phase, because it uses plain
INSERT ... SELECT ...statements with noON CONFLICT DO NOTHINGclause. So there is no way to drop rows there.Rows dropped during the transform phase are all intentional, i.e. for de-duplication. Trying to figure out which row reduction is intentional and which is accidental would blow up the complexity of this tool without need.
Docs PR: DependencyTrack/docs#123
Checklist
This PR fixes a defect, and I have provided tests to verify that the fix is effectiveThis PR introduces changes to the database model, and I have updated the migration changelog accordinglyThis PR is a substantial change (per the ADR criteria), and I have added an ADR underdocs/adr/