Repository navigation
Pick up change-primary and per-instance state from ld main - #236
Merged
Merged
Conversation
Re-vendors specs/hosted-v1.yaml from ld main (0f750e88e6a). dolthub-v2.yaml is unchanged there, so v2 is untouched. Most of the month's spec work was already vendored by fc96066 and 362a1c9; what is left is three things. POST /deployments/{owner}/{deployment}/change-primary changePrimary plus ChangePrimaryRequest. Deployment-tagged, 202 with an OperationRef, so no new page or nav entry — in the overview it takes a table row and a paragraph in long-running work. DeploymentInstance gains a required `state`, with a DeploymentInstanceState enum behind it. That makes models.md 47 schemas to 49, and it falsifies a standing claim in the overview: instance changes were documented as the case with no per-instance state to poll, observed only by an instance gaining a `host` or leaving the list. Both are now followed by `state`, which is also what the spec's own add and remove descriptions were rewritten to say. A 403 response was added to fourteen existing operations across all four tag pages. user.md, operation.md, and pull-request.md change by nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Re-vendors
specs/hosted-v1.yamlfrom ld main (0f750e88e6a) and regenerates.dolthub-v2.yamlis unchanged there, so v2 is untouched.Most of the month's spec work — operations, backups, database versions, reboot, Dolt credentials — was already vendored by
fc96066and362a1c9. Three things remain.1. One new endpoint
/api/v1/deployments/{owner}/{deployment}/change-primarychangePrimaryplus
ChangePrimaryRequest. Deployment-tagged,202with anOperationRef, so no new page or nav entry — in the overview it takes a table row and a paragraph in long-running work. The paragraph covers the two things the operation alone won't tell you: it needs admin, Hosted rejects acurrent_primary_idthat is no longer the primary (so a request built from a stale read can't undo a newer change), and Hosted picks the replacement, sosucceededmeans the switch happened but not what it landed on — the instance list is what says which instance is primary now.2. Instances now carry their own state
DeploymentInstancegains a requiredstate, backed by a newDeploymentInstanceStateenum. models.md goes 47 → 49 schemas.This falsifies a standing claim in the overview. Instance changes were documented as the case with no per-instance state to poll — observed only by an instance gaining a
host, or by its leaving the list. Both are now followed bystate, which is what the spec's own add and remove descriptions were rewritten to say.3. A 403 hardening pass
403 Forbiddenadded to fourteen existing operations across all four tag pages.user.md,operation.md, andpull-request.mdchange by nothing else.Verification
npm run build:doltsucceeds;check-content-frontmatterpasses#changePrimary,#model-changeprimaryrequest,#model-deploymentinstancestateresolve in the built HTML, and the overview link points at the firstOne spec bug this surfaces — not fixable here
changePrimary's description tells callers to poll the operation "until it reportsSUCCEEDED,FAILED, orEXPIRED", and that "when it reportsSUCCEEDED, the primary change has completed".OperationStatusnever takes those values — it isqueued,running,succeeded,failed.EXPIREDandFAILEDareOperationErrorCodevalues, carried onerror.codeoncestatusis alreadyfailed.So a client written against that sentence polls for a status that never arrives. Every other operation-returning endpoint describes this correctly, and so does the
Operationmodel.The fix belongs in ld's
v1.yaml, since this repo only vendors it — I have the change prepared and will open it on request.🤖 Generated with Claude Code