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: add inactivity cleanup and failure cleanup configuration fields to Template Schedule Form#7402

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
Kira-Pilot merged 24 commits intomainfromworkspace-actions-template-route/kira-pilot
May 5, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
24 commits
Select commitHold shift + click to select a range
744e476
added workspace actions entitlement
Kira-PilotMay 1, 2023
e6e1ec6
added workspace actions experiment
Kira-PilotMay 1, 2023
c049e9e
added new route for template enterprise meta
Kira-PilotMay 3, 2023
537ced7
removing new route; repurposing old
Kira-PilotMay 3, 2023
cd6a485
add new fields to get endpoints
Kira-PilotMay 3, 2023
6c984fa
Merge remote-tracking branch 'origin/main' into workspace-actions-tem…
Kira-PilotMay 3, 2023
57a9de7
removed workspace actions experiment
Kira-PilotMay 3, 2023
07cb07c
added logic to enterprise template store
Kira-PilotMay 3, 2023
7091fc1
added new form fields
Kira-PilotMay 3, 2023
e565225
feature flagged new fields
Kira-PilotMay 3, 2023
3d9f6f5
fix validation
Kira-PilotMay 4, 2023
abab4c8
fixed submit btn
Kira-PilotMay 4, 2023
ad37203
Merge remote-tracking branch 'origin/main' into workspace-actions-tem…
Kira-PilotMay 4, 2023
240f297
fix tests
Kira-PilotMay 4, 2023
be512ee
changed ttl defaults
Kira-PilotMay 4, 2023
8536b75
added FE tests
Kira-PilotMay 4, 2023
a05eb6c
added BE tests
Kira-PilotMay 4, 2023
0478e07
fixed lint
Kira-PilotMay 4, 2023
bba4722
adjusted comment language
Kira-PilotMay 4, 2023
c76a0f4
fixing unstaged changes check
Kira-PilotMay 4, 2023
9db6b13
fix test
Kira-PilotMay 4, 2023
a2a38f0
Merge branch 'main' into workspace-actions-template-route/kira-pilot
Kira-PilotMay 4, 2023
9fa9c5b
Update coderd/database/migrations/000122_add_template_cleanup_ttls.do…
Kira-PilotMay 5, 2023
43a2267
Update coderd/database/migrations/000122_add_template_cleanup_ttls.up…
Kira-PilotMay 5, 2023
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
1 change: 1 addition & 0 deletions.vscode/settings.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
"Dsts",
"embeddedpostgres",
"enablements",
"enterprisemeta",
"errgroup",
"eventsourcemock",
"Failf",
Expand Down
15 changes: 15 additions & 0 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

15 changes: 15 additions & 0 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 2 additions & 0 deletionscoderd/database/dbfake/databasefake.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1945,6 +1945,8 @@ func (q *fakeQuerier) UpdateTemplateScheduleByID(_ context.Context, arg database
tpl.UpdatedAt = database.Now()
tpl.DefaultTTL = arg.DefaultTTL
tpl.MaxTTL = arg.MaxTTL
tpl.FailureTTL = arg.FailureTTL
tpl.InactivityTTL = arg.InactivityTTL
q.templates[idx] = tpl
return tpl.DeepCopy(), nil
}
Expand Down
4 changes: 3 additions & 1 deletioncoderd/database/dump.sql
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
BEGIN;
ALTER TABLE ONLY templates DROP COLUMN IF EXISTS failure_ttl;
ALTER TABLE ONLY templates DROP COLUMN IF EXISTS inactivity_ttl;
COMMIT;
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
BEGIN;
ALTER TABLE ONLY templates ADD COLUMN IF NOT EXISTS failure_ttl BIGINT NOT NULL DEFAULT 0;
ALTER TABLE ONLY templates ADD COLUMN IF NOT EXISTS inactivity_ttl BIGINT NOT NULL DEFAULT 0;
COMMIT;
2 changes: 2 additions & 0 deletionscoderd/database/modelqueries.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -80,6 +80,8 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
&i.MaxTTL,
&i.AllowUserAutostart,
&i.AllowUserAutostop,
&i.FailureTTL,
&i.InactivityTTL,
); err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletioncoderd/database/models.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

40 changes: 31 additions & 9 deletionscoderd/database/queries.sql.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

4 changes: 3 additions & 1 deletioncoderd/database/queries/templates.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -118,7 +118,9 @@ SET
allow_user_autostart = $3,
allow_user_autostop = $4,
default_ttl = $5,
max_ttl = $6
max_ttl = $6,
failure_ttl = $7,
inactivity_ttl = $8
WHERE
id = $1
RETURNING
Expand Down
2 changes: 2 additions & 0 deletionscoderd/database/sqlc.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,8 @@ overrides:
template_max_ttl: TemplateMaxTTL
motd_file: MOTDFile
uuid: UUID
failure_ttl: FailureTTL
inactivity_ttl: InactivityTTL

sql:
- schema: "./dump.sql"
Expand Down
14 changes: 11 additions & 3 deletionscoderd/schedule/template.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,10 @@ type TemplateScheduleOptions struct {
//
// If set, users cannot disable automatic workspace shutdown.
MaxTTL time.Duration `json:"max_ttl"`
// If FailureTTL is set, all failed workspaces will be stopped automatically after this time has elapsed.
FailureTTL time.Duration `json:"failure_ttl"`
// If InactivityTTL is set, all inactive workspaces will be deleted automatically after this time has elapsed.
InactivityTTL time.Duration `json:"inactivity_ttl"`
}

// TemplateScheduleStore provides an interface for retrieving template
Expand DownExpand Up@@ -47,9 +51,11 @@ func (*agplTemplateScheduleStore) GetTemplateScheduleOptions(ctx context.Context
UserAutostartEnabled: true,
UserAutostopEnabled: true,
DefaultTTL: time.Duration(tpl.DefaultTTL),
// Disregard the value in the database, since MaxTTL is an enterprise
// feature.
MaxTTL: 0,
// Disregard the values in the database, since MaxTTL, FailureTTL, and InactivityTTL are enterprise
// features.
MaxTTL: 0,
FailureTTL: 0,
InactivityTTL: 0,
}, nil
}

Expand All@@ -68,5 +74,7 @@ func (*agplTemplateScheduleStore) SetTemplateScheduleOptions(ctx context.Context
AllowUserAutostart: tpl.AllowUserAutostart,
AllowUserAutostop: tpl.AllowUserAutostop,
MaxTTL: tpl.MaxTTL,
FailureTTL: tpl.FailureTTL,
InactivityTTL: tpl.InactivityTTL,
})
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp