Skip to content

Commit f2380fe

Browse files
committed
Merge branch 'main' into mes/workspace-clone
2 parents f0e120b + a67a5a8 commit f2380fe

File tree

265 files changed

+6801
-3330
lines changed

Some content is hidden

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

265 files changed

+6801
-3330
lines changed

.github/actions/setup-go/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: |
44
inputs:
55
version:
66
description: "The Go version to use."
7-
default: "1.20.8"
7+
default: "1.20.10"
88
runs:
99
using: "composite"
1010
steps:

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ jobs:
220220
with:
221221
# This doesn't need caching. It's super fast anyways!
222222
cache: false
223-
go-version: 1.20.8
223+
go-version: 1.20.10
224224

225225
- name: Install shfmt
226226
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0

agent/agent.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,11 +1290,7 @@ func (a *agent) manageProcessPriority(ctx context.Context) ([]*agentproc.Process
12901290
// Getpriority actually returns priority for the nice value
12911291
// which is niceness + 20, so here 20 = a niceness of 0 (aka unset).
12921292
if score != 20 {
1293-
if score != niceness {
1294-
logger.Debug(ctx, "skipping process due to custom niceness",
1295-
slog.F("niceness", score),
1296-
)
1297-
}
1293+
// We don't log here since it can get spammy
12981294
continue
12991295
}
13001296

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func TestAgent_Session_TTY_MOTD(t *testing.T) {
356356
Enabled: true,
357357
Message: "\n\n\n\n\n\nbanner\n\n\n\n\n\n",
358358
},
359-
expectedRe: regexp.MustCompile("([^\n\r]|^)banner\r\n\r\n[^\r\n]"),
359+
expectedRe: regexp.MustCompile(`([^\n\r]|^)banner\r\n\r\n[^\r\n]`),
360360
},
361361
}
362362

cli/agent_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ func TestWorkspaceAgent(t *testing.T) {
176176
GoogleTokenValidator: validator,
177177
IncludeProvisionerDaemon: true,
178178
})
179-
user := coderdtest.CreateFirstUser(t, client)
180-
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
179+
owner := coderdtest.CreateFirstUser(t, client)
180+
member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
181+
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, &echo.Responses{
181182
Parse: echo.ParseComplete,
182183
ProvisionApply: []*proto.Response{{
183184
Type: &proto.Response_Apply{
@@ -195,14 +196,14 @@ func TestWorkspaceAgent(t *testing.T) {
195196
},
196197
}},
197198
})
198-
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
199+
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
199200
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
200-
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
201+
workspace := coderdtest.CreateWorkspace(t, member, owner.OrganizationID, template.ID)
201202
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
202203

203204
inv, cfg := clitest.New(t, "agent", "--auth", "google-instance-identity", "--agent-url", client.URL.String())
204205
ptytest.New(t).Attach(inv)
205-
clitest.SetupConfig(t, client, cfg)
206+
clitest.SetupConfig(t, member, cfg)
206207
clitest.Start(t,
207208
inv.WithContext(
208209
//nolint:revive,staticcheck

cli/configssh_test.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ func TestConfigSSH(t *testing.T) {
7575
},
7676
},
7777
})
78-
user := coderdtest.CreateFirstUser(t, client)
78+
owner := coderdtest.CreateFirstUser(t, client)
79+
member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
7980
authToken := uuid.NewString()
80-
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
81+
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, &echo.Responses{
8182
Parse: echo.ParseComplete,
8283
ProvisionPlan: []*proto.Response{{
8384
Type: &proto.Response_Plan{
@@ -96,8 +97,8 @@ func TestConfigSSH(t *testing.T) {
9697
ProvisionApply: echo.ProvisionApplyWithAgent(authToken),
9798
})
9899
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
99-
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
100-
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
100+
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
101+
workspace := coderdtest.CreateWorkspace(t, member, owner.OrganizationID, template.ID)
101102
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
102103
_ = agenttest.New(t, client.URL, authToken)
103104
resources := coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID)
@@ -145,7 +146,7 @@ func TestConfigSSH(t *testing.T) {
145146
"--ssh-option", "Port "+strconv.Itoa(tcpAddr.Port),
146147
"--ssh-config-file", sshConfigFile,
147148
"--skip-proxy-command")
148-
clitest.SetupConfig(t, client, root)
149+
clitest.SetupConfig(t, member, root)
149150
pty := ptytest.New(t)
150151
inv.Stdin = pty.Input()
151152
inv.Stdout = pty.Output()
@@ -710,19 +711,20 @@ func TestConfigSSH_Hostnames(t *testing.T) {
710711
}
711712

712713
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
713-
user := coderdtest.CreateFirstUser(t, client)
714+
owner := coderdtest.CreateFirstUser(t, client)
715+
member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
714716
// authToken := uuid.NewString()
715-
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID,
717+
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID,
716718
echo.WithResources(resources))
717719
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
718-
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
719-
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
720+
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
721+
workspace := coderdtest.CreateWorkspace(t, member, owner.OrganizationID, template.ID)
720722
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
721723

722724
sshConfigFile := sshConfigFileName(t)
723725

724726
inv, root := clitest.New(t, "config-ssh", "--ssh-config-file", sshConfigFile)
725-
clitest.SetupConfig(t, client, root)
727+
clitest.SetupConfig(t, member, root)
726728

727729
pty := ptytest.New(t)
728730
inv.Stdin = pty.Input()

0 commit comments

Comments
 (0)