Fix/watcher spelling and path logic#343
Conversation
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.
| } | ||
| } | ||
|
|
||
| // 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
Ok sir, I will fix the unnecessary changes |
Sir I have fixed the errors..Can you please review the changes. |
| @@ -154,11 +154,6 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command | |||
| watchCfg = &config.WatchConfig{} | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
Thanks for the renames @Ansita20, those parts look good.
seems you deleted the normalization block entirely:
-if strings.HasPrefix(f, "./") {
- f = strings.TrimPrefix(f, "./")
-}There was a problem hiding this comment.
yes sir I just saw that...there was some issues with the code so I had to remove it but forgot to fix and add it agian.
I have made the changes can you please check once again.
I am really sorry for the errors.
|
LGTM on the latest changes @Ansita20. One last cleanup before merge: could you squash the commits into a single one? The branch currently has 7 commits from the review iterations, and a single clean commit reads better in the project history. This could help: https://www.kubernetes.dev/docs/guide/github-workflow/#squash-commits |
9daff63 to
b0c819b
Compare
Done |
Signed-off-by: ansita20 <ansitasingh20@gmail.com>
b0c819b to
a6c0243
Compare
|
@Caesarsage Sir, I have reduced the commit to a single one. |
|
thanks LGTM This is a good to have cleanup cc @Harsh4902 for approval or further review |
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