Skip to content

[pull] main from coder:main #65

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 46 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5f516ed
feat: improve coder connect tunnel handling on reconnect (#17598)
ibetitsmike May 6, 2025
d9b00e4
feat: add inline actions into workspaces table (#17636)
BrunoQuaresma May 6, 2025
a7e8285
chore: retry failing tests in CI (#17681)
hugodutka May 6, 2025
4fa9d30
refactor: update app buttons to use the new button component (#17684)
BrunoQuaresma May 6, 2025
df0c6ed
chore: add custom aider icon (#17682)
DevelopmentCats May 6, 2025
d146115
chore: update browser list db (#17699)
BrunoQuaresma May 7, 2025
9fe5b71
chore!: fix workspace apps response (#17700)
BrunoQuaresma May 7, 2025
6ac1bd8
feat: display builtin apps on workspaces table (#17695)
BrunoQuaresma May 7, 2025
29bce8d
feat(cli): make MCP server work without user authentication (#17688)
ThomasK33 May 7, 2025
a02ba66
fix: fill session token when app is external (#17708)
BrunoQuaresma May 7, 2025
e4c6c10
chore: fix comment regarding provisioner api version release (#17705)
Emyrk May 7, 2025
b6182fe
chore: add code-insiders.svg static icon (#17716)
deansheather May 8, 2025
c66e80e
fix: extract checkbox label from dynamic parameter styling prop (#17651)
jaaydenh May 8, 2025
2695f4e
chore: improve variable names of mocked users (#17701)
BrunoQuaresma May 8, 2025
4341403
chore: simplify workspaces data fetching (#17703)
BrunoQuaresma May 8, 2025
857587b
fix: do not share token with http app urls (#17720)
BrunoQuaresma May 8, 2025
1bb96b8
fix: resolve flake test on manager (#17702)
defelmnq May 8, 2025
c5c3a54
fix: create ssh directory if it doesn't already exist when running `c…
brettkolodny May 8, 2025
0b141c4
chore: add DynamicParameter stories (#17710)
jaaydenh May 8, 2025
d93a9cf
feat: add TagInput component for dynamic parameters (#17719)
jaaydenh May 8, 2025
d5360a6
chore: fetch workspaces by username with organization permissions (#1…
Emyrk May 8, 2025
9a052e2
fix: use file filter in weekly-docs github action (#17729)
EdwardAngert May 8, 2025
ae3d90b
fix: persist terraform modules during template import (#17665)
aslilac May 8, 2025
a9f1a6b
fix: revert fix: persist terraform modules during template import (#1…
sreya May 9, 2025
58adc62
chore: add prebuild docs (#17580)
dannykopping May 9, 2025
2696926
fix: fixed flaking VPN tunnel tests & bump coder/quartz to 0.1.3 (#17…
ibetitsmike May 9, 2025
f897981
chore: extract app access logic for reuse (#17724)
BrunoQuaresma May 9, 2025
2bdd035
chore: add keys for each app on workspaces table (#17726)
BrunoQuaresma May 9, 2025
902c34c
refactor: improve apps.ts readbility (#17741)
BrunoQuaresma May 9, 2025
0b8fd7e
chore: fix :first-child warning (#17727)
BrunoQuaresma May 9, 2025
9d7630b
chore: replace MUI icons - 1 (#17731)
BrunoQuaresma May 9, 2025
3ee95f1
chore: upgrade `terraform-provider-coder` & `preview` libs (#17738)
dannykopping May 9, 2025
5c53277
docs: clarify parameter autofill documentation (#17728)
EdwardAngert May 9, 2025
9e44f18
refactor: add safe list for external app protocols (#17742)
BrunoQuaresma May 9, 2025
b0a4ef0
chore: replace MUI icons - 2 (#17732)
BrunoQuaresma May 9, 2025
aa4b764
chore: replace MUI icons - 3 (#17733)
BrunoQuaresma May 9, 2025
4970fb9
chore: replace MUI icons - 4 (#17748)
BrunoQuaresma May 9, 2025
1adad41
feat: display user apps in the workspaces table (#17744)
BrunoQuaresma May 9, 2025
842bb1f
chore: replace MUI icons - 6 (#17751)
BrunoQuaresma May 9, 2025
bd65914
docs: add note about experiment_report_tasks to ai-coder/create-templ…
EdwardAngert May 9, 2025
7af188b
fix(agent): fix unexpanded devcontainer paths for agentcontainers (#1…
mafredri May 12, 2025
87152db
ci: bump the github-actions group across 1 directory with 4 updates (…
dependabot[bot] May 12, 2025
4f1df34
chore: bump github.com/mark3labs/mcp-go from 0.25.0 to 0.27.0 (#17762)
dependabot[bot] May 12, 2025
0832afb
chore: bump gopkg.in/DataDog/dd-trace-go.v1 from 1.72.1 to 1.73.0 (#1…
dependabot[bot] May 12, 2025
345a239
chore: bump github.com/open-policy-agent/opa from 1.3.0 to 1.4.2 (#17…
dependabot[bot] May 12, 2025
799a0ba
chore: bump github.com/valyala/fasthttp from 1.61.0 to 1.62.0 (#17766)
dependabot[bot] May 12, 2025
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
11 changes: 8 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:

# Check for any typos
- name: Check for typos
uses: crate-ci/typos@b1a1ef3893ff35ade0cfa71523852a49bfd05d19 # v1.31.1
uses: crate-ci/typos@0f0ccba9ed1df83948f0c15026e4f5ccfce46109 # v1.32.0
with:
config: .github/workflows/typos.toml

Expand Down Expand Up @@ -382,8 +382,8 @@ jobs:
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
fi
export TS_DEBUG_DISCO=true
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" \
--packages="./..." -- $PARALLEL_FLAG -short -failfast
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" --rerun-fails=2 \
--packages="./..." -- $PARALLEL_FLAG -short

- name: Upload Test Cache
uses: ./.github/actions/test-cache/upload
Expand Down Expand Up @@ -436,6 +436,7 @@ jobs:
TS_DEBUG_DISCO: "true"
LC_CTYPE: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
TEST_RETRIES: 2
shell: bash
run: |
# By default Go will use the number of logical CPUs, which
Expand Down Expand Up @@ -499,6 +500,7 @@ jobs:
TS_DEBUG_DISCO: "true"
LC_CTYPE: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
TEST_RETRIES: 2
shell: bash
run: |
# By default Go will use the number of logical CPUs, which
Expand Down Expand Up @@ -560,6 +562,7 @@ jobs:
env:
POSTGRES_VERSION: "16"
TS_DEBUG_DISCO: "true"
TEST_RETRIES: 2
run: |
make test-postgres

Expand Down Expand Up @@ -784,6 +787,7 @@ jobs:
if: ${{ !matrix.variant.premium }}
env:
DEBUG: pw:api
CODER_E2E_TEST_RETRIES: 2
working-directory: site

# Run all of the tests with a premium license
Expand All @@ -793,6 +797,7 @@ jobs:
DEBUG: pw:api
CODER_E2E_LICENSE: ${{ secrets.CODER_E2E_LICENSE }}
CODER_E2E_REQUIRE_PREMIUM_TESTS: "1"
CODER_E2E_TEST_RETRIES: 2
working-directory: site

- name: Upload Playwright Failed Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node

- uses: tj-actions/changed-files@5426ecc3f5c2b10effaefbd374f0abdc6a571b2f # v45.0.7
- uses: tj-actions/changed-files@480f49412651059a414a6a5c96887abb1877de8a # v45.0.7
id: changed-files
with:
files: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
with:
sarif_file: results.sarif
6 changes: 3 additions & 3 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: ./.github/actions/setup-go

- name: Initialize CodeQL
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
with:
languages: go, javascript

Expand All @@ -48,7 +48,7 @@ jobs:
rm Makefile

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17

- name: Send Slack notification on failure
if: ${{ failure() }}
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
with:
sarif_file: trivy-results.sarif
category: "Trivy"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
reporter: github-pr-review
config_file: ".github/.linkspector.yml"
fail_on_error: "true"
filter_mode: "nofilter"
filter_mode: "file"

- name: Send Slack notification
if: failure() && github.event_name == 'schedule'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ result

# dlv debug binaries for go tests
__debug_bin*

**/.claude/settings.local.json
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -875,12 +875,19 @@ provisioner/terraform/testdata/version:
fi
.PHONY: provisioner/terraform/testdata/version

# Set the retry flags if TEST_RETRIES is set
ifdef TEST_RETRIES
GOTESTSUM_RETRY_FLAGS := --rerun-fails=$(TEST_RETRIES)
else
GOTESTSUM_RETRY_FLAGS :=
endif

test:
$(GIT_FLAGS) gotestsum --format standard-quiet -- -v -short -count=1 ./... $(if $(RUN),-run $(RUN))
$(GIT_FLAGS) gotestsum --format standard-quiet $(GOTESTSUM_RETRY_FLAGS) --packages="./..." -- -v -short -count=1 $(if $(RUN),-run $(RUN))
.PHONY: test

test-cli:
$(GIT_FLAGS) gotestsum --format standard-quiet -- -v -short -count=1 ./cli/...
$(GIT_FLAGS) gotestsum --format standard-quiet $(GOTESTSUM_RETRY_FLAGS) --packages="./cli/..." -- -v -short -count=1
.PHONY: test-cli

# sqlc-cloud-is-setup will fail if no SQLc auth token is set. Use this as a
Expand Down Expand Up @@ -919,9 +926,9 @@ test-postgres: test-postgres-docker
$(GIT_FLAGS) DB=ci gotestsum \
--junitfile="gotests.xml" \
--jsonfile="gotests.json" \
$(GOTESTSUM_RETRY_FLAGS) \
--packages="./..." -- \
-timeout=20m \
-failfast \
-count=1
.PHONY: test-postgres

Expand Down
4 changes: 3 additions & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,8 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
if err != nil {
return xerrors.Errorf("expand directory: %w", err)
}
// Normalize all devcontainer paths by making them absolute.
manifest.Devcontainers = agentcontainers.ExpandAllDevcontainerPaths(a.logger, expandPathToAbs, manifest.Devcontainers)
subsys, err := agentsdk.ProtoFromSubsystems(a.subsystems)
if err != nil {
a.logger.Critical(ctx, "failed to convert subsystems", slog.Error(err))
Expand Down Expand Up @@ -1127,7 +1129,7 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
)
if a.experimentalDevcontainersEnabled {
var dcScripts []codersdk.WorkspaceAgentScript
scripts, dcScripts = agentcontainers.ExtractAndInitializeDevcontainerScripts(a.logger, expandPathToAbs, manifest.Devcontainers, scripts)
scripts, dcScripts = agentcontainers.ExtractAndInitializeDevcontainerScripts(manifest.Devcontainers, scripts)
// See ExtractAndInitializeDevcontainerScripts for motivation
// behind running dcScripts as post start scripts.
scriptRunnerOpts = append(scriptRunnerOpts, agentscripts.WithPostStartScripts(dcScripts...))
Expand Down
17 changes: 11 additions & 6 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1998,8 +1998,9 @@ func TestAgent_ReconnectingPTYContainer(t *testing.T) {
// You can run it manually as follows:
//
// CODER_TEST_USE_DOCKER=1 go test -count=1 ./agent -run TestAgent_DevcontainerAutostart
//
//nolint:paralleltest // This test sets an environment variable.
func TestAgent_DevcontainerAutostart(t *testing.T) {
t.Parallel()
if os.Getenv("CODER_TEST_USE_DOCKER") != "1" {
t.Skip("Set CODER_TEST_USE_DOCKER=1 to run this test")
}
Expand All @@ -2012,9 +2013,12 @@ func TestAgent_DevcontainerAutostart(t *testing.T) {

// Prepare temporary devcontainer for test (mywork).
devcontainerID := uuid.New()
tempWorkspaceFolder := t.TempDir()
tempWorkspaceFolder = filepath.Join(tempWorkspaceFolder, "mywork")
tmpdir := t.TempDir()
t.Setenv("HOME", tmpdir)
tempWorkspaceFolder := filepath.Join(tmpdir, "mywork")
unexpandedWorkspaceFolder := filepath.Join("~", "mywork")
t.Logf("Workspace folder: %s", tempWorkspaceFolder)
t.Logf("Unexpanded workspace folder: %s", unexpandedWorkspaceFolder)
devcontainerPath := filepath.Join(tempWorkspaceFolder, ".devcontainer")
err = os.MkdirAll(devcontainerPath, 0o755)
require.NoError(t, err, "create devcontainer directory")
Expand All @@ -2031,9 +2035,10 @@ func TestAgent_DevcontainerAutostart(t *testing.T) {
// is expected to be prepared by the provisioner normally.
Devcontainers: []codersdk.WorkspaceAgentDevcontainer{
{
ID: devcontainerID,
Name: "test",
WorkspaceFolder: tempWorkspaceFolder,
ID: devcontainerID,
Name: "test",
// Use an unexpanded path to test the expansion.
WorkspaceFolder: unexpandedWorkspaceFolder,
},
},
Scripts: []codersdk.WorkspaceAgentScript{
Expand Down
14 changes: 11 additions & 3 deletions agent/agentcontainers/devcontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ devcontainer up %s
// initialize the workspace (e.g. git clone, npm install, etc). This is
// important if e.g. a Coder module to install @devcontainer/cli is used.
func ExtractAndInitializeDevcontainerScripts(
logger slog.Logger,
expandPath func(string) (string, error),
devcontainers []codersdk.WorkspaceAgentDevcontainer,
scripts []codersdk.WorkspaceAgentScript,
) (filteredScripts []codersdk.WorkspaceAgentScript, devcontainerScripts []codersdk.WorkspaceAgentScript) {
Expand All @@ -47,7 +45,6 @@ ScriptLoop:
// The devcontainer scripts match the devcontainer ID for
// identification.
if script.ID == dc.ID {
dc = expandDevcontainerPaths(logger, expandPath, dc)
devcontainerScripts = append(devcontainerScripts, devcontainerStartupScript(dc, script))
continue ScriptLoop
}
Expand Down Expand Up @@ -75,6 +72,17 @@ func devcontainerStartupScript(dc codersdk.WorkspaceAgentDevcontainer, script co
return script
}

// ExpandAllDevcontainerPaths expands all devcontainer paths in the given
// devcontainers. This is required by the devcontainer CLI, which requires
// absolute paths for the workspace folder and config path.
func ExpandAllDevcontainerPaths(logger slog.Logger, expandPath func(string) (string, error), devcontainers []codersdk.WorkspaceAgentDevcontainer) []codersdk.WorkspaceAgentDevcontainer {
expanded := make([]codersdk.WorkspaceAgentDevcontainer, 0, len(devcontainers))
for _, dc := range devcontainers {
expanded = append(expanded, expandDevcontainerPaths(logger, expandPath, dc))
}
return expanded
}

func expandDevcontainerPaths(logger slog.Logger, expandPath func(string) (string, error), dc codersdk.WorkspaceAgentDevcontainer) codersdk.WorkspaceAgentDevcontainer {
logger = logger.With(slog.F("devcontainer", dc.Name), slog.F("workspace_folder", dc.WorkspaceFolder), slog.F("config_path", dc.ConfigPath))

Expand Down
4 changes: 1 addition & 3 deletions agent/agentcontainers/devcontainer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ func TestExtractAndInitializeDevcontainerScripts(t *testing.T) {
}
}
gotFilteredScripts, gotDevcontainerScripts := agentcontainers.ExtractAndInitializeDevcontainerScripts(
logger,
tt.args.expandPath,
tt.args.devcontainers,
agentcontainers.ExpandAllDevcontainerPaths(logger, tt.args.expandPath, tt.args.devcontainers),
tt.args.scripts,
)

Expand Down
5 changes: 5 additions & 0 deletions cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ func (r *RootCmd) configSSH() *serpent.Command {
}

if !bytes.Equal(configRaw, configModified) {
sshDir := filepath.Dir(sshConfigFile)
if err := os.MkdirAll(sshDir, 0700); err != nil {
return xerrors.Errorf("failed to create directory %q: %w", sshDir, err)
}

err = atomic.WriteFile(sshConfigFile, bytes.NewReader(configModified))
if err != nil {
return xerrors.Errorf("write ssh config failed: %w", err)
Expand Down
41 changes: 41 additions & 0 deletions cli/configssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,47 @@ func TestConfigSSH(t *testing.T) {
<-copyDone
}

func TestConfigSSH_MissingDirectory(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
t.Skip("See coder/internal#117")
}

client := coderdtest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)

// Create a temporary directory but don't create .ssh subdirectory
tmpdir := t.TempDir()
sshConfigPath := filepath.Join(tmpdir, ".ssh", "config")

// Run config-ssh with a non-existent .ssh directory
args := []string{
"config-ssh",
"--ssh-config-file", sshConfigPath,
"--yes", // Skip confirmation prompts
}
inv, root := clitest.New(t, args...)
clitest.SetupConfig(t, client, root)

err := inv.Run()
require.NoError(t, err, "config-ssh should succeed with non-existent directory")

// Verify that the .ssh directory was created
sshDir := filepath.Dir(sshConfigPath)
_, err = os.Stat(sshDir)
require.NoError(t, err, ".ssh directory should exist")

// Verify that the config file was created
_, err = os.Stat(sshConfigPath)
require.NoError(t, err, "config file should exist")

// Check that the directory has proper permissions (0700)
sshDirInfo, err := os.Stat(sshDir)
require.NoError(t, err)
require.Equal(t, os.FileMode(0700), sshDirInfo.Mode().Perm(), "directory should have 0700 permissions")
}

func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
t.Parallel()

Expand Down
Loading
Loading