microcks / microcks/microcks-cli
fix: import command exits early on first failure when importing multiple artifacts
- Dominant language
- Go
- Stars
- 52
- Forks
- 68
- Avg merge
- 6h 54m
- Merged PRs (30d)
- 10
Description
Why we need this improvement:
When importing multiple comma-separated files, if one file fails,
the command immediately exits and remaining files are never imported.
Users have no visibility into which files succeeded and which failed.
How this will help:
All files should be attempted regardless of individual failures.
A summary at the end should show which files succeeded and which failed,
giving users complete feedback in one run.
Motivation:
This is a silent bug in CI/CD pipelines where partial imports can
cause hard-to-debug failures.
## Problem
When running:
microcks import "file1.yaml,file2.yaml,file3.yaml"
If file2.yaml fails, the command immediately calls os.Exit(1)
and file3.yaml is never imported. The user has no idea which
files were successfully imported and which were not.
## Proposed Fix
- Collect errors instead of exiting immediately
- Attempt all files regardless of individual failures
- Print a summary at the end showing pass/fail for each file
- Exit with code 1 only if any file failed
## Example output after fix
Importing 'file1.yaml'... success
Importing 'file2.yaml'... failed: connection refused
Importing 'file3.yaml'... success
Import completed: 2 succeeded, 1 failed
Contributor guide
Research direction
Start at the import command entry point and locate the current os.Exit(1) path used when an artifact fails. Run a multi-file import with one failing file to observe the existing behavior. Done means every file is attempted, each result is reported, a final success/failure summary is printed, and the command exits with code 1 when any file fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100