fix: add missing DELETE endpoint for skills#286
fix: add missing DELETE endpoint for skills#286timflannagan merged 6 commits intoagentregistry-dev:mainfrom
Conversation
|
please update the PR template and add tests (probably e2e would make sense -- we have some skill tests already in the e2e folder) |
peterj
left a comment
There was a problem hiding this comment.
please update the PR template and add tests (probably e2e would make sense -- we have some skill tests already in the e2e folder)
|
PR template updated. I'll add e2e tests - looking at the existing e2e/skill tests as a pattern. |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
1 similar comment
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
Both items addressed:
|
|
Done in 24d3b34: added |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
2 similar comments
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
@peterj Updated per your feedback:
All three e2e tests together cover: publish -> verify exists -> delete via CLI -> confirm 404 -> idempotent re-delete fails -> direct HTTP DELETE on non-existent returns 404. |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
1 similar comment
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
inFocus7
left a comment
There was a problem hiding this comment.
overall lgtm, two small requests and then it's good on my end
|
|
||
| // TestSkillDelete tests publishing a skill and then deleting it via the | ||
| // DELETE /v0/skills/{name}/versions/{version} endpoint. | ||
| func TestSkillDelete(t *testing.T) { |
There was a problem hiding this comment.
can we add a test that we correctly handle promoting a previously-published skill as latest when the current latest is deleted?
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
Addressed both review items:
|
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
PR template updated, e2e tests added:
All CI checks pass. Ready for re-review. |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
1 similar comment
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
The skill delete CLI command and client were implemented but the server had no corresponding DELETE endpoint, causing 404 errors. Add the endpoint at all layers: database, service, fake registry, and API handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Publishes a skill, verifies it exists, deletes it via CLI, and confirms it returns 404 afterward. Tests the DELETE endpoint added for agentregistry-dev#223. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add two additional e2e test cases for skill deletion: - delete_again_fails: verifies that deleting an already-deleted skill returns a non-zero exit code (idempotency check) - TestSkillDeleteNotFound: verifies that the HTTP DELETE API returns 404 when targeting a skill that was never published Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The exists_before_delete test was hitting /skills/{name} which doesn't
exist - corrected to /skills/{name}/versions/{version}. Regenerated
openapi.yaml and TypeScript client to include the DELETE endpoint.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address review feedback: - Return 401/403 for auth errors instead of lumping into 404 - Add e2e test verifying latest promotion when current latest is deleted Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace deprecated --github flag with --git (renamed in agentregistry-dev#277) - Use createSkillDir helper instead of inline dir creation - Add t.Cleanup to delete remaining versions in promote test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9d764b2 to
d4f022e
Compare
timflannagan
left a comment
There was a problem hiding this comment.
Approach largely LGTM. I think we could add some unit tests here, but I can tackle in a follow-up.
|
(Had to force push to fix a merge conflict) |
Description
Adds the missing
DELETE /v0/skills/{skillName}/versions/{version}endpoint to the registry API.Motivation: The
arctl skill deleteCLI command and client were already implemented, but the server had no corresponding endpoint, causing 404 errors.What changed:
internal/registry/api/handlers/v0/skills.gowith proper huma error codes (huma.Error404NotFound,huma.Error401Unauthorized,huma.Error403Forbidden)DeleteSkill(ctx, tx, name, version)to the database layer — deletes the skill row and promotes the next latest version in a transactionDeleteSkillto service interface and fake registry for testingFixes #223
Change Type
/kind fix
Changelog
Additional Notes
Test plan
go build ./...passesgo vet -tags e2e ./e2e/...passese2e/skill_publish_test.go:TestSkillDelete: publish → verify exists → delete via CLI → confirm 404 → re-delete failsTestSkillDeletePromotesLatest: publish v0.0.1 and v0.0.2 → verify latest is v0.0.2 → delete v0.0.2 → verify latest promoted to v0.0.1TestSkillDeleteNotFound: HTTP DELETE on non-existent skill returns 404is_latestpromotion in a transaction