Skip to content

Commit bfd941d

Browse files
committed
Merge branch 'main' into bett-feat/add-ssh-one-shot-command
2 parents e0a3e7a + cb0f778 commit bfd941d

File tree

87 files changed

+757
-849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+757
-849
lines changed

.github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ jobs:
336336
# a separate repository to allow its use before actions/checkout.
337337
- name: Setup RAM Disks
338338
if: runner.os == 'Windows'
339-
uses: coder/setup-ramdisk-action@79dacfe70c47ad6d6c0dd7f45412368802641439
339+
uses: coder/setup-ramdisk-action@81c5c441bda00c6c3d6bcee2e5a33ed4aadbbcc1
340340

341341
- name: Checkout
342342
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

agent/agent.go

-5
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ type Options struct {
8989
ServiceBannerRefreshInterval time.Duration
9090
BlockFileTransfer bool
9191
Execer agentexec.Execer
92-
SubAgent bool
9392

9493
ExperimentalDevcontainersEnabled bool
9594
ContainerAPIOptions []agentcontainers.Option // Enable ExperimentalDevcontainersEnabled for these to be effective.
@@ -191,8 +190,6 @@ func New(options Options) Agent {
191190
metrics: newAgentMetrics(prometheusRegistry),
192191
execer: options.Execer,
193192

194-
subAgent: options.SubAgent,
195-
196193
experimentalDevcontainersEnabled: options.ExperimentalDevcontainersEnabled,
197194
containerAPIOptions: options.ContainerAPIOptions,
198195
}
@@ -275,8 +272,6 @@ type agent struct {
275272
metrics *agentMetrics
276273
execer agentexec.Execer
277274

278-
subAgent bool
279-
280275
experimentalDevcontainersEnabled bool
281276
containerAPIOptions []agentcontainers.Option
282277
containerAPI atomic.Pointer[agentcontainers.API] // Set by apiHandler.

agent/agent_test.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -1262,10 +1262,6 @@ func TestAgent_SSHConnectionLoginVars(t *testing.T) {
12621262
key: "LOGNAME",
12631263
want: u.Username,
12641264
},
1265-
{
1266-
key: "HOME",
1267-
want: u.HomeDir,
1268-
},
12691265
{
12701266
key: "SHELL",
12711267
want: shell,
@@ -1502,7 +1498,7 @@ func TestAgent_Lifecycle(t *testing.T) {
15021498

15031499
_, client, _, _, _ := setupAgent(t, agentsdk.Manifest{
15041500
Scripts: []codersdk.WorkspaceAgentScript{{
1505-
Script: "true",
1501+
Script: "echo foo",
15061502
Timeout: 30 * time.Second,
15071503
RunOnStart: true,
15081504
}},

cli/agent.go

-13
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
5454
blockFileTransfer bool
5555
agentHeaderCommand string
5656
agentHeader []string
57-
subAgent bool
5857

5958
experimentalDevcontainersEnabled bool
6059
)
@@ -362,7 +361,6 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
362361
PrometheusRegistry: prometheusRegistry,
363362
BlockFileTransfer: blockFileTransfer,
364363
Execer: execer,
365-
SubAgent: subAgent,
366364
ExperimentalDevcontainersEnabled: experimentalDevcontainersEnabled,
367365
})
368366

@@ -509,17 +507,6 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
509507
Description: "Allow the agent to automatically detect running devcontainers.",
510508
Value: serpent.BoolOf(&experimentalDevcontainersEnabled),
511509
},
512-
{
513-
Flag: "is-sub-agent",
514-
Default: "false",
515-
Env: "CODER_AGENT_IS_SUB_AGENT",
516-
Description: "Specify whether this is a sub agent or not.",
517-
Value: serpent.BoolOf(&subAgent),
518-
// As `coderd` handles the creation of sub-agents, it does not make
519-
// sense for this to be exposed. We do not want people setting an
520-
// agent as a sub-agent if it is not.
521-
Hidden: true,
522-
},
523510
}
524511

525512
return cmd

cli/testdata/coder_provisioner_list_--output_json.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"last_seen_at": "====[timestamp]=====",
88
"name": "test",
99
"version": "v0.0.0-devel",
10-
"api_version": "1.5",
10+
"api_version": "1.6",
1111
"provisioners": [
1212
"echo"
1313
],

coderd/apidoc/docs.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbmem/dbmem.go

+1
Original file line numberDiff line numberDiff line change
@@ -11084,6 +11084,7 @@ func (q *FakeQuerier) UpdateTemplateMetaByID(_ context.Context, arg database.Upd
1108411084
tpl.GroupACL = arg.GroupACL
1108511085
tpl.AllowUserCancelWorkspaceJobs = arg.AllowUserCancelWorkspaceJobs
1108611086
tpl.MaxPortSharingLevel = arg.MaxPortSharingLevel
11087+
tpl.UseClassicParameterFlow = arg.UseClassicParameterFlow
1108711088
q.templates[idx] = tpl
1108811089
return nil
1108911090
}

coderd/database/dump.sql

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
DROP VIEW template_with_names;
2+
3+
-- Drop the column
4+
ALTER TABLE templates DROP COLUMN use_classic_parameter_flow;
5+
6+
7+
CREATE VIEW
8+
template_with_names
9+
AS
10+
SELECT
11+
templates.*,
12+
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url,
13+
coalesce(visible_users.username, '') AS created_by_username,
14+
coalesce(organizations.name, '') AS organization_name,
15+
coalesce(organizations.display_name, '') AS organization_display_name,
16+
coalesce(organizations.icon, '') AS organization_icon
17+
FROM
18+
templates
19+
LEFT JOIN
20+
visible_users
21+
ON
22+
templates.created_by = visible_users.id
23+
LEFT JOIN
24+
organizations
25+
ON templates.organization_id = organizations.id
26+
;
27+
28+
COMMENT ON VIEW template_with_names IS 'Joins in the display name information such as username, avatar, and organization name.';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
-- Default to `false`. Users will have to manually opt back into the classic parameter flow.
2+
-- We want the new experience to be tried first.
3+
ALTER TABLE templates ADD COLUMN use_classic_parameter_flow BOOL NOT NULL DEFAULT false;
4+
5+
COMMENT ON COLUMN templates.use_classic_parameter_flow IS
6+
'Determines whether to default to the dynamic parameter creation flow for this template '
7+
'or continue using the legacy classic parameter creation flow.'
8+
'This is a template wide setting, the template admin can revert to the classic flow if there are any issues. '
9+
'An escape hatch is required, as workspace creation is a core workflow and cannot break. '
10+
'This column will be removed when the dynamic parameter creation flow is stable.';
11+
12+
13+
-- Update the template_with_names view by recreating it.
14+
DROP VIEW template_with_names;
15+
CREATE VIEW
16+
template_with_names
17+
AS
18+
SELECT
19+
templates.*,
20+
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url,
21+
coalesce(visible_users.username, '') AS created_by_username,
22+
coalesce(organizations.name, '') AS organization_name,
23+
coalesce(organizations.display_name, '') AS organization_display_name,
24+
coalesce(organizations.icon, '') AS organization_icon
25+
FROM
26+
templates
27+
LEFT JOIN
28+
visible_users
29+
ON
30+
templates.created_by = visible_users.id
31+
LEFT JOIN
32+
organizations
33+
ON templates.organization_id = organizations.id
34+
;
35+
36+
COMMENT ON VIEW template_with_names IS 'Joins in the display name information such as username, avatar, and organization name.';

coderd/database/modelqueries.go

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
117117
&i.Deprecated,
118118
&i.ActivityBump,
119119
&i.MaxPortSharingLevel,
120+
&i.UseClassicParameterFlow,
120121
&i.CreatedByAvatarURL,
121122
&i.CreatedByUsername,
122123
&i.OrganizationName,

coderd/database/models.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

+13-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/templates.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ SET
124124
display_name = $6,
125125
allow_user_cancel_workspace_jobs = $7,
126126
group_acl = $8,
127-
max_port_sharing_level = $9
127+
max_port_sharing_level = $9,
128+
use_classic_parameter_flow = $10
128129
WHERE
129130
id = $1
130131
;

0 commit comments

Comments
 (0)