Skip to content

Commit faebe2e

Browse files
committed
chore: rename package autostart/lifecycle to lifecycle/executor
1 parent 0931d25 commit faebe2e

File tree

9 files changed

+13
-14
lines changed

9 files changed

+13
-14
lines changed

cli/autostart.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/spf13/cobra"
99

10-
"github.com/coder/coder/coderd/autostart/schedule"
10+
"github.com/coder/coder/coderd/lifecycle/schedule"
1111
"github.com/coder/coder/codersdk"
1212
)
1313

cli/autostop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/spf13/cobra"
99

10-
"github.com/coder/coder/coderd/autostart/schedule"
10+
"github.com/coder/coder/coderd/lifecycle/schedule"
1111
"github.com/coder/coder/codersdk"
1212
)
1313

coderd/coderdtest/coderdtest.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import (
2424
"testing"
2525
"time"
2626

27-
"github.com/coder/coder/coderd/autostart/lifecycle"
28-
2927
"cloud.google.com/go/compute/metadata"
3028
"github.com/fullsailor/pkcs7"
3129
"github.com/golang-jwt/jwt"
@@ -43,6 +41,7 @@ import (
4341
"github.com/coder/coder/coderd/database/databasefake"
4442
"github.com/coder/coder/coderd/database/postgres"
4543
"github.com/coder/coder/coderd/gitsshkey"
44+
"github.com/coder/coder/coderd/lifecycle/executor"
4645
"github.com/coder/coder/coderd/turnconn"
4746
"github.com/coder/coder/codersdk"
4847
"github.com/coder/coder/cryptorand"
@@ -105,7 +104,7 @@ func New(t *testing.T, options *Options) *codersdk.Client {
105104
}
106105

107106
ctx, cancelFunc := context.WithCancel(context.Background())
108-
lifecycleExecutor := lifecycle.NewExecutor(
107+
lifecycleExecutor := executor.New(
109108
ctx,
110109
db,
111110
slogtest.Make(t, nil).Named("lifecycle.executor").Leveled(slog.LevelDebug),

coderd/autostart/lifecycle/lifecycle_executor.go renamed to coderd/lifecycle/executor/lifecycle_executor.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lifecycle
1+
package executor
22

33
import (
44
"context"
@@ -7,8 +7,8 @@ import (
77

88
"cdr.dev/slog"
99

10-
"github.com/coder/coder/coderd/autostart/schedule"
1110
"github.com/coder/coder/coderd/database"
11+
"github.com/coder/coder/coderd/lifecycle/schedule"
1212

1313
"github.com/google/uuid"
1414
"github.com/moby/moby/pkg/namesgenerator"
@@ -23,8 +23,8 @@ type Executor struct {
2323
tick <-chan time.Time
2424
}
2525

26-
// NewExecutor returns a new instance of Executor.
27-
func NewExecutor(ctx context.Context, db database.Store, log slog.Logger, tick <-chan time.Time) *Executor {
26+
// New returns a new lifecycle executor.
27+
func New(ctx context.Context, db database.Store, log slog.Logger, tick <-chan time.Time) *Executor {
2828
le := &Executor{
2929
ctx: ctx,
3030
db: db,

coderd/autostart/lifecycle/lifecycle_executor_test.go renamed to coderd/lifecycle/executor/lifecycle_executor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package lifecycle_test
1+
package executor_test
22

33
import (
44
"context"
55
"testing"
66
"time"
77

8-
"github.com/coder/coder/coderd/autostart/schedule"
98
"github.com/coder/coder/coderd/coderdtest"
109
"github.com/coder/coder/coderd/database"
10+
"github.com/coder/coder/coderd/lifecycle/schedule"
1111
"github.com/coder/coder/codersdk"
1212

1313
"github.com/google/uuid"

coderd/autostart/schedule/schedule_test.go renamed to coderd/lifecycle/schedule/schedule_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/stretchr/testify/require"
88

9-
"github.com/coder/coder/coderd/autostart/schedule"
9+
"github.com/coder/coder/coderd/lifecycle/schedule"
1010
)
1111

1212
func Test_Weekly(t *testing.T) {

coderd/workspaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"github.com/moby/moby/pkg/namesgenerator"
1414
"golang.org/x/xerrors"
1515

16-
"github.com/coder/coder/coderd/autostart/schedule"
1716
"github.com/coder/coder/coderd/database"
1817
"github.com/coder/coder/coderd/httpapi"
1918
"github.com/coder/coder/coderd/httpmw"
19+
"github.com/coder/coder/coderd/lifecycle/schedule"
2020
"github.com/coder/coder/codersdk"
2121
)
2222

coderd/workspaces_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/google/uuid"
1111
"github.com/stretchr/testify/require"
1212

13-
"github.com/coder/coder/coderd/autostart/schedule"
1413
"github.com/coder/coder/coderd/coderdtest"
1514
"github.com/coder/coder/coderd/database"
15+
"github.com/coder/coder/coderd/lifecycle/schedule"
1616
"github.com/coder/coder/codersdk"
1717
"github.com/coder/coder/provisioner/echo"
1818
"github.com/coder/coder/provisionersdk/proto"

0 commit comments

Comments
 (0)