Skip to content

feat(console): the tags of a resource can be edited - #477

Merged
fredpena merged 4 commits into
floci-io:mainfrom
chhil:feat/console-tags-control
Nov 21, 2026
Merged

fredpena merged 4 commits into
floci-io:mainfrom
chhil:feat/console-tags-control

Conversation

@chhil

@chhil chhil commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The updateTags capability has been advertised since the capability existed, and
the console had no way to reach it, so the tags a resource showed were the ones it
would keep. KMS declares the capability and the console never rendered it.

The resource panel now carries the control: the tags a resource has, editable,
saved through the adapter's own updateTags, which is where a key with a null
value is one whose tag is removed. The control appears only for a service whose
schema declares the capability, so a service that cannot edit its tags shows
none.

This is the shared half of the payment cryptography work, and it stands on its
own: it needs nothing from #476, and #476 needs nothing from it.

Type of change

  • Bug fix (fix:)
  • New feature / service UI (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

Area

  • Frontend (packages/frontend)
  • API / Cloud Proxy (packages/api)
  • Cloud Explorer adapter / schema
  • Build / CI / Docker

Verification

Against a local Floci core (:4566):

  • a KMS key with tags, edited in the panel: a tag's value changed, a tag added
    and a tag removed, and the key comes back with the three;
  • a resource whose service does not declare updateTags shows no control, and
    the API answers the request with 501 operation_not_supported, which is the
    error the service layer raises for an adapter without the method;
  • an unknown service answers 404;
  • the tags refresh after they are edited: the panel asks again for the resource's
    own query and for the list, which are the two that carry them.

Checks: pnpm lint, pnpm type-check, pnpm test (2904 API tests, 3 of them
new in clouds.tags.test.ts, and 321 frontend tests, 6 of them new in
resourceTags.test.ts) and pnpm build pass.

Note on the shared surface

The control lands in the shared resource panel, which the repository's rules
ask to change only for an issue that came from an accepted Discussion. The
argument for doing it directly is that the capability was already declared and
the console simply could not reach it, so this is the control the schema always
promised. Happy to split the API half out if the panel is the part that needs
the discussion.

Checklist

  • pnpm lint, pnpm type-check, pnpm test, and pnpm build pass locally
  • New or updated tests added where it makes sense (bun test in packages/api, vitest in packages/frontend)
  • No fake/mock data added: unwired states stay empty or show an explicit placeholder
  • Commit messages / PR title follow Conventional Commits
  • Layout or look-and-feel changes close an issue that came from an accepted Discussion, or this PR has none (new services through the existing views, bug fixes that restore the intended layout, and accessibility fixes are exempt)
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

The `updateTags` capability has been advertised since the capability existed,
and the console had no way to reach it, so the tags a resource showed were the
ones it would keep. KMS declares the capability and the console never rendered
it.

The resource panel now carries the control: the tags a resource has, editable,
saved through the adapter's own `updateTags`, which is where a key with a null
value is one whose tag is removed. The control appears only for a service whose
schema declares the capability, so a service that cannot edit its tags shows
none.

The tag reading and the change between the tags a resource has and the ones the
editor holds live in one place, shared with the panel that shows them.
The editor asked for a query that nothing reads, so the tags a resource showed
were the ones it had before the edit. The inspector shows the resource's own
query and the list shows the row, and both carry the tags, so both are asked
again.
@chhil
chhil force-pushed the feat/console-tags-control branch from a3d524d to 30fc241 Compare November 21, 2026 03:18
…s own

The route cast the request body to a map of tag changes without checking it,
so a body that was an array, or one whose values were not strings, reached the
cloud. The body is checked now, and a fault of the caller is refused here.

A tag named `__proto__` was lost: assigning it to a plain object reached the
inherited setter rather than making a property of the object's own. The changes
are built through a map and made into an object at the end, on both sides of the
request, so the tag is a tag.

The editor held still while it was saving, because the editor is closed when
the save succeeds: a change made while the request was in flight would have
been lost without a word.
@chhil

chhil commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

A local review of this pull request with pr-agent found three issues, and all
three were real. They are in, in 4d83c29.

The request body was not checked. The generic a request is cast to is only a
compile-time claim, so a body that was an array, or one whose values were not
strings, reached the cloud. The body is checked now, and a fault of the caller is
refused with a 400 instead of becoming an adapter error.

A tag named __proto__ was lost. Assigning it to a plain object reached the
inherited setter rather than making a property of the object's own, so the tag
never left the browser and the one that was already there could not be removed
either. The changes are built through a map and made into an object at the end,
on both sides of the request, so the tag is a tag.

The editor could be edited while it was saving. The editor is closed when
the save succeeds, so a change made while the request was in flight was lost
without a word. The controls hold still until the request is done.

Each has a test that fails without the fix: the route refuses the bodies it
should and carries a __proto__ tag as its own property, and the frontend keeps
a __proto__ tag rather than losing it.

Checks: pnpm lint, pnpm type-check, pnpm test (2906 API tests, 5 of them
in clouds.tags.test.ts, and 328 frontend tests, 7 of them in
resourceTags.test.ts) and pnpm build pass.

@chhil
chhil marked this pull request as ready for review November 21, 2026 03:51
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; all three previous findings are fixed.

Summary

Adds tag editing to the resource inspector for services that support updateTags.

  • The cloud proxy accepts tag changes for supported resources.
  • The resource inspector lets users edit tags when their service supports it.

Review note: The required greptile_confidence label could not be added because GitHub authentication is unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Inspector[Resource inspector] --> Editor[Edit tags]
  Editor --> Diff[Compare draft with starting tags]
  Diff --> API[PATCH resource tags]
  API --> Adapter[Adapter updateTags]
  Adapter --> Refresh[Refresh account detail and list]
Loading

Reviews (2) · Last reviewed commit: "fix(console): the tags editor keeps the ..." · Reviewed by Greptile

The editor compared the draft against the tags the resource has now, and a
tag that arrived while the form was open was not one the form had, so saving
sent it as a removal and deleted it. The tags the editing began with are kept
with the draft, and the comparison is against those.

The list was refreshed by a query key nothing reads, so the rows kept the tags
they had after a save. The account is captured when the save is made, so an
account switch while the request is in flight does not refresh another
account's resources.

Two rows naming the same tag are refused, with the key named: the changes
between the tags kept only the last of them, so a save could succeed and
silently drop a value the form still showed.
@fredpena

Copy link
Copy Markdown
Contributor

Thank you for this

No blockers from my side.

@fredpena
fredpena merged commit 6533b90 into floci-io:main Nov 21, 2026
7 checks passed
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.

2 participants