Skip to content

Skip tag creation for UUIDs, localnames and hostname#737

Merged
javuto merged 3 commits intomainfrom
no-auto-tag-tls
Oct 21, 2025
Merged

Skip tag creation for UUIDs, localnames and hostname#737
javuto merged 3 commits intomainfrom
no-auto-tag-tls

Conversation

@javuto
Copy link
Collaborator

@javuto javuto commented Oct 15, 2025

Implementation of #736 to skip automatic tag creation for UUIDs, localnames and hostnames.

@javuto javuto requested a review from Copilot October 15, 2025 17:05
@javuto javuto added osctrl-tls osctrl-tls related changes 🏷️ tags Tags related issues labels Oct 15, 2025
Copy link
Contributor

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 removes automatic tag creation for UUIDs, localnames, and hostnames, and surfaces a count of tagged nodes in the admin UI.

  • Stop generating/handling tag types: uuid, localname, hostname (decorators, parsers, custom setters, CLI options, tests).
  • Adjust auto-tagging to only use environment and platform.
  • Add tagged-nodes count to the Tags page, including a new TagCounter type and CountTaggedNodes method.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/tags/utils_test.go Updates tests to align with removed tag types (uuid, localname).
pkg/tags/utils.go Removes constants and switch cases for uuid/localname/hostname across helpers.
pkg/tags/tags.go Adds TagCounter and CountTaggedNodes; fixes GetTaggedNodes query; limits AutoTagNode to env+platform.
cmd/cli/node.go Removes CLI tag-type options for uuid, localname, hostname.
cmd/admin/templates/tags.html Adds “Tagged Nodes” column; removes uuid/localname/hostname tag type options.
cmd/admin/handlers/types-templates.go Adds CounterTags to template data.
cmd/admin/handlers/templates.go Wires CountTaggedNodes into TagsGETHandler.

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@zhuoyuan-liu zhuoyuan-liu left a comment

Choose a reason for hiding this comment

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

Great change! I think the documentation for tag cleanup is the only missing part.

@javuto
Copy link
Collaborator Author

javuto commented Oct 21, 2025

To cleanup tags for UUID, Localname and Hostname use the following SQL queries:

-- Delete tagged nodes
DELETE FROM tagged_nodes WHERE admin_tag_id IN (
   SELECT id FROM admin_tags WHERE tag_type IN (1, 3, 7)
);

-- Delete tags
DELETE FROM admin_tags WHERE tag_type IN (1, 3, 7);

@javuto
Copy link
Collaborator Author

javuto commented Oct 21, 2025

@zhuoyuan-liu ready the the review, thanks!

Copy link
Contributor

@zhuoyuan-liu zhuoyuan-liu left a comment

Choose a reason for hiding this comment

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

Nice work! LGTM.

@javuto javuto merged commit 51f3fc1 into main Oct 21, 2025
55 checks passed
@javuto javuto deleted the no-auto-tag-tls branch October 21, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

osctrl-tls osctrl-tls related changes 🏷️ tags Tags related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants