Skip to content

refactor(site): Refactor workspace actions #7124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into bq/refactor-workspace-header
  • Loading branch information
BrunoQuaresma committed Apr 14, 2023
commit 5df12604d39448646ba9e517f22ed2bc757db17f
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ jobs:
- name: Publish to Chromatic (non-mainline)
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
uses: chromaui/action@v1
env:
NODE_OPTIONS: "--max_old_space_size=4096"
STORYBOOK: true
with:
buildScriptName: "storybook:build"
exitOnceUploaded: true
Expand All @@ -651,6 +654,9 @@ jobs:
- name: Publish to Chromatic (mainline)
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
uses: chromaui/action@v1
env:
NODE_OPTIONS: "--max_old_space_size=4096"
STORYBOOK: true
with:
autoAcceptChanges: true
buildScriptName: "storybook:build"
Expand Down
8 changes: 4 additions & 4 deletions cli/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
ctx, stopNotify := signal.NotifyContext(ctx, InterruptSignals...)
defer stopNotify()

// dumpHandler does signal handling, so we call it after the
// DumpHandler does signal handling, so we call it after the
// reaper.
go dumpHandler(ctx)
go DumpHandler(ctx)

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

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

// ReadHeaderTimeout is purposefully not enabled. It caused some issues with
Expand Down
4 changes: 2 additions & 2 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
return h.transport.RoundTrip(req)
}

// dumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
// DumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
// stacktrace of all goroutines to stderr and a well-known file in the home
// directory. This is useful for debugging deadlock issues that may occur in
// production in workspaces, since the default Go runtime will only dump to
Expand All @@ -723,7 +723,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// A SIGQUIT handler will not be registered if GOTRACEBACK=crash.
//
// On Windows this immediately returns.
func dumpHandler(ctx context.Context) {
func DumpHandler(ctx context.Context) {
if runtime.GOOS == "windows" {
// free up the goroutine since it'll be permanently blocked anyways
return
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.