Skip tag creation for UUIDs, localnames and hostname#737
Merged
Conversation
Contributor
There was a problem hiding this comment.
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>
zhuoyuan-liu
approved these changes
Oct 16, 2025
Contributor
zhuoyuan-liu
left a comment
There was a problem hiding this comment.
Great change! I think the documentation for tag cleanup is the only missing part.
Collaborator
Author
|
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); |
Collaborator
Author
|
@zhuoyuan-liu ready the the review, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of #736 to skip automatic tag creation for UUIDs, localnames and hostnames.