fix(ui-react): use plain strings for public key filter tags#6128
Merged
gustavosbarreto merged 3 commits intomasterfrom Apr 7, 2026
Merged
fix(ui-react): use plain strings for public key filter tags#6128gustavosbarreto merged 3 commits intomasterfrom
gustavosbarreto merged 3 commits intomasterfrom
Conversation
|
Claude finished @luannmoreira's task in 3m 51s —— View job Code Review CompleteReviewed 5 files across code quality, security, testing, language patterns, and architecture — no issues found. The code looks good as-is. The spec fix correctly aligns If you push additional changes and want a new review, tag |
62667f5 to
600cc53
Compare
The tags items in publicKeyFilter were referencing tag.yaml, typing them as full Tag objects. The server accepts and returns plain strings, so replace the $ref with an inline string type carrying the same constraints (minLength: 3, maxLength: 255).
normalizePublicKey was mapping Tag objects to strings on read, and
buildFilter was wrapping strings back into { name } objects on write,
working around the incorrect spec. With the spec corrected, pass
filter.tags through as-is in both directions and drop the Tag import.
Add usePublicKeys hook tests covering normalizePublicKey for both hostname and tags filter variants, and KeyDrawer tests covering filter initialization from editKey, buildFilter output for all three filter modes, and the create/update flows.
600cc53 to
4bb9b2b
Compare
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.
What
Corrected the public key filter tags to use plain
string[]instead ofTag[]objects throughout the create/update flow and the response normalization.Why
The OpenAPI spec incorrectly referenced
tag.yamlforfilter.tagsitems, which typed them as fullTagobjects. The server accepts and returns plain strings. The frontend had accumulated a workaround:normalizePublicKeymapped{ name }objects back to strings on read, andbuildFiltermapped strings to{ name }objects on write. Fixing the spec removes the need for both workarounds.Changes
publicKeyFilter.yaml: replaced$ref: tag.yamlwith an inlinestringtype (minLength: 3,maxLength: 255) to match what the server actually accepts and returnsusePublicKeys.ts: removed the{ name }unwrapping innormalizePublicKey— tags from the response are now passed through as-isKeyDrawer.tsx: removed the{ name }wrapping inbuildFilterand the now-unusedTagimport —selectedTags(alreadystring[]) is sent directlyusePublicKeys.test.ts(13 tests) andKeyDrawer.test.tsx(28 tests) covering normalization, filter initialization fromeditKey, and the correctedbuildFilteroutput for all three filter modes