Repository navigation
Conversation
Commands cmd/test.go, cmd/import.go, cmd/importDir.go, and cmd/importURL.go used plain return statements inside error branches (config read failure, nil localConfig, NewClient failure). Because Cobra treats a normal Run return as success, the process exited with status 0, causing CI/CD pipelines to report false-positive success. Replace every such return with os.Exit(1) so that: - missing/corrupt config file → exit 1 - missing login session (localConfig == nil) → exit 1 - client initialisation failure (NewClient) → exit 1 - ValidationError from ImportDirectory → exit 1 No user-visible messages were changed. Fixes microcks#361 Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Priyanshubhartistm
requested review from
Harsh4902,
lbroudoux and
yada
as code owners
May 11, 2026 18:55
Harsh4902
approved these changes
May 21, 2026
Harsh4902
left a comment
Member
There was a problem hiding this comment.
LGTM. Thanks @Priyanshubhartistm for contribution.
|
You are now a Microcks community contributor! 💖 Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏 📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact. If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌" Kudos and please keep going, we need you 🙌 |
Contributor
Author
|
@Harsh4902 Thank you so much for the review and merge |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
cmd/test.go,cmd/import.go,cmd/importDir.go, andcmd/importURL.go, several error branches inside the local-config path used plainreturnstatements instead ofos.Exit(1):config.ReadLocalConfig()failurelocalConfig == nil(no login session)connectors.NewClient()failureValidationErrorfromImportDirectorySince Cobra treats a normal
Runreturn as success, the process exited with status 0 even when auth/config initialization failed. This caused CI/CD pipelines to report false-positive success - the command printed an error message but the pipeline saw a green exit code and continued.Changes
Replaced every silent
returnin these error branches withos.Exit(1)across all four affected files. No user-visible messages were changed.localConfig == nil)NewClient()failureValidationErrorfromImportDirectoryFiles Changed
cmd/test.gocmd/import.gocmd/importDir.gocmd/importURL.goFixes Bug: microcks test exits with status 0 on auth/config failure - pipelines silently report "passed" when the test never ran #361