Skip to content

Commit 09441fe

Browse files
committed
Merge branch 'main' of https://github.com/coder/coder into bq/verify-external-auth-first
2 parents fe70708 + f5dbc71 commit 09441fe

File tree

7 files changed

+77
-29
lines changed

7 files changed

+77
-29
lines changed

coderd/autobuild/lifecycle_executor.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ func (e *Executor) runOnce(t time.Time) Stats {
130130

131131
for _, ws := range workspaces {
132132
wsID := ws.ID
133-
log := e.log.With(slog.F("workspace_id", wsID))
133+
wsName := ws.Name
134+
log := e.log.With(
135+
slog.F("workspace_id", wsID),
136+
slog.F("workspace_name", wsName),
137+
)
134138

135139
eg.Go(func() error {
136140
err := func() error {
@@ -256,7 +260,7 @@ func (e *Executor) runOnce(t time.Time) Stats {
256260
// If the transition didn't succeed then updating the workspace
257261
// to indicate dormant didn't either.
258262
auditLog.Success = err == nil
259-
auditBuild(e.ctx, e.log, *e.auditor.Load(), *auditLog)
263+
auditBuild(e.ctx, log, *e.auditor.Load(), *auditLog)
260264
}
261265
if err != nil {
262266
return xerrors.Errorf("transition workspace: %w", err)
@@ -274,7 +278,7 @@ func (e *Executor) runOnce(t time.Time) Stats {
274278
return nil
275279
}()
276280
if err != nil {
277-
e.log.Error(e.ctx, "failed to transition workspace", slog.Error(err))
281+
log.Error(e.ctx, "failed to transition workspace", slog.Error(err))
278282
statsMu.Lock()
279283
stats.Errors[wsID] = err
280284
statsMu.Unlock()

coderd/externalauth/externalauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func (c *DeviceAuth) AuthorizeDevice(ctx context.Context) (*codersdk.ExternalAut
347347
case mediaType == "application/x-www-form-urlencoded":
348348
return nil, xerrors.Errorf("status_code=%d, payload response is form-url encoded, expected a json payload", resp.StatusCode)
349349
default:
350-
return nil, fmt.Errorf("status_code=%d, mediaType=%s: %w", resp.StatusCode, mediaType, err)
350+
return nil, xerrors.Errorf("status_code=%d, mediaType=%s: %w", resp.StatusCode, mediaType, err)
351351
}
352352
}
353353
if r.ErrorDescription != "" {

coderd/tailnet.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,14 @@ func NewServerTailnet(
103103
transport: tailnetTransport.Clone(),
104104
}
105105
tn.transport.DialContext = tn.dialContext
106-
tn.transport.MaxIdleConnsPerHost = 10
106+
107+
// Bugfix: for some reason all calls to tn.dialContext come from
108+
// "localhost", causing connections to be cached and requests to go to the
109+
// wrong workspaces. This disables keepalives for now until the root cause
110+
// can be found.
111+
tn.transport.MaxIdleConnsPerHost = -1
112+
tn.transport.DisableKeepAlives = true
113+
107114
tn.transport.MaxIdleConns = 0
108115
// We intentionally don't verify the certificate chain here.
109116
// The connection to the workspace is already established and most

coderd/workspaceagentsrpc.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ func (api *API) workspaceAgentRPC(rw http.ResponseWriter, r *http.Request) {
4040

4141
version := r.URL.Query().Get("version")
4242
if version == "" {
43-
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
44-
Message: "Missing required query parameter: version",
45-
})
46-
return
43+
// The initial version on this HTTP endpoint was 2.0, so assume this version if unspecified.
44+
// Coder v2.7.1 (not to be confused with the Agent API version) calls this endpoint without
45+
// a version parameter and wants Agent API version 2.0.
46+
version = "2.0"
4747
}
4848
if err := proto.CurrentVersion.Validate(version); err != nil {
4949
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{

dogfood/main.tf

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,42 @@ data "coder_external_auth" "github" {
8585
data "coder_workspace" "me" {}
8686

8787
module "slackme" {
88-
source = "https://registry.coder.com/modules/slackme"
88+
source = "registry.coder.com/modules/slackme/coder"
89+
version = "1.0.1"
8990
agent_id = coder_agent.dev.id
9091
auth_provider_id = "slack"
9192
}
9293

9394
module "dotfiles" {
94-
source = "https://registry.coder.com/modules/dotfiles"
95+
source = "registry.coder.com/modules/dotfiles/coder"
96+
version = "1.0.1"
9597
agent_id = coder_agent.dev.id
9698
}
9799

98100
module "git-clone" {
99-
source = "https://registry.coder.com/modules/git-clone"
101+
source = "registry.coder.com/modules/git-clone/coder"
102+
version = "1.0.1"
100103
agent_id = coder_agent.dev.id
101104
url = "https://github.com/coder/coder"
102105
path = local.repo_dir
103106
}
104107

105108
module "personalize" {
106-
source = "https://registry.coder.com/modules/personalize"
109+
source = "registry.coder.com/modules/personalize/coder"
110+
version = "1.0.1"
107111
agent_id = coder_agent.dev.id
108112
}
109113

110114
module "code-server" {
111-
source = "https://registry.coder.com/modules/code-server"
115+
source = "registry.coder.com/modules/code-server/coder"
116+
version = "1.0.1"
112117
agent_id = coder_agent.dev.id
113118
folder = local.repo_dir
114119
}
115120

116121
module "jetbrains_gateway" {
117-
source = "https://registry.coder.com/modules/jetbrains-gateway"
122+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
123+
version = "1.0.1"
118124
agent_id = coder_agent.dev.id
119125
agent_name = "dev"
120126
folder = local.repo_dir
@@ -123,23 +129,27 @@ module "jetbrains_gateway" {
123129
}
124130

125131
module "vscode-desktop" {
126-
source = "https://registry.coder.com/modules/vscode-desktop"
132+
source = "registry.coder.com/modules/vscode-desktop/coder"
133+
version = "1.0.1"
127134
agent_id = coder_agent.dev.id
128135
folder = local.repo_dir
129136
}
130137

131138
module "filebrowser" {
132-
source = "https://registry.coder.com/modules/filebrowser"
139+
source = "registry.coder.com/modules/filebrowser/coder"
140+
version = "1.0.1"
133141
agent_id = coder_agent.dev.id
134142
}
135143

136144
module "coder-login" {
137-
source = "https://registry.coder.com/modules/coder-login"
145+
source = "registry.coder.com/modules/coder-login/coder"
146+
version = "1.0.1"
138147
agent_id = coder_agent.dev.id
139148
}
140149

141150
module "jfrog" {
142-
source = "https://registry.coder.com/modules/jfrog-oauth"
151+
source = "registry.coder.com/modules/jfrog-oauth/coder"
152+
version = "1.0.1"
143153
agent_id = coder_agent.dev.id
144154
jfrog_url = var.jfrog_url
145155
configure_code_server = true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { type Meta, type StoryObj } from "@storybook/react";
2+
import { chromatic } from "testHelpers/chromatic";
3+
import { DropdownArrow } from "./DropdownArrow";
4+
5+
const meta: Meta<typeof DropdownArrow> = {
6+
title: "components/DropdownArrow",
7+
parameters: { chromatic },
8+
component: DropdownArrow,
9+
args: {},
10+
};
11+
12+
export default meta;
13+
type Story = StoryObj<typeof DropdownArrow>;
14+
15+
export const Open: Story = {};
16+
export const Close: Story = { args: { close: true } };
17+
export const WithColor: Story = { args: { color: "#f00" } };
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
11
import KeyboardArrowDown from "@mui/icons-material/KeyboardArrowDown";
22
import KeyboardArrowUp from "@mui/icons-material/KeyboardArrowUp";
3+
import { type Interpolation, type Theme } from "@emotion/react";
34
import { type FC } from "react";
4-
import { type Theme } from "@emotion/react";
55

66
interface ArrowProps {
77
margin?: boolean;
88
color?: string;
99
close?: boolean;
1010
}
1111

12-
export const DropdownArrow: FC<ArrowProps> = (props) => {
13-
const { margin = true, color, close } = props;
14-
12+
export const DropdownArrow: FC<ArrowProps> = ({
13+
margin = true,
14+
color,
15+
close,
16+
}) => {
1517
const Arrow = close ? KeyboardArrowUp : KeyboardArrowDown;
1618

1719
return (
1820
<Arrow
1921
aria-label={close ? "close-dropdown" : "open-dropdown"}
20-
css={(theme: Theme) => ({
21-
color: color ?? theme.palette.primary.contrastText,
22-
marginLeft: margin ? 8 : 0,
23-
width: 16,
24-
height: 16,
25-
})}
22+
css={[styles.base, margin && styles.withMargin]}
23+
style={{ color }}
2624
/>
2725
);
2826
};
27+
28+
const styles = {
29+
base: (theme) => ({
30+
color: theme.palette.primary.contrastText,
31+
width: 16,
32+
height: 16,
33+
}),
34+
35+
withMargin: {
36+
marginLeft: 8,
37+
},
38+
} satisfies Record<string, Interpolation<Theme>>;

0 commit comments

Comments
 (0)