Skip to content

Commit 5af343d

Browse files
committed
Merge branch 'main' into bq/prompt-template-variables
2 parents 9cd893f + 0e50afe commit 5af343d

File tree

365 files changed

+4840
-7984
lines changed

Some content is hidden

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

365 files changed

+4840
-7984
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,9 @@ jobs:
634634
- name: Publish to Chromatic (non-mainline)
635635
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
636636
uses: chromaui/action@v1
637+
env:
638+
NODE_OPTIONS: "--max_old_space_size=4096"
639+
STORYBOOK: true
637640
with:
638641
buildScriptName: "storybook:build"
639642
exitOnceUploaded: true
@@ -651,6 +654,9 @@ jobs:
651654
- name: Publish to Chromatic (mainline)
652655
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
653656
uses: chromaui/action@v1
657+
env:
658+
NODE_OPTIONS: "--max_old_space_size=4096"
659+
STORYBOOK: true
654660
with:
655661
autoAcceptChanges: true
656662
buildScriptName: "storybook:build"

.github/workflows/cron-weekly.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
use-verbose-mode: "yes"
2222
config-file: ".github/workflows/mlc_config.json"
2323
folder-path: "docs/"
24+
file-path: "./README.md"
2425

2526
- name: Send Slack notification
2627
if: failure()

.github/workflows/mlc_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
{
1919
"pattern": "tailscale.com"
2020
}
21-
]
21+
],
22+
"aliveStatusCodes": [200, 0]
2223
}

agent/agent.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,5 +1407,14 @@ func expandDirectory(dir string) (string, error) {
14071407
}
14081408
dir = filepath.Join(home, dir[1:])
14091409
}
1410-
return os.ExpandEnv(dir), nil
1410+
dir = os.ExpandEnv(dir)
1411+
1412+
if !filepath.IsAbs(dir) {
1413+
home, err := userHomeDir()
1414+
if err != nil {
1415+
return "", err
1416+
}
1417+
dir = filepath.Join(home, dir)
1418+
}
1419+
return dir, nil
14111420
}

agent/agent_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,22 @@ func TestAgent_Startup(t *testing.T) {
13911391
require.Equal(t, homeDir, client.getStartup().ExpandedDirectory)
13921392
})
13931393

1394+
t.Run("NotAbsoluteDirectory", func(t *testing.T) {
1395+
t.Parallel()
1396+
1397+
_, client, _, _, _ := setupAgent(t, agentsdk.Manifest{
1398+
StartupScript: "true",
1399+
StartupScriptTimeout: 30 * time.Second,
1400+
Directory: "coder/coder",
1401+
}, 0)
1402+
assert.Eventually(t, func() bool {
1403+
return client.getStartup().Version != ""
1404+
}, testutil.WaitShort, testutil.IntervalFast)
1405+
homeDir, err := os.UserHomeDir()
1406+
require.NoError(t, err)
1407+
require.Equal(t, filepath.Join(homeDir, "coder/coder"), client.getStartup().ExpandedDirectory)
1408+
})
1409+
13941410
t.Run("HomeEnvironmentVariable", func(t *testing.T) {
13951411
t.Parallel()
13961412

cli/agent.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
8888
ctx, stopNotify := signal.NotifyContext(ctx, InterruptSignals...)
8989
defer stopNotify()
9090

91-
// dumpHandler does signal handling, so we call it after the
91+
// DumpHandler does signal handling, so we call it after the
9292
// reaper.
93-
go dumpHandler(ctx)
93+
go DumpHandler(ctx)
9494

9595
ljLogger := &lumberjack.Logger{
9696
Filename: filepath.Join(logDir, "coder-agent.log"),
@@ -119,7 +119,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
119119
// Enable pprof handler
120120
// This prevents the pprof import from being accidentally deleted.
121121
_ = pprof.Handler
122-
pprofSrvClose := serveHandler(ctx, logger, nil, pprofAddress, "pprof")
122+
pprofSrvClose := ServeHandler(ctx, logger, nil, pprofAddress, "pprof")
123123
defer pprofSrvClose()
124124
// Do a best effort here. If this fails, it's not a big deal.
125125
if port, err := urlPort(pprofAddress); err == nil {
@@ -262,7 +262,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
262262
return cmd
263263
}
264264

265-
func serveHandler(ctx context.Context, logger slog.Logger, handler http.Handler, addr, name string) (closeFunc func()) {
265+
func ServeHandler(ctx context.Context, logger slog.Logger, handler http.Handler, addr, name string) (closeFunc func()) {
266266
logger.Debug(ctx, "http server listening", slog.F("addr", addr), slog.F("name", name))
267267

268268
// ReadHeaderTimeout is purposefully not enabled. It caused some issues with

cli/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
711711
return h.transport.RoundTrip(req)
712712
}
713713

714-
// dumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
714+
// DumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
715715
// stacktrace of all goroutines to stderr and a well-known file in the home
716716
// directory. This is useful for debugging deadlock issues that may occur in
717717
// production in workspaces, since the default Go runtime will only dump to
@@ -723,7 +723,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
723723
// A SIGQUIT handler will not be registered if GOTRACEBACK=crash.
724724
//
725725
// On Windows this immediately returns.
726-
func dumpHandler(ctx context.Context) {
726+
func DumpHandler(ctx context.Context) {
727727
if runtime.GOOS == "windows" {
728728
// free up the goroutine since it'll be permanently blocked anyways
729729
return

0 commit comments

Comments
 (0)