Skip to content

DX-9992 | Show errors and warnings on console in progress-manager mode#2664

Open
harshitha-cstk wants to merge 1 commit into
v2-devfrom
fix/dx-9992-progress-error-warnings
Open

DX-9992 | Show errors and warnings on console in progress-manager mode#2664
harshitha-cstk wants to merge 1 commit into
v2-devfrom
fix/dx-9992-progress-error-warnings

Conversation

@harshitha-cstk

Copy link
Copy Markdown
Contributor

What

When a progress-supported module (e.g. bulk-operations) runs with console logs disabled (progress-bar UI mode), error and warning messages are not shown on screen. A failing bulk operation — such as an invalid stack API key or a taxonomy error — completes with nothing printed.

Why

In logger.ts the Console transport was attached only when showConsoleLogs was true. For progress-supported modules that value defaults to false, so no level (including error/warn) got a console transport. The message was still written to the error/warn log file, but nothing reached the terminal — silently swallowed.

Fix

packages/contentstack-utilities/src/logger/logger.ts — attach the Console transport when console logs are enabled or the level is error/warn:

const isErrorOrWarn = level === 'error' || level === 'warn';
if (showConsoleLogs || isErrorOrWarn) {
  transports.push(new winston.transports.Console({ ... }));
}

Each level has its own winston logger instance, so this surfaces errors and warnings while keeping info/success/debug hidden — the progress bars stay clean. No change to the showConsoleLogs: true path.

Impact

  • Taxonomy error messages are now shown under the progress manager.
  • Warnings are now displayed for bulk operations in progress mode.

Tests

New Console output in progress-manager mode block in logger.test.ts, 4 cases: error surfaces, warn surfaces, info stays hidden, and console-on regression. Full utilities suite green (198 passing).

🤖 Generated with Claude Code

…ger mode

Progress-supported modules (e.g. bulk-operations) omitted the console
transport entirely when console logs were disabled, so errors and
warnings — like an invalid stack API key or a taxonomy error — were
written to file but silently swallowed on screen. Attach the console
transport for error and warn levels regardless of showConsoleLogs, while
keeping info/success/debug hidden so the progress bars stay clean.

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 27, 2026 13:51
@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 1 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

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.

1 participant