Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ffa6da

Browse files
feat: add inactivity cleanup and failure cleanup configuration fields to Template Schedule Form (#7402)
* added workspace actions entitlement * added workspace actions experiment * added new route for template enterprise meta * removing new route; repurposing old * add new fields to get endpoints * removed workspace actions experiment * added logic to enterprise template store * added new form fields * feature flagged new fields * fix validation * fixed submit btn * fix tests * changed ttl defaults * added FE tests * added BE tests * fixed lint * adjusted comment language * fixing unstaged changes check * fix test * Update coderd/database/migrations/000122_add_template_cleanup_ttls.down.sql Co-authored-by: Dean Sheather <[email protected]> * Update coderd/database/migrations/000122_add_template_cleanup_ttls.up.sql Co-authored-by: Dean Sheather <[email protected]> --------- Co-authored-by: Dean Sheather <[email protected]>
1 parent 3632ac8 commit 5ffa6da

33 files changed

+578
-59
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"Dsts",
3535
"embeddedpostgres",
3636
"enablements",
37+
"enterprisemeta",
3738
"errgroup",
3839
"eventsourcemock",
3940
"Failf",

coderd/apidoc/docs.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbfake/databasefake.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,8 @@ func (q *fakeQuerier) UpdateTemplateScheduleByID(_ context.Context, arg database
19451945
tpl.UpdatedAt = database.Now()
19461946
tpl.DefaultTTL = arg.DefaultTTL
19471947
tpl.MaxTTL = arg.MaxTTL
1948+
tpl.FailureTTL = arg.FailureTTL
1949+
tpl.InactivityTTL = arg.InactivityTTL
19481950
q.templates[idx] = tpl
19491951
return tpl.DeepCopy(), nil
19501952
}

coderd/database/dump.sql

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BEGIN;
2+
ALTER TABLE ONLY templates DROP COLUMN IF EXISTS failure_ttl;
3+
ALTER TABLE ONLY templates DROP COLUMN IF EXISTS inactivity_ttl;
4+
COMMIT;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BEGIN;
2+
ALTER TABLE ONLY templates ADD COLUMN IF NOT EXISTS failure_ttl BIGINT NOT NULL DEFAULT 0;
3+
ALTER TABLE ONLY templates ADD COLUMN IF NOT EXISTS inactivity_ttl BIGINT NOT NULL DEFAULT 0;
4+
COMMIT;

coderd/database/modelqueries.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
8080
&i.MaxTTL,
8181
&i.AllowUserAutostart,
8282
&i.AllowUserAutostop,
83+
&i.FailureTTL,
84+
&i.InactivityTTL,
8385
); err != nil {
8486
return nil, err
8587
}

coderd/database/models.go

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 31 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)