Repository navigation
🤖 refactor: share workspace provenance, readiness, delete, and 429 backoff steps - #255
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
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.
Summary
This refactor changes no behavior. The workspace steps of the
CoderTemplateTestcontroller move intointernal/controller/coder_workspace_steps.go, so the upcomingCoderWorkspacePoolcontrollers can call the same code. These steps are provenance after an uncertain create, the readiness rules for one build, the delete step, and the HTTP 429 backoff. TheCoderTemplateTestreconciler now calls them through thin wrappers. No test file changed.Refs #153
Background
This is PR 3 of the
CoderWorkspacePoolstack (#153), after #250 (shared owner and template lookups). A pool member creates, confirms, waits for, and deletes one workspace. It needs the crash-safety rules thatCoderTemplateTestalready proves in envtest and Kind:Before, these rules read and wrote
CoderTemplateTeststatus fields directly. Now they take the pinned IDs, one build, or a small state struct.Implementation
coder_workspace_steps.go:workspaceProvenance(ctx, sdk, workspace, operatorID, organizationID, templateID, templateVersionID)provenanceworkspaceBuildReadiness(build, name) *coderStepcheckReadinessCoderTemplateTest.deleteCoderWorkspace(ctx, sdk, *workspaceDeleteState, now, countEveryFailure)deleteStepworkspaceDeleteState(workspace ID and name, delete build ID, attempts).countEveryFailureis the oldafterPassrule.coderDeleteRetryAt,coderDeleteBackofftemplateTestDeleteRetryAt,templateTestDeleteBackoffcoderBackoff{next, forget}retryAfterand the reconciler'ssync.MapcoderBuildPoll(5 s)templateTestRunningPolltemplateTestRunningPollis now defined ascoderBuildPoll.Also:
coderAnswerFor,isCoderNotFound,coderStatus, andcoderErrorSummarymove fromcodertemplatetest_controller.gotocoder_access.go. Another controller already calls them (🤖 feat: add the CoderAIProvider reconciler skeleton #245). I did not mergecontrolPlaneWaitintocoderStep, because that would edit theCoderAIProvidercontroller of the parallel stack.deleteStepkeeps its assertion and copies the state back into status. Every write happens where it did before.e2epaths filter now listscoder_workspace_steps.go, so this shared code also gets the full Kind E2E on pull requests.Validation
CoderTemplateTestenvtest passes unchanged, with and without-race. No test file changed.CoderTemplateTesttests, unchanged by this PR:BuildFailedfor a failed build without an error code. The reason staysBuildFailed, so only the message text changes.Risks
Low. The moved code drives
CoderTemplateTestconfirm, readiness, and cleanup. A mistake would show as a wrong reason, a leaked test workspace, or a wrong retry time. The unchanged envtests, the mutation checks, and the full Kind E2E cover these paths.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$47.06