Repository navigation
Move sandbox reset and address bindings into deployment and deploymentpg - #332
Merged
Merged
Conversation
The reset becomes deployment use cases on ExecutionOperations: start or escalate, cancel, advance the auto deadline and complete, each a Load, Decide and Apply transaction on the execution lease. DeploymentTx gains the reset writes, the stored starter source and RecordAuditAs, so the deadline and completion audit as the administrator who started the reset. Completion in use is deployment.InUseError. The Worker lists the Sessions a reset still has to archive through the required Dispatcher.DeploymentReader; the per-Session archive stays in store. Address bindings are deployment.Service.AddressBindings, read in one snapshot against the public URL the service was built with, and serve the installation page. api maps reset and in-use errors in writeSandboxError, and the OpenAPI schemas become deployment.ResetRequest and deployment.AddressBindings.
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.
Sandbox reset and the installation address bindings move out of
storeintodeploymentanddeploymentpg.What changes
deployment:ResetRequest,ResetAuto/ResetForce, and the deadline boundsMinResetDeadlineSeconds/MaxResetDeadlineSeconds.InUseError, which unwraps toErrConflict.ExecutionOperationsuse casesStartReset,CancelReset,AdvanceResetDeadlineandCompleteReset.Reader.ResetSessionsandReader.AddressBindings.Service.AddressBindings, so the public URL keeps its single home in the Service.deploymentpg:DeploymentTxgains the reset start, force, cancel, complete and audit-source methods. The audit source has one decoder,ResetSource.AddressBindingsreads both counts in one snapshot.Owner.Deployment.Dispatcher.DeploymentReaderfield is required.writeDeploymentErrorand thedeploymentrule constants.writeSandboxErrormapsInUseErrorto 409sandbox_in_use.writeStoreErrorstays as the composite (reset admission → sandbox → sessions) until the error-mapper cleanup.store:sandbox_reset.goandsandboxResetAudit. Reset admission and the reset's Session archive stay instoreuntil their own PRs.deployment.ResetRequestanddeployment.AddressBindings, regenerated withmake openapi.Behavior
The HTTP status, code, message and details of every reset and installation route are unchanged. Reset validation now returns
deployment.ErrInvalidInput, which still maps to the same 400invalid_request. A stored reset source that cannot be decoded is an internal error in the reset loop, including in the archive step. No HTTP caller can reach it.Checks
go build ./...andgo vet ./services/core/....deploymentanddeploymentpgin full (PostgreSQL, no skips), including:-run 'TestStartWorker|TestWorkerRunClosesLeaseAfterDrain|Reset'.-runover the reset, archive and dispatch tests.-run '^TestSandbox|Installation', andcmd/server.make openapiproduces no diff, andscripts/check-names.pypasses.A blind review found no blockers or majors. Its minor findings are fixed in this commit.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.