Repository navigation
fix: send the slug on update so the API can refuse a rename - #4
Open
Alex (Alexkuva) wants to merge 1 commit into
Open
Alex (Alexkuva) wants to merge 1 commit into
Alex (Alexkuva) wants to merge 1 commit into
Conversation
Customers, deployment zones, entitlements, entitlement groups, licenses and service accounts are never renamed. Their PUT accepts the current slug and refuses any other with a 422, <Operation>.SlugNotRenameable. Their update payloads dropped Slug, so a rename returned success and left the old slug in place without a word. The six update payloads now send Slug when it is set, so the refusal reaches the caller as an *Error carrying the code. The current slug is still accepted, so writing back what was read keeps working, and an input with no slug still renders none. Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
backtrack5r3 (tomflenner)
approved these changes
Oct 8, 2026
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.
Problem
Customers, deployment zones, entitlements, entitlement groups, licenses and service accounts are never renamed. Their
PUTaccepts the current slug and refuses any other with a 422,<Operation>.SlugNotRenameable.The SDK's update payloads for those six dropped
Slug. A rename request therefore returned success and left the old slug in place without a word. Found through the CLI on noprod:kaiten entitlements update webhook-2bb271 --slug webhookprinted "Entitlement updated" and exited 0, while the same body sent with curl came back422 UpdateEntitlement.SlugNotRenameable.Change
Slugwhen it is set (omitempty), so the API decides and its refusal reaches the caller as an*sdk.ErrorwithCodeset. The six update bodies inapp/openapi.yaml(Customer,DeploymentZone,EntitlementGroup,Entitlement,License,ServiceAccount) all publishslug.slugkey.Slugdoc comments, the license payload comment and the README say what the field does on update.Tests
TestUpdateLetsTheAPIRefuseARenameruns the six updates against a responder that applies the API's rule. Another slug must surface the 422 and its code, the current slug must succeed, and a nil slug must render no key. Onmain, all six "refuses another slug" cases fail.TestRequestBodiesMatchTheirSpecBodiesnow expectsslugin the six update bodies.task lint: 0 issues.go test -race ./...: green.Follow-up
Once this is released, the CLI bumps
sdk-go. Its--fileand--payloadupdates will then report the refusal too (kaitencloud/cli, separate PR).🤖 Generated with Claude Code · ✅ Tested and approved by Alex (@Alexkuva), maintainer