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

fix!: stop workspace before update#18425

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

Open
johnstcn wants to merge17 commits intomain
base:main
Choose a base branch
Loading
fromcj/prebuild-template-upgrade

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedJun 18, 2025
edited
Loading

Fixes#17840

NOTE: calling this out as a breaking change so that it is highly visible in the changelog.

  • CLI: Modifiescoder update to stop the workspace if already running.
  • UI: Modifies "update" button to always stop the workspace if already running.

@johnstcnjohnstcn changed the titleCj/prebuild template upgradefix: stop workspace before updateJun 18, 2025
@johnstcnjohnstcn changed the titlefix: stop workspace before updatefix!: stop workspace before updateJun 18, 2025
@johnstcnjohnstcnforce-pushed thecj/prebuild-template-upgrade branch from42420b1 tofa2d4ebCompareJune 18, 2025 15:17
@johnstcnjohnstcn added the release/breakingThis label is applied to PRs to detect breaking changes as part of the release process labelJun 18, 2025
@dannykoppingdannykopping self-requested a reviewJune 19, 2025 09:04
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

No notes, awesome work@johnstcn 💪

@johnstcnjohnstcnforce-pushed thecj/prebuild-template-upgrade branch fromce577e1 toda8bd12CompareJune 19, 2025 15:15
@@ -1245,16 +1245,16 @@ func CreateWorkspace(t testing.TB, client *codersdk.Client, templateID uuid.UUID
}

// TransitionWorkspace is a convenience method for transitioning a workspace from one state to another.
func MustTransitionWorkspace(t testing.TB, client *codersdk.Client, workspaceID uuid.UUID, from, todatabase.WorkspaceTransition, muts ...func(req *codersdk.CreateWorkspaceBuildRequest)) codersdk.Workspace {
func MustTransitionWorkspace(t testing.TB, client *codersdk.Client, workspaceID uuid.UUID, from, tocodersdk.WorkspaceTransition, muts ...func(req *codersdk.CreateWorkspaceBuildRequest)) codersdk.Workspace {
Copy link
MemberAuthor

@johnstcnjohnstcnJun 20, 2025
edited
Loading

Choose a reason for hiding this comment

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

review: This is annoying to have as a database type, so migrated to use the codersdk type instead. This inflated the diff a bit but removes an unnecessary conversion.

aslilac reacted with thumbs up emoji
@johnstcnjohnstcn marked this pull request as ready for reviewJune 20, 2025 14:33
@johnstcnjohnstcn requested a review fromaslilacJune 20, 2025 14:34
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

The react code looks good

I took a bit of a closer look this time tho, and I'm wondering if this should be handled by the backend rather than the clients? The CLI and the frontend are now both responsible for producing this behavior correctly, and I worry about them getting out of sync or needing to add this in even more places, like the VSCode extension or the JetBrains plugin.

@@ -2274,6 +2275,19 @@ class ApiMethods {
throw new MissingBuildParameters(missingParameters, activeVersionId);
}

// Stop the workspace if it is already running.
Copy link
Member

Choose a reason for hiding this comment

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

hmm. I'm a bit worried about adding this directly inside theAPI method. most everything in here is 1:1 with a backend endpoint, occasionally with minimal logic to convert from an options object to a query string or whatever. but this is actual application logic leaking in here.

@johnstcn
Copy link
MemberAuthor

I'm wondering if this should be handled by the backend rather than the clients? The CLI and the frontend are now both responsible for producing this behavior correctly, and I worry about them getting out of sync or needing to add this in even more places, like the VSCode extension or the JetBrains plugin.

Yeah, that's a valid concern. The main difficulty there is that there's no 'restart' transition in our current workspace transition model. Ideally we would have something like a 'restart' type provisioner job that would handle both the stop and start stages (or maybe perform a stop and enqueue a start build upon completion). I'd like us to do that eventually as it would greatly simplify the whole implementation here and let us model both restart and update as the same kind of state transition.

Would you be OK with making this a follow-up item in the interest of expediency?

@dannykopping
Copy link
Contributor

I'm wondering if this should be handled by the backend rather than the clients? The CLI and the frontend are now both responsible for producing this behavior correctly, and I worry about them getting out of sync or needing to add this in even more places, like the VSCode extension or the JetBrains plugin.

Yeah, that's a valid concern. The main difficulty there is that there's no 'restart' transition in our current workspace transition model. Ideally we would have something like a 'restart' type provisioner job that would handle both the stop and start stages (or maybe perform a stop and enqueue a start build upon completion). I'd like us to do that eventually as it would greatly simplify the whole implementation here and let us model both restart and update as the same kind of state transition.

Would you be OK with making this a follow-up item in the interest of expediency?

#14857

I vote for later, but soon™️

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@aslilacaslilacaslilac left review comments

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@johnstcnjohnstcn

Labels
release/breakingThis label is applied to PRs to detect breaking changes as part of the release process
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

bug: template upgrade fails on claimed prebuilt workspace
3 participants
@johnstcn@dannykopping@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp