fix: import-url success message now respects mainArtifact flag#459
fix: import-url success message now respects mainArtifact flag#459AdeshDeshmukh wants to merge 1 commit into
Conversation
Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves the CLI output around artifact downloads/imports and corrects a typo in an inline comment.
Changes:
- Fixes typo in comment (“artifcat” → “artifact”).
- Adjusts success messaging to vary based on
mainArtifactby introducing anactionstring.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| action := "discovered" | ||
| if !mainArtifact { | ||
| action = "completed" | ||
| } | ||
| fmt.Printf("Microcks has %s '%s'\n", action, msg) |
| fmt.Printf("Got error when invoking Microcks client importing Artifact: %s", err) | ||
| os.Exit(1) |
|
This pull request has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
The
import-urlcommand was always printing "Microcks has discovered" in its success message, even for secondary artifacts where it should say "completed". This wasn't just cosmetic — it tells the user what action Microcks actually performed, and it was wrong for themainArtifact=falsecase.The
mainArtifactvariable was already being parsed at line 109-113, so it was sitting there ready to use. It just wasn't being used in the output.I looked at how
importandimport-dirhandle this — they both checkmainArtifact(orfileType.IsPrimaryfor import-dir) and set anactionvariable to either "discovered" or "completed". The fix is the same pattern.One file changed:
cmd/importURL.go. Replaced the hardcodedfmt.Printf("Microcks has discovered '%s'\n", msg)with the same conditional pattern used in the other two import commands. Also fixed a minor typo in the comment above (artifcat→artifact).Tested with
go build ./...(passes),go vet ./...(no new warnings), andgo test ./...(all existing tests pass).Signed-off-by: Adesh Deshmukh adeshkd123@gmail.com