Skip to content

Feat : Add delete command to CLI - #295

Closed
DivyanshuVortex wants to merge 1 commit into
microcks:masterfrom
DivyanshuVortex:delete_command
Closed

DivyanshuVortex wants to merge 1 commit into
microcks:masterfrom
DivyanshuVortex:delete_command

Conversation

@DivyanshuVortex

Copy link
Copy Markdown
Contributor

Description

  • Introduces a new microcks delete CLI command to easily remove a specific API version from the server directly from the command line (e.g., microcks delete "Simple:1.1").
  • Updates pkg/connectors/microcks_client.go to safely query the /api/services/search endpoint for the internal system ID before executing the DELETE request.
  • Adds comprehensive unit tests (microcks_client_test.go) covering both successful 204 No Content deletions and "service not found" edge cases.
  • Includes the full markdown documentation for the command under documentation/cmd/delete.md.

Related issue(s)

Resolves #294

Signed-off-by: DivyanshuVorrtex <divyanshuchandra9027@gmail.com>
@DivyanshuVortex

Copy link
Copy Markdown
Contributor Author

Screenshot (681)
Video.Project.19.mp4

@DivyanshuVortex

Copy link
Copy Markdown
Contributor Author

Hey @Harsh4902 , could you please review this PR? Thanks.

@yada

yada commented Oct 28, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, @DivyanshuVortex. The PR conflicts with master and needs to be adapted to the refactoring done since May (#490, #491, enforced by the policy-guards CI):

  • use RunE and return errors with the internal errors package; no os.Exit or fmt.Println for errors;
  • reuse newCommandClient(globalClientOpts) to build the client instead of duplicating the auth logic;
  • as this deletes data, add a confirmation prompt, or a --force flag for CI/CD usage, and a clear message when several services match;
  • rebase microcks_client_test.go and keep the tests for the 204 and not-found cases.

Maintainers: the design question to settle is the confirmation behavior (--force). If no update in about two weeks, we will close it and keep #294 open.

Disclosure: this comment was drafted with AI assistance, and the results were run locally.

@Caesarsage

Copy link
Copy Markdown
Collaborator

Thanks @DivyanshuVortex.

Could you rebase onto RunE and the shared errors package, reuse newCommandClient and resolveServiceID, and move this to service delete?

It should prompt for confirmation in a terminal and require --force otherwise.

@Caesarsage

Copy link
Copy Markdown
Collaborator

Supersede
#607

@Caesarsage Caesarsage closed this Oct 31, 2026

This branch was previously deployed

1 inactive deployment
Build — e06c0f4e Deployed May 5, 2026 by DivyanshuVortex via build-verify-package #354
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.

Feature Request: Add delete command to CLI to remove APIs from Microcks

3 participants