microcks / microcks/microcks-cli

fix: import command exits early on first failure when importing multiple artifacts

オープン
#393 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Go
スター
52
フォーク
68
平均マージ
6時間 54分
マージ済み PR(30日)
10

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

インポートコマンドのエントリポイントから始め、アーティファクトが失敗したときに使用される現在の os.Exit(1) の経路を見つけます。失敗するファイルを1つ含む複数ファイルのインポートを実行し、既存の動作を確認します。すべてのファイルが試行され、それぞれの結果が報告され、最終的な成功/失敗の概要が出力され、いずれかのファイルが失敗した場合にコマンドが終了コード1で終了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。