Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit db3edcf

Browse files
committed
Revert "feat(cli): AutoStart education notice [ch7441] (#236)"
This reverts commit dd7b3a9. This commit should be re-reverted once the feature is readied from the internal stage.
1 parent 80ea15e commit db3edcf

File tree

4 files changed

+28
-58
lines changed

4 files changed

+28
-58
lines changed

coder-sdk/env.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,16 @@ const (
7474

7575
// CreateEnvironmentRequest is used to configure a new environment.
7676
type CreateEnvironmentRequest struct {
77-
Name string `json:"name"`
78-
ImageID string `json:"image_id"`
79-
OrgID string `json:"org_id"`
80-
ImageTag string `json:"image_tag"`
81-
CPUCores float32 `json:"cpu_cores"`
82-
MemoryGB float32 `json:"memory_gb"`
83-
DiskGB int `json:"disk_gb"`
84-
GPUs int `json:"gpus"`
85-
Services []string `json:"services"`
86-
UseContainerVM bool `json:"use_container_vm"`
87-
EnableAutoStart bool `json:"autostart_enabled"`
77+
Name string `json:"name"`
78+
ImageID string `json:"image_id"`
79+
OrgID string `json:"org_id"`
80+
ImageTag string `json:"image_tag"`
81+
CPUCores float32 `json:"cpu_cores"`
82+
MemoryGB float32 `json:"memory_gb"`
83+
DiskGB int `json:"disk_gb"`
84+
GPUs int `json:"gpus"`
85+
Services []string `json:"services"`
86+
UseContainerVM bool `json:"use_container_vm"`
8887
}
8988

9089
// CreateEnvironment sends a request to create an environment.

docs/coder_envs_create.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
2424
--container-based-vm deploy the environment as a Container-based VM
2525
-c, --cpu float32 number of cpu cores the environment should be provisioned with.
2626
-d, --disk int GB of disk storage an environment should be provisioned with.
27-
--enable-autostart automatically start this environment at your preferred time.
2827
--follow follow buildlog after initiating rebuild
2928
-g, --gpus int number GPUs an environment should be provisioned with.
3029
-h, --help help for create

internal/cmd/envs.go

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"os"
1212

1313
"cdr.dev/coder-cli/coder-sdk"
14-
"cdr.dev/coder-cli/internal/config"
1514
"cdr.dev/coder-cli/internal/x/xcobra"
1615
"cdr.dev/coder-cli/pkg/clog"
1716
"cdr.dev/coder-cli/pkg/tablewriter"
@@ -152,16 +151,15 @@ coder envs --user [email protected] ls -o json \
152151

153152
func createEnvCmd() *cobra.Command {
154153
var (
155-
org string
156-
cpu float32
157-
memory float32
158-
disk int
159-
gpus int
160-
img string
161-
tag string
162-
follow bool
163-
useCVM bool
164-
enableAutostart bool
154+
org string
155+
cpu float32
156+
memory float32
157+
disk int
158+
gpus int
159+
img string
160+
tag string
161+
follow bool
162+
useCVM bool
165163
)
166164

167165
cmd := &cobra.Command{
@@ -172,9 +170,6 @@ func createEnvCmd() *cobra.Command {
172170
Example: `# create a new environment using default resource amounts
173171
coder envs create my-new-env --image ubuntu
174172
coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ubuntu`,
175-
PreRun: func(cmd *cobra.Command, args []string) {
176-
autoStartInfo()
177-
},
178173
RunE: func(cmd *cobra.Command, args []string) error {
179174
ctx := cmd.Context()
180175
if img == "" {
@@ -205,16 +200,15 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
205200

206201
// ExactArgs(1) ensures our name value can't panic on an out of bounds.
207202
createReq := &coder.CreateEnvironmentRequest{
208-
Name: args[0],
209-
ImageID: importedImg.ID,
210-
OrgID: importedImg.OrganizationID,
211-
ImageTag: tag,
212-
CPUCores: cpu,
213-
MemoryGB: memory,
214-
DiskGB: disk,
215-
GPUs: gpus,
216-
UseContainerVM: useCVM,
217-
EnableAutoStart: enableAutostart,
203+
Name: args[0],
204+
ImageID: importedImg.ID,
205+
OrgID: importedImg.OrganizationID,
206+
ImageTag: tag,
207+
CPUCores: cpu,
208+
MemoryGB: memory,
209+
DiskGB: disk,
210+
GPUs: gpus,
211+
UseContainerVM: useCVM,
218212
}
219213

220214
// if any of these defaulted to their zero value we provision
@@ -258,7 +252,6 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
258252
cmd.Flags().StringVarP(&img, "image", "i", "", "name of the image to base the environment off of.")
259253
cmd.Flags().BoolVar(&follow, "follow", false, "follow buildlog after initiating rebuild")
260254
cmd.Flags().BoolVar(&useCVM, "container-based-vm", false, "deploy the environment as a Container-based VM")
261-
cmd.Flags().BoolVar(&enableAutostart, "enable-autostart", false, "automatically start this environment at your preferred time.")
262255
_ = cmd.MarkFlagRequired("image")
263256
return cmd
264257
}
@@ -391,9 +384,6 @@ func editEnvCmd() *cobra.Command {
391384
Example: `coder envs edit back-end-env --cpu 4
392385
393386
coder envs edit back-end-env --disk 20`,
394-
PreRun: func(cmd *cobra.Command, args []string) {
395-
autoStartInfo()
396-
},
397387
RunE: func(cmd *cobra.Command, args []string) error {
398388
ctx := cmd.Context()
399389
client, err := newClient(ctx)
@@ -621,18 +611,3 @@ func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf)
621611
}
622612
return &updateReq, nil
623613
}
624-
625-
// TODO (Grey): Remove education in a future non-patch release.
626-
func autoStartInfo() {
627-
var preferencesURI string
628-
629-
accessURI, err := config.URL.Read()
630-
if err != nil {
631-
// Error is fairly benign in this case, fallback to relative URI
632-
preferencesURI = "/preferences"
633-
} else {
634-
preferencesURI = fmt.Sprintf("%s%s", accessURI, "/preferences?tab=autostart")
635-
}
636-
637-
clog.LogInfo("⚡NEW: Automate daily environment startup", "Visit "+preferencesURI+" to configure your preferred time")
638-
}

internal/cmd/rebuild.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ func rebuildEnvCommand() *cobra.Command {
2929
Args: xcobra.ExactArgs(1),
3030
Example: `coder envs rebuild front-end-env --follow
3131
coder envs rebuild backend-env --force`,
32-
PreRun: func(cmd *cobra.Command, args []string) {
33-
autoStartInfo()
34-
},
3532
RunE: func(cmd *cobra.Command, args []string) error {
3633
ctx := cmd.Context()
3734
client, err := newClient(ctx)

0 commit comments

Comments
 (0)