microcks / microcks/microcks-cli

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

Aperta
#393 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
52
Fork
68
Merge medio
6h 54m
PR unite (30g)
10

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal punto di ingresso del comando di importazione e individua il percorso corrente di os.Exit(1) utilizzato quando un artefatto non riesce. Esegui un'importazione di più file con un file che non riesce, per osservare il comportamento esistente. Il lavoro è completato quando viene tentato ogni file, viene riportato ogni risultato, viene stampato un riepilogo finale di successo/fallimento e il comando termina con il codice 1 quando un file non riesce.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.