Skip to content

feat(cli): prevent coder schedule command on prebuilt workspaces #19259

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: improve test cases names
  • Loading branch information
ssncferreira committed Aug 12, 2025
commit cc872b98e406e95a259a299607e250d8b7284f6b
6 changes: 3 additions & 3 deletions enterprise/cli/prebuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,21 +387,21 @@ func TestSchedulePrebuilds(t *testing.T) {
cmdArgs func(string) []string
}{
{
name: "Autostart",
name: "AutostartPrebuildError",
cliErrorMsg: "autostart configuration is not supported for prebuilt workspaces",
cmdArgs: func(workspaceName string) []string {
return []string{"schedule", "start", workspaceName, "7:30AM", "Mon-Fri", "Europe/Lisbon"}
},
},
{
name: "Autostop",
name: "AutostopPrebuildError",
cliErrorMsg: "autostop configuration is not supported for prebuilt workspaces",
cmdArgs: func(workspaceName string) []string {
return []string{"schedule", "stop", workspaceName, "8h30m"}
},
},
//{
// name: "Extend",
// name: "ExtendPrebuildError",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is failing because the workspace must have a deadline set in order to extend it. Currently, when a prebuild is claimed, its TTL is not set. This is addressed in PR: https://github.com/coder/coder/pull/19252/files#diff-4afb9f17accf40c5774d38a2fcec29fd71caeddca73dff6e37626623eebaaf50R10

// cliErrorMsg: "extend configuration is not supported for prebuilt workspaces",
// cmdArgs: func(workspaceName string) []string {
// return []string{"schedule", "extend", workspaceName, "90m"}
Expand Down
Loading