Skip to content

v4-migrator: Add completion logs and annotate row-count diffs in verify phase#6261

Merged
nscuro merged 1 commit into
DependencyTrack:mainfrom
nscuro:issue-6260
Jun 4, 2026
Merged

v4-migrator: Add completion logs and annotate row-count diffs in verify phase#6261
nscuro merged 1 commit into
DependencyTrack:mainfrom
nscuro:issue-6260

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Jun 4, 2026

Description

Adds completion logs and annotate row-count diffs in verify phase of v4-migrator:

  • 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.

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 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.

Docs PR: DependencyTrack/docs#123

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly
  • This PR is a substantial change (per the ADR criteria), and I have added an ADR under docs/adr/

@nscuro nscuro added this to the 5.0 milestone Jun 4, 2026
Copilot AI review requested due to automatic review settings June 4, 2026 12:43
@nscuro nscuro added the enhancement New feature or request label Jun 4, 2026
@owasp-dt-bot
Copy link
Copy Markdown

owasp-dt-bot commented Jun 4, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jun 4, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 25 complexity · 2 duplication

Metric Results
Complexity 25
Duplication 2

View in Codacy

🟢 Coverage ∅ diff coverage

Metric Results
Coverage variation Report missing for f1cbaa81
Diff coverage diff coverage (70.00%)

View coverage diff in Codacy

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.

Copy link
Copy Markdown
Contributor

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 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>
@nscuro nscuro merged commit c0739e2 into DependencyTrack:main Jun 4, 2026
15 checks passed
@nscuro nscuro deleted the issue-6260 branch June 4, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v4-migrator lacks completion logs

3 participants