Skip to content

Conversation

javuto
Copy link
Collaborator

@javuto javuto commented Aug 29, 2025

Tagging nodes using osctrl-cli, without direct access to the database, it uses the osctrl-api component. This code adds the ability to tag nodes in osctrl-api.

@javuto javuto requested a review from Copilot August 29, 2025 21:29
@javuto javuto added osctrl-api osctrl-api related changes osctrl-cli osctrl-cli related changes labels Aug 29, 2025
Copy link
Contributor

@Copilot 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 adds node tagging functionality to the osctrl-api component, enabling the osctrl-cli to tag nodes without requiring direct database access. This extends the existing node management capabilities through the API layer.

  • Adds a new API endpoint /nodes/{env}/tag for tagging nodes
  • Introduces ApiNodeTagRequest type to handle tag requests with UUID, tag name, and tag type
  • Updates CLI to use the new API endpoint with tag type parameter

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/types/types.go Defines new ApiNodeTagRequest struct for tag operations
pkg/tags/tags.go Adds ActionTag and ActionUntag constants for node tagging
osctrl-api.yaml Documents new /nodes/{env}/tag POST endpoint in OpenAPI spec
cmd/cli/node.go Updates tagNode function to pass tag type to API
cmd/cli/api-node.go Implements TagNode API method with complete request handling
cmd/api/main.go Registers new tag endpoint route handler
cmd/api/handlers/nodes.go Implements TagNodeHandler with validation and tagging logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@javuto javuto merged commit 4c4fbf8 into main Aug 29, 2025
55 checks passed
@javuto javuto deleted the api-tag-node-new branch August 29, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
osctrl-api osctrl-api related changes osctrl-cli osctrl-cli related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant