fix: import-url success message now respects mainArtifact flag#459
Open
AdeshDeshmukh wants to merge 1 commit into
Open
fix: import-url success message now respects mainArtifact flag#459AdeshDeshmukh wants to merge 1 commit into
AdeshDeshmukh 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.
Comment on lines
+126
to
+130
| action := "discovered" | ||
| if !mainArtifact { | ||
| action = "completed" | ||
| } | ||
| fmt.Printf("Microcks has %s '%s'\n", action, msg) |
Comment on lines
123
to
124
| fmt.Printf("Got error when invoking Microcks client importing Artifact: %s", err) | ||
| os.Exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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