DX-7521 | Fix invalid complete count in import progress UI#2647
DX-7521 | Fix invalid complete count in import progress UI#2647harshitha-cstk wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ 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>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
What
The nested progress bars in
importrender a completed line whose bar total disagrees with its ownComplete (…)summary — e.g.Global Fields Update 37/37 | ✓ Complete (27/27)orReference 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 theComplete (…)text usedprocess.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: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 incliProgressManager.test.ts, 4 cases: partial-ticks reconcile, all-ticked unchanged, zero-tick skip, failed-with-partial. Full file: 38 passing.🤖 Generated with Claude Code