Skip to content

Fix/watcher spelling and path logic#343

Open
Ansita20 wants to merge 2 commits into
microcks:masterfrom
Ansita20:fix/watcher-spelling-and-path-logic
Open

Fix/watcher spelling and path logic#343
Ansita20 wants to merge 2 commits into
microcks:masterfrom
Ansita20:fix/watcher-spelling-and-path-logic

Conversation

@Ansita20
Copy link
Copy Markdown

@Ansita20 Ansita20 commented May 8, 2026

Description

This pull request fixes several code quality and logic issues in the Microcks CLI.

Changes included:

  • Fixed a typo in the CLI command constructor function by renaming NewCommad() to NewCommand().
  • Fixed a naming typo in the watcher constructor by renaming NewWatchManger() to NewWatchManager() for consistency with the struct name.
  • Corrected the order of file path normalization in the import command so that ./ prefixes are removed before calling UploadArtifact(). 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

  1. Command Constructor Fix

    • Renamed NewCommad()NewCommand()
    • Updated all references to match the corrected function name.
  2. WatchManager Constructor Fix

    • Renamed NewWatchManger()NewWatchManager()
    • Updated all call sites accordingly.
  3. File Path Normalization Fix

    • Moved path normalization logic before the UploadArtifact() call.
    • Ensures consistent artifact paths between upload and watcher configuration.

Testing

  • Built the CLI locally to verify compilation succeeds.
  • Verified that the import command works correctly with normalized file paths.
  • Confirmed that watcher configuration now uses consistent file paths.

Related issue(s)

Fixes #342

Ansita20 added 2 commits May 9, 2026 03:13
Signed-off-by: ansita20 <ansitasingh20@gmail.com>
Signed-off-by: ansita20 <ansitasingh20@gmail.com>
Copilot AI review requested due to automatic review settings May 8, 2026 21:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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() to cmd.NewCommand() (command constructor typo fix).
  • Renamed watcher.NewWatchManger() to watcher.NewWatchManager() (constructor naming consistency).
  • Normalized ./ file path prefixes before calling UploadArtifact() 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.

Comment thread cmd/cmd.go
@@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
)

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.

CLI Code Quality and Logic Issues

2 participants