Skip to content

Fix/error output stderr#410

Open
namanyadav-08 wants to merge 2 commits into
microcks:masterfrom
namanyadav-08:fix/error-output-stderr
Open

Fix/error output stderr#410
namanyadav-08 wants to merge 2 commits into
microcks:masterfrom
namanyadav-08:fix/error-output-stderr

Conversation

@namanyadav-08
Copy link
Copy Markdown

@namanyadav-08 namanyadav-08 commented May 18, 2026

Fixes #413

What does this PR do?

Error messages in CLI commands were being written to stdout instead of stderr. This is incorrect Unix behavior — errors should go to stderr so that scripts and CI/CD pipelines can properly separate program output from error messages.

Changes made

  • cmd/test.go — error messages moved to stderr
  • cmd/import.go — error messages moved to stderr
  • cmd/importDir.go — error messages moved to stderr
  • cmd/importURL.go — error messages moved to stderr

Why this matters

When Microcks CLI is used in CI/CD pipelines, tools like grep, awk, or log parsers pipe stdout and stderr separately. Printing errors to stdout pollutes the output stream and breaks scripting workflows.

How to verify

Run any command with missing or invalid args and redirect stdout to /dev/null:

microcks test 2>/dev/null
# Error message should NOT appear (it goes to stderr now)

microcks test 2>&1 1>/dev/null  
# Error message SHOULD appear here

Relates to improving CLI robustness for CI/CD usage.

@namanyadav-08
Copy link
Copy Markdown
Author

@lbroudoux @yada Hi! I'm Naman, applying for the LFX Mentorship
Term 2 for the Microcks CLI project. This PR fixes error output
being written to stdout instead of stderr across all CLI commands —
which affects CI/CD pipeline scripting. I have MERN and Gen AI
experience and I'm excited to contribute more. Would love any
feedback!

Signed-off-by: namanyadav-08 <namanyadav8125@gmail.com>
@namanyadav-08 namanyadav-08 force-pushed the fix/error-output-stderr branch from 4c0b552 to 4f28a45 Compare May 19, 2026 10:01
@namanyadav-08
Copy link
Copy Markdown
Author

@lbroudoux @yada I have submitted my LFX Mentorship Term 2
application for the Microcks CLI project. I have opened 3 PRs
(#409, #410, #414) and filed issues #412 and #413 before applying.
Would love any feedback on my contributions. Thank you!

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.

fix: CLI error messages written to stdout instead of stderr

1 participant