Skip to content

Update to V2 API. - #6

Merged
enisoc merged 6 commits into
mainfrom
v2-api
Jul 19, 2022
Merged

enisoc merged 6 commits into
mainfrom
v2-api

Conversation

@enisoc

@enisoc enisoc commented Jul 18, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@scott-cotton

Copy link
Copy Markdown
Member

I've started testing it and so far it seems to work fine.

I am wondering if we should get rid of get-status since we are putting status in the get result.

@scott-cotton

Copy link
Copy Markdown
Member

Second item is perhaps we should add the list and delete cluster token functionality.

@enisoc

enisoc commented Jul 19, 2022

Copy link
Copy Markdown
Contributor Author

I am wondering if we should get rid of get-status since we are putting status in the get result.

Yeah I debated that as well while working on this. At this point, the only benefit of get-status is that it might save the user from having to extract info with jq or awk if they want to check status from their own script. It seems like a small benefit though so I say let's remove it. Even if we still want to address that use case, we probably wouldn't do it with a separate command now that get returns status info.

Second item is perhaps we should add the list and delete cluster token functionality.

I was thinking we'd just fix what's already there in the first pass, but this does seem quick so I'll add it if I get a chance.

@scott-cotton

Copy link
Copy Markdown
Member

I just accidentally put 'tags' at the top level of a sandbox json file instead of under 'spec' and it accepted the request without error and silently dropped the tags. Should we check for that kind of thing?

@enisoc

enisoc commented Jul 19, 2022

Copy link
Copy Markdown
Contributor Author

@scott-cotton I've added cluster token list/delete. PTAL.

I just accidentally put 'tags' at the top level of a sandbox json file instead of under 'spec' and it accepted the request without error and silently dropped the tags. Should we check for that kind of thing?

Do you mean like a client-side schema check to see if you're trying to set an unknown field? That seems reasonable, but we'd probably want to put some thought into it as a separate effort/feature.

@scott-cotton

Copy link
Copy Markdown
Member

@scott-cotton I've added cluster token list/delete. PTAL.

I just accidentally put 'tags' at the top level of a sandbox json file instead of under 'spec' and it accepted the request without error and silently dropped the tags. Should we check for that kind of thing?

Do you mean like a client-side schema check to see if you're trying to set an unknown field? That seems reasonable, but we'd probably want to put some thought into it as a separate effort/feature.

ok, sgtm.

@scott-cotton

Copy link
Copy Markdown
Member

do we need to merge and tag the Go-SDK before this becomes a non-draft?

@enisoc

enisoc commented Jul 19, 2022

Copy link
Copy Markdown
Contributor Author

Yes. I'm planning to do that after the API server-side release.

@enisoc
enisoc marked this pull request as ready for review July 19, 2022 18:17
@enisoc
enisoc requested review from foxish, jmsktm and scott-cotton July 19, 2022 18:35

@scott-cotton scott-cotton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@enisoc
enisoc merged commit 457541d into main Jul 19, 2022
@enisoc
enisoc deleted the v2-api branch July 19, 2022 20:38
scott-cotton added a commit that referenced this pull request May 21, 2026
…rnings)

Address findings #3, #4, #5, #6 from the versioned-resource-plugins UX pass.

#4 — apply immutable-version error: the previous code matched on
*ApplyResourcePluginConflict, but the go-sdk's transport middleware
(FixAPIErrors) intercepts every 4xx/5xx response before the per-endpoint
typed reader runs, so that type is never in the error chain and the
catch-and-rewrite was dead code. Users saw the generic '409 Conflict:
plugin version already exists'. Switch to errors.As against
*transport.APIError + Code==409 (the same pattern used in planexec/logs).

Also #11 — branch the message text on the bare-name vs. concrete-version
case: a bare-name author has no '@semver' suffix to bump, so the
'bump the version field' advice was a dead end; now they get a concrete
'add an @<semver> suffix to publish a new revision (e.g. [email protected])'.

#5 — apply success line: previously stayed silent on the version for
bare-name authors ('Created resource plugin my-plugin') while
explicit-version authors saw '@0.0.1'. The asymmetry hid the versioning
rule from exactly the population that most needed to learn it. Always
echo the explicit version on the apply success line (rendering '@0.0.0'
for bare publishes). The list/table/get-yaml output continues to bare
the default version for backward compatibility with pre-versioning
clients — this one message is explicit on purpose, as a teaching moment.

#3 — bare-form delete: previously silently removed only the latest
version with no indication that others remained, a footgun for users
who assumed 'delete my-plugin' meant 'delete the plugin'. Resolve the
latest version explicitly before the delete (one List call), then
report which version was removed and how many remain, e.g.
'Deleted resource plugin [email protected].
 1 other version(s) remain (use 'signadot resourceplugin versions my-plugin' to list).'

#6 — delete-in-use: previously surfaced the server's generic
'400 Bad Request: plugin is currently in use' with no hint about which
sandbox(es) were holding the version. Enrich client-side: on that
specific 400 we GET the plugin and surface Status.Resources sandbox
names: 'resource plugin [email protected] is still referenced by sandbox(es): a, b'.
Falls back to the original error if the enrichment can't be done.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@scott-cotton scott-cotton mentioned this pull request May 21, 2026
2 of 6 tasks
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