Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: reinitialize agents when a prebuilt workspace is claimed#17475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SasSwart merged 49 commits intomainfromjjs/prebuilds-agent-reinit
May 14, 2025

Conversation

SasSwart
Copy link
Contributor

This pull request allows coder workspace agents to be reinitialized when a prebuilt workspace is claimed by a user. This facilitates the transfer of ownership between the anonymous prebuilds system user and the new owner of the workspace.

Only a single agent per prebuilt workspace is supported for now, but plumbing has already been done to facilitate the seamless transition to multi-agent support.

@SasSwartSasSwart changed the titleWIP: agent reinitializationfeat: reinitialize agents when a prebuilt workspace is claimedApr 21, 2025
@SasSwartSasSwartforce-pushed thejjs/prebuilds-agent-reinit branch from35e4bf8 to18da76eCompareApril 23, 2025 13:49
@SasSwartSasSwartforce-pushed thejjs/prebuilds-agent-reinit branch fromcc25406 to26dbc3aCompareApril 24, 2025 12:34
Base automatically changed fromyevhenii/512-claim-prebuild tomainApril 24, 2025 13:39
@SasSwartSasSwartforce-pushed thejjs/prebuilds-agent-reinit branch fromec9ed29 to362db7cCompareApril 25, 2025 08:32
}

func StreamAgentReinitEvents(ctx context.Context, logger slog.Logger, rw http.ResponseWriter, r *http.Request, reinitEvents <-chan agentsdk.ReinitializationEvent) {
sseSendEvent, sseSenderClosed, err := httpapi.ServerSentEventSender(rw, r)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We can fix this later, but I think this might be inappropriate at this layer.
This seems like a detail of the HTTP API, and we aren't testing this directly so I'd argue this code could go back tocoderd/workspaceagents.go.

Copy link
Contributor

@spikecurtisspikecurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The biggest remaining issue is around back compatibility for old versions of the provisionerd server.

dannykopping added a commit that referenced this pull requestMay 12, 2025
…17757)Used in combination withcoder/terraform-provider-coder#396This is required by both#17475 and#17571Operators may need to conditionalize their templates to perform certainoperations once a prebuilt workspace has been claimed. This value will**only** be set once a claim takes place and a subsequent `terraformapply` occurs. Any `terraform apply` runs thereafter will beindistinguishable from a normal run on a workspace.---------Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Let's get this merged now, Sas. Based on the discussion we had yesterday, we can work on improvements iteratively 👍

@SasSwartSasSwart merged commit425ee6f intomainMay 14, 2025
39 checks passed
@SasSwartSasSwart deleted the jjs/prebuilds-agent-reinit branchMay 14, 2025 12:15
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 14, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

@johnstcnjohnstcnjohnstcn left review comments

@spikecurtisspikecurtisspikecurtis left review comments

@mtojekmtojekmtojek approved these changes

Assignees

@SasSwartSasSwart

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@SasSwart@dannykopping@johnstcn@spikecurtis@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp