Skip to content

DX-7521 | Fix invalid complete count in import progress UI#2647

Open
harshitha-cstk wants to merge 3 commits into
v2-devfrom
fix/dx-7521-progress-complete-count
Open

DX-7521 | Fix invalid complete count in import progress UI#2647
harshitha-cstk wants to merge 3 commits into
v2-devfrom
fix/dx-7521-progress-complete-count

Conversation

@harshitha-cstk

Copy link
Copy Markdown
Contributor

What

The nested progress bars in import render a completed line whose bar total disagrees with its own Complete (…) summary — e.g. Global Fields Update 37/37 | ✓ Complete (27/27) or Reference Updates 59/59 | ✓ Complete (17/17).

Why

addProcess(name, total) registers an estimated/planned count (e.g. 37 global fields, 59 entries). At completion, completeProcess() force-filled the bar to that estimate (update(process.total)), while the Complete (…) text used process.current — the number of items actually ticked. When runtime skips/defers items (deferred global fields, entries whose reference-update never runs, etc.), the two counts diverge. The existing guard only handled the fully-skipped case (current === 0), not partial processing.

Fix

In completeProcess() (packages/contentstack-utilities/src/progress-summary/cli-progress-manager.ts), reconcile the bar's total with the actually-processed count so value, total, and summary all agree:

process.progressBar.setTotal(totalProcessed);
...
process.progressBar.update(totalProcessed, { ... });

The zero-tick skip behavior is preserved. This is a display-only change — import results and the final summary table were always correct.

Tests

New Complete count reconciliation (DX-7521) block in cliProgressManager.test.ts, 4 cases: partial-ticks reconcile, all-ticked unchanged, zero-tick skip, failed-with-partial. Full file: 38 passing.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@harshitha-cstk
harshitha-cstk requested a review from a team as a code owner July 20, 2026 11:45
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 2 36 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 36
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

…mock

The module-level cli-progress mock binds by load order and does not take
effect in CI, so the reconciliation tests saw the real bar and failed.
Inject a stub bar at the rendering seam instead, and drop the ticket
number from the describe title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 2 36 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 36
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 2 37 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 37
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

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.

2 participants