microcks / microcks/microcks-cli
fix: import-url command exits early on first failure when importing multiple URLs
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 52
- Forks
- 68
- Ø Merge
- 6 Std. 54 Min.
- Gemergte PRs (30 T.)
- 10
Beschreibung
Why we need this:
When importing multiple comma-separated URLs, if one URL fails,
the command immediately exits and remaining URLs are never imported.
This is the same issue that was fixed in the import command in PR #394.
How this will help:
All URLs should be attempted regardless of individual failures,
giving users complete feedback in one run.
Motivation:
Consistent behavior across all import commands (import, import-url).
Problem
When running:
microcks import-url "https://url1.yaml,https://url2.yaml,https://url3.yaml"
If url1 fails, os.Exit(1) is called immediately inside the loop
and url2, url3 are never imported.
Looking at cmd/importURL.go:
for _, f := range sepSpecificationFiles {
msg, err := mc.DownloadArtifact(f, mainArtifact, secret)
if err != nil {
os.Exit(1) // exits immediately, remaining URLs skipped
}
}
Same bug as #393, fixed in import command via PR #394.
Fix
- Collect errors instead of exiting immediately
- Attempt all URLs regardless of individual failures
- Exit with code 1 only if any URL failed
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit cmd/importURL.go und vergleiche die entsprechende Korrektur in PR #394 für den Befehl import. Aktualisiere die import-url-Schleife so, dass jede URL versucht wird und der Befehl nur dann mit Code 1 beendet wird, wenn mindestens ein Import fehlschlägt. Überprüfe, dass spätere URLs nach einem früheren Fehler weiterhin verarbeitet werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- go
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 82/100