Skip to content

fix: continue importing remaining artifacts on failure#394

Open
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:fix/import-continue-on-failure
Open

fix: continue importing remaining artifacts on failure#394
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:fix/import-continue-on-failure

Conversation

@A-d-i-t-y
Copy link
Copy Markdown

Summary

Fix early exit bug in import command when importing multiple artifacts.

Problem

When running:
microcks import "file1.yaml,file2.yaml,file3.yaml"

If file2.yaml fails, the command immediately exits and file3.yaml
is never imported. User has no visibility into which files succeeded.

Fix

  • Collect errors instead of exiting immediately on first failure
  • Attempt all artifacts regardless of individual failures
  • Exit with code 1 only if any artifact failed

Example output after fix

Failed to import 'file2.yaml': connection refused
Microcks has discovered 'file1.yaml'
Microcks has discovered 'file3.yaml'

Files changed

  • cmd/import.go — replaced os.Exit(1) with error collection and continue

Closes #393

Previously, the import command would exit immediately on the first
failed artifact, leaving remaining files unprocessed.

Now all artifacts are attempted and a non-zero exit code is returned
only if any import failed.

Closes microcks#393

Signed-off-by: Aditya <aaaditya1909@gmail.com>
@A-d-i-t-y
Copy link
Copy Markdown
Author

Hi @Harsh4902 @Caesarsage, I have raised this PR to fix the early exit bug in the import command when importing multiple artifacts as discussed in issue #393. This is a minimal change — replaced os.Exit(1) with error collection so all artifacts are attempted before exiting. Would love your feedback!

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: import command exits early on first failure when importing multiple artifacts

1 participant