Skip to content

fix: import-url success message now respects mainArtifact flag#459

Open
AdeshDeshmukh wants to merge 1 commit into
microcks:masterfrom
AdeshDeshmukh:fix/import-url-mainartifact-message
Open

fix: import-url success message now respects mainArtifact flag#459
AdeshDeshmukh wants to merge 1 commit into
microcks:masterfrom
AdeshDeshmukh:fix/import-url-mainartifact-message

Conversation

@AdeshDeshmukh

Copy link
Copy Markdown

The import-url command 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 the mainArtifact=false case.

The mainArtifact variable 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 import and import-dir handle this — they both check mainArtifact (or fileType.IsPrimary for import-dir) and set an action variable to either "discovered" or "completed". The fix is the same pattern.

One file changed: cmd/importURL.go. Replaced the hardcoded fmt.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 (artifcatartifact).

Tested with go build ./... (passes), go vet ./... (no new warnings), and go test ./... (all existing tests pass).

Signed-off-by: Adesh Deshmukh adeshkd123@gmail.com

Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
Copilot AI review requested due to automatic review settings June 17, 2026 02:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mainArtifact by introducing an action string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/importURL.go
Comment on lines +126 to +130
action := "discovered"
if !mainArtifact {
action = "completed"
}
fmt.Printf("Microcks has %s '%s'\n", action, msg)
Comment thread cmd/importURL.go
Comment on lines 123 to 124
fmt.Printf("Got error when invoking Microcks client importing Artifact: %s", err)
os.Exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants