Fix/watcher spelling and path logic#343
Conversation
Signed-off-by: ansita20 <ansitasingh20@gmail.com>
Signed-off-by: ansita20 <ansitasingh20@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses typos in exported constructor names and fixes the import command’s path normalization order so uploaded artifact paths match watcher configuration paths (Fixes #342).
Changes:
- Renamed
cmd.NewCommad()tocmd.NewCommand()(command constructor typo fix). - Renamed
watcher.NewWatchManger()towatcher.NewWatchManager()(constructor naming consistency). - Normalized
./file path prefixes before callingUploadArtifact()to keep upload and watch-config paths consistent.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| watcher/main.go | Updates watcher binary to use NewWatchManager() constructor. |
| pkg/watcher/watchManager.go | Renames the watcher constructor to NewWatchManager(). |
| cmd/import.go | Moves ./ prefix trimming before upload; updates watcher constructor call. |
| cmd/cmd.go | Renames CLI root command constructor to NewCommand(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -22,7 +22,7 @@ import ( | |||
| "github.com/spf13/cobra" | |||
| ) | |||
|
|
|||
There was a problem hiding this comment.
This code will not compile, see copilot review @Ansita20
| } | ||
| } | ||
|
|
||
| // Normalize file path to match the watcher fsnotify events format. |
There was a problem hiding this comment.
I don't see any help of moving this function upward. Maybe you could clarify why
Caesarsage
left a comment
There was a problem hiding this comment.
Thanks @Ansita20 for your contribution
I think of you fix the copilot review and test. This will actually be mergable.
Good cleanup
Description
This pull request fixes several code quality and logic issues in the Microcks CLI.
Changes included:
NewCommad()toNewCommand().NewWatchManger()toNewWatchManager()for consistency with the struct name.importcommand so that./prefixes are removed before callingUploadArtifact(). This ensures consistent paths between uploaded artifacts and watcher configuration.These fixes improve compilation reliability, code readability, and correct watcher behavior in watch mode.
Changes
Command Constructor Fix
NewCommad()→NewCommand()WatchManager Constructor Fix
NewWatchManger()→NewWatchManager()File Path Normalization Fix
UploadArtifact()call.Testing
importcommand works correctly with normalized file paths.Related issue(s)
Fixes #342