Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pull] main from coder:main #273

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

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b5316d2
docs: fix a warning alert type on toolbox docs (#18560)
matifali Jun 25, 2025
f6d9765
fix(site): storybook: move spyOn to beforeEach (#18559)
mtojek Jun 25, 2025
c4e4fe8
fix(agent): start devcontainers through agentcontainers package (#18471)
DanielleMaywood Jun 25, 2025
42fd1c1
ci: cache embedded postgres downloaded binaries (#18477)
johnstcn Jun 25, 2025
434b546
fix(agent/agentcontainers): filter out "is test run" devcontainers (#…
mafredri Jun 25, 2025
9fde835
test(agent/agentcontainers): add is a test ignore label to integratio…
mafredri Jun 25, 2025
688d2ee
chore: remove chats experiment (#18535)
dannykopping Jun 25, 2025
3c4d920
feat(agent/agentcontainers): add feature options as envs (#18576)
mafredri Jun 25, 2025
072c81c
docs: remove nested alerts (#18580)
EdwardAngert Jun 25, 2025
e396b06
feat: allow new immutable parameters for existing workspaces (#18579)
Emyrk Jun 25, 2025
8e0b6f8
chore: upgrade aisdk-go lib, remove vestigial code (#18577)
dannykopping Jun 25, 2025
9d2f8dc
chore: bump github.com/openai/openai-go from 0.1.0-beta.10 to 1.6.0 (…
dependabot[bot] Jun 25, 2025
aef101f
chore: bump google.golang.org/genai from 0.7.0 to 1.12.0 (#18496)
dependabot[bot] Jun 25, 2025
6c713d5
fix(coderd/agentapi): make sub agent slugs more unique (#18581)
DanielleMaywood Jun 25, 2025
48bb534
chore: fix idle state icon when disabled (#18554)
code-asher Jun 25, 2025
09e1a8a
feat(.devcontainer): add code-server feature to `devcontainer.json` (…
mafredri Jun 25, 2025
fdf458e
refactor: remove beta label from 'select a preset' menu (#18538)
BrunoQuaresma Jun 25, 2025
fb0e7a2
docs: add Coder Desktop to remote desktop docs (#18326)
matifali Jun 26, 2025
634144f
fix: hide the preset parameter visibility switch when it has no effec…
SasSwart Jun 26, 2025
eca6381
feat(agent/agentcontainers): add more envs to readconfig for app URL …
mafredri Jun 26, 2025
f2d229e
fix!: use devcontainer ID when rebuilding a devcontainer (#18604)
DanielleMaywood Jun 26, 2025
872aef3
feat(.devcontainer): install dotfiles if present (#18606)
mafredri Jun 26, 2025
c6e0ba1
feat: graduate prebuilds to general availability (#18607)
SasSwart Jun 26, 2025
87d052e
feat(.devcontainer): add cursor, filebrowser, windsurf and zed (#18608)
mafredri Jun 26, 2025
5ae320e
fix(agent/agentcontainers): chown coder binary (#18611)
DanielleMaywood Jun 26, 2025
98c77fe
fix(agent/agentcontainers): stop logging empty lines (#18605)
DanielleMaywood Jun 26, 2025
1b1d091
fix: pin Nix version to 2.28.4 to avoid JSON type error (#18612)
ThomasK33 Jun 26, 2025
e03d132
test(agent): fix TestAgent_DevcontainerRecreate (#18618)
mafredri Jun 26, 2025
09cc906
chore: remove unnecessary redeclarations in for loops (part 2) (#18593)
aslilac Jun 26, 2025
4f44dd0
fix(agent/agentcontainers): prevent reassigning proc.agent until succ…
mafredri Jun 26, 2025
7a3a6d4
chore: update README logos (#18619)
sreya Jun 26, 2025
7387905
fix(agent/agentcontainers): refresh containers before status change (…
mafredri Jun 26, 2025
7b0b649
fix(.devcontainer): start docker and install devcontainer CLI (#18621)
mafredri Jun 26, 2025
d5e3419
revert: fix(agent/agentcontainers): refresh containers before status …
mafredri Jun 26, 2025
05f6d69
chore: parse app status link (#18439)
code-asher Jun 26, 2025
9ab9c52
chore(site): set `server.allowedHosts` in storybook config to `.coder…
ethanndickson Jun 27, 2025
9e1cf16
fix: cap max X11 forwarding ports and evict old (#18561)
spikecurtis Jun 27, 2025
6bebfd0
fix: use memmap file system for TestServer_X11 (#18562)
spikecurtis Jun 27, 2025
abcf3df
chore: move InProcNet to testutil (#18563)
spikecurtis Jun 27, 2025
a5bfb20
chore: refactor TestServer_X11 to use inproc networking (#18564)
spikecurtis Jun 27, 2025
3cb9b20
chore: improve rbac and add benchmark tooling (#18584)
ssncferreira Jun 27, 2025
7e99fb7
fix(agent): delay containerAPI init to ensure startup scripts run bef…
mafredri Jun 27, 2025
66f22d7
chore: add unit test for X11 eviction (#18565)
spikecurtis Jun 27, 2025
73c742a
chore: test eviction with used ports (#18566)
spikecurtis Jun 27, 2025
a02d5a6
chore: update X11 forward session usage when there is a connection (#…
spikecurtis Jun 27, 2025
d26d0fc
docs: edit descriptions in ai-coder section (#18373)
EdwardAngert Jun 27, 2025
f0251df
chore: retry postgres connection on reset by peer in tests (#18632)
spikecurtis Jun 27, 2025
2d44add
feat: add task link in the workspace page when it is running a task (…
BrunoQuaresma Jun 27, 2025
59a6541
refactor: move required external auth buttons to the submit side (#18…
BrunoQuaresma Jun 27, 2025
8ee2668
fix(agent): fix script filtering for devcontainers (#18635)
mafredri Jun 27, 2025
1c87796
refactor: show the apps as soon as possible (#18625)
BrunoQuaresma Jun 27, 2025
29ef3a8
feat: redirect to the task page after creation (#18626)
BrunoQuaresma Jun 27, 2025
6d305df
fix: use default preset when creating a workspace for task (#18623)
BrunoQuaresma Jun 27, 2025
b4aa643
fix(agent/agentcontainers): ensure proper channel closure for updateT…
mafredri Jun 27, 2025
e46d892
fix(.devcontainer): remove double slash from zed path (#18639)
mafredri Jun 27, 2025
0f3a1e9
fix(agent/agentcontainers): split Init into Init and Start for early …
mafredri Jun 27, 2025
8eebb4f
feat: make task panels resizable (#18590)
BrunoQuaresma Jun 27, 2025
ff3ff01
chore: update logo description to specify maximum 3:1 aspect ratio (#…
blink-so[bot] Jun 27, 2025
5ae2151
chore: bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 (…
dependabot[bot] Jun 27, 2025
d4208d2
refactor: show icons for multi-select parameter options (#18594)
aslilac Jun 27, 2025
4095330
fix: use only template version ID to create task workspace (#18642)
BrunoQuaresma Jun 27, 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
45 changes: 42 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,57 @@
{
"name": "Development environments on your infrastructure",
"image": "codercom/oss-dogfood:latest",

"features": {
// See all possible options here https://github.com/devcontainers/features/tree/main/src/docker-in-docker
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": "false"
}
},
"ghcr.io/coder/devcontainer-features/code-server:1": {
"auth": "none",
"port": 13337
},
"./filebrowser": {}
},
// SYS_PTRACE to enable go debugging
"runArgs": ["--cap-add=SYS_PTRACE"],
"customizations": {
"vscode": {
"extensions": ["biomejs.biome"]
},
"coder": {
"apps": [
{
"slug": "cursor",
"displayName": "Cursor Desktop",
"url": "cursor://coder.coder-remote/openDevContainer?owner=${localEnv:CODER_WORKSPACE_OWNER_NAME}&workspace=${localEnv:CODER_WORKSPACE_NAME}&agent=${localEnv:CODER_WORKSPACE_PARENT_AGENT_NAME}&url=${localEnv:CODER_URL}&token=$SESSION_TOKEN&devContainerName=${localEnv:CONTAINER_ID}&devContainerFolder=${containerWorkspaceFolder}",
"external": true,
"icon": "/icon/cursor.svg",
"order": 1
},
{
"slug": "windsurf",
"displayName": "Windsurf Editor",
"url": "windsurf://coder.coder-remote/openDevContainer?owner=${localEnv:CODER_WORKSPACE_OWNER_NAME}&workspace=${localEnv:CODER_WORKSPACE_NAME}&agent=${localEnv:CODER_WORKSPACE_PARENT_AGENT_NAME}&url=${localEnv:CODER_URL}&token=$SESSION_TOKEN&devContainerName=${localEnv:CONTAINER_ID}&devContainerFolder=${containerWorkspaceFolder}",
"external": true,
"icon": "/icon/windsurf.svg",
"order": 4
},
{
"slug": "zed",
"displayName": "Zed Editor",
"url": "zed://ssh/${localEnv:CODER_WORKSPACE_AGENT_NAME}.${localEnv:CODER_WORKSPACE_NAME}.${localEnv:CODER_WORKSPACE_OWNER_NAME}.coder${containerWorkspaceFolder}",
"external": true,
"icon": "/icon/zed.svg",
"order": 5
}
]
}
}
},
"mounts": [
// Mount the entire home because conditional mounts are not supported.
// See: https://github.com/devcontainers/spec/issues/132
"source=${localEnv:HOME},target=/mnt/home/coder,type=bind,readonly"
],
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
"postStartCommand": "sudo service docker start"
}
50 changes: 50 additions & 0 deletions .devcontainer/filebrowser/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"id": "filebrowser",
"version": "0.0.1",
"name": "File Browser",
"description": "A web-based file browser for your development container",
"options": {
"port": {
"type": "string",
"default": "13339",
"description": "The port to run filebrowser on"
},
// "folder": {
// "type": "string",
// "default": "${containerWorkspaceFolder}",
// "description": "The root directory for filebrowser to serve"
// },
"auth": {
"type": "string",
"enum": [
"none",
"password"
],
"default": "none",
"description": "Authentication method (none or password)"
}
},
"entrypoint": "/usr/local/bin/filebrowser-entrypoint",
"dependsOn": {
"ghcr.io/devcontainers/features/common-utils:2": {}
},
"customizations": {
"coder": {
"apps": [
{
"slug": "filebrowser",
"displayName": "File Browser",
"url": "http://localhost:${localEnv:FEATURE_FILEBROWSER_OPTION_PORT:13339}",
"icon": "/icon/filebrowser.svg",
"order": 3,
"subdomain": true,
"healthcheck": {
"url": "http://localhost:${localEnv:FEATURE_FILEBROWSER_OPTION_PORT:13339}/health",
"interval": 5,
"threshold": 6
}
}
]
}
}
}
56 changes: 56 additions & 0 deletions .devcontainer/filebrowser/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash

set -euo pipefail

BOLD='\033[0;1m'

printf "%sInstalling filebrowser\n\n" "${BOLD}"

# Check if filebrowser is installed.
if ! command -v filebrowser &>/dev/null; then
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
fi

printf "πŸ₯³ Installation complete!\n\n"

# Create run script.
cat >/usr/local/bin/filebrowser-entrypoint <<EOF
#!/bin/bash

printf "πŸ› οΈ Configuring filebrowser\n\n"

AUTH="${AUTH}"
PORT="${PORT}"
FOLDER="$(pwd)"
LOG_PATH=/tmp/filebrowser.log
export FB_DATABASE="/tmp/filebrowser.db"

# Check if filebrowser db exists.
if [[ ! -f "\${FB_DATABASE}" ]]; then
filebrowser config init
if [[ "\$AUTH" == "password" ]]; then
filebrowser users add admin admin --perm.admin=true --viewMode=mosaic
fi
fi

# Configure filebrowser.
if [[ "\$AUTH" == "none" ]]; then
filebrowser config set --port="\${PORT}" --auth.method=noauth --root="\${FOLDER}"
else
filebrowser config set --port="\${PORT}" --auth.method=json --root="\${FOLDER}"
fi

set -euo pipefail

printf "πŸ‘· Starting filebrowser...\n\n"
printf "πŸ“‚ Serving \${FOLDER} at http://localhost:\${PORT}\n\n"

filebrowser >>\${LOG_PATH} 2>&1 &

printf "πŸ“ Logs at \${LOG_PATH}\n\n"
EOF

chmod +x /usr/local/bin/filebrowser-entrypoint

printf "βœ… File Browser installed!\n\n"
printf "πŸš€ Run 'filebrowser-entrypoint' to start the service\n\n"
59 changes: 59 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh

install_devcontainer_cli() {
npm install -g @devcontainers/cli
}

install_ssh_config() {
echo "πŸ”‘ Installing SSH configuration..."
rsync -a /mnt/home/coder/.ssh/ ~/.ssh/
chmod 0700 ~/.ssh
}

install_git_config() {
echo "πŸ“‚ Installing Git configuration..."
if [ -f /mnt/home/coder/git/config ]; then
rsync -a /mnt/home/coder/git/ ~/.config/git/
elif [ -d /mnt/home/coder/.gitconfig ]; then
rsync -a /mnt/home/coder/.gitconfig ~/.gitconfig
else
echo "⚠️ Git configuration directory not found."
fi
}

install_dotfiles() {
if [ ! -d /mnt/home/coder/.config/coderv2/dotfiles ]; then
echo "⚠️ Dotfiles directory not found."
return
fi

cd /mnt/home/coder/.config/coderv2/dotfiles || return
for script in install.sh install bootstrap.sh bootstrap script/bootstrap setup.sh setup script/setup; do
if [ -x $script ]; then
echo "πŸ“¦ Installing dotfiles..."
./$script || {
echo "❌ Error running $script. Please check the script for issues."
return
}
echo "βœ… Dotfiles installed successfully."
return
fi
done
echo "⚠️ No install script found in dotfiles directory."
}

personalize() {
# Allow script to continue as Coder dogfood utilizes a hack to
# synchronize startup script execution.
touch /tmp/.coder-startup-script.done

if [ -x /mnt/home/coder/personalize ]; then
echo "🎨 Personalizing environment..."
/mnt/home/coder/personalize
fi
}

install_devcontainer_cli
install_ssh_config
install_dotfiles
personalize
47 changes: 47 additions & 0 deletions .github/actions/embedded-pg-cache/download/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Download Embedded Postgres Cache"
description: |
Downloads the embedded postgres cache and outputs today's cache key.
A PR job can use a cache if it was created by its base branch, its current
branch, or the default branch.
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
outputs:
cache-key:
description: "Today's cache key"
value: ${{ steps.vars.outputs.cache-key }}
inputs:
key-prefix:
description: "Prefix for the cache key"
required: true
cache-path:
description: "Path to the cache directory"
required: true
runs:
using: "composite"
steps:
- name: Get date values and cache key
id: vars
shell: bash
run: |
export YEAR_MONTH=$(date +'%Y-%m')
export PREV_YEAR_MONTH=$(date -d 'last month' +'%Y-%m')
export DAY=$(date +'%d')
echo "year-month=$YEAR_MONTH" >> $GITHUB_OUTPUT
echo "prev-year-month=$PREV_YEAR_MONTH" >> $GITHUB_OUTPUT
echo "cache-key=${{ inputs.key-prefix }}-${YEAR_MONTH}-${DAY}" >> $GITHUB_OUTPUT

# By default, depot keeps caches for 14 days. This is plenty for embedded
# postgres, which changes infrequently.
# https://depot.dev/docs/github-actions/overview#cache-retention-policy
- name: Download embedded Postgres cache
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ inputs.cache-path }}
key: ${{ steps.vars.outputs.cache-key }}
# > If there are multiple partial matches for a restore key, the action returns the most recently created cache.
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
# The second restore key allows non-main branches to use the cache from the previous month.
# This prevents PRs from rebuilding the cache on the first day of the month.
# It also makes sure that once a month, the cache is fully reset.
restore-keys: |
${{ inputs.key-prefix }}-${{ steps.vars.outputs.year-month }}-
${{ github.ref != 'refs/heads/main' && format('{0}-{1}-', inputs.key-prefix, steps.vars.outputs.prev-year-month) || '' }}
18 changes: 18 additions & 0 deletions .github/actions/embedded-pg-cache/upload/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Upload Embedded Postgres Cache"
description: Uploads the embedded Postgres cache. This only runs on the main branch.
inputs:
cache-key:
description: "Cache key"
required: true
cache-path:
description: "Path to the cache directory"
required: true
runs:
using: "composite"
steps:
- name: Upload Embedded Postgres cache
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }}
33 changes: 33 additions & 0 deletions .github/actions/setup-embedded-pg-cache-paths/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Setup Embedded Postgres Cache Paths"
description: Sets up a path for cached embedded postgres binaries.
outputs:
embedded-pg-cache:
description: "Value of EMBEDDED_PG_CACHE_DIR"
value: ${{ steps.paths.outputs.embedded-pg-cache }}
cached-dirs:
description: "directories that should be cached between CI runs"
value: ${{ steps.paths.outputs.cached-dirs }}
runs:
using: "composite"
steps:
- name: Override Go paths
id: paths
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const path = require('path');

// RUNNER_TEMP should be backed by a RAM disk on Windows if
// coder/setup-ramdisk-action was used
const runnerTemp = process.env.RUNNER_TEMP;
const embeddedPgCacheDir = path.join(runnerTemp, 'embedded-pg-cache');
core.exportVariable('EMBEDDED_PG_CACHE_DIR', embeddedPgCacheDir);
core.setOutput('embedded-pg-cache', embeddedPgCacheDir);
const cachedDirs = `${embeddedPgCacheDir}`;
core.setOutput('cached-dirs', cachedDirs);

- name: Create directories
shell: bash
run: |
set -e
mkdir -p "$EMBEDDED_PG_CACHE_DIR"
23 changes: 21 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,17 @@ jobs:
with:
key-prefix: test-go-pg-${{ runner.os }}-${{ runner.arch }}

- name: Setup Embedded Postgres Cache Paths
id: embedded-pg-cache
uses: ./.github/actions/setup-embedded-pg-cache-paths

- name: Download Embedded Postgres Cache
id: download-embedded-pg-cache
uses: ./.github/actions/embedded-pg-cache/download
with:
key-prefix: embedded-pg-${{ runner.os }}-${{ runner.arch }}
cache-path: ${{ steps.embedded-pg-cache.outputs.cached-dirs }}

- name: Normalize File and Directory Timestamps
shell: bash
# Normalize file modification timestamps so that go test can use the
Expand All @@ -497,12 +508,12 @@ jobs:
# Create a temp dir on the R: ramdisk drive for Windows. The default
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
mkdir -p "R:/temp/embedded-pg"
go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg"
go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg" -cache "${EMBEDDED_PG_CACHE_DIR}"
elif [ "${{ runner.os }}" == "macOS" ]; then
# Postgres runs faster on a ramdisk on macOS too
mkdir -p /tmp/tmpfs
sudo mount_tmpfs -o noowners -s 8g /tmp/tmpfs
go run scripts/embedded-pg/main.go -path /tmp/tmpfs/embedded-pg
go run scripts/embedded-pg/main.go -path /tmp/tmpfs/embedded-pg -cache "${EMBEDDED_PG_CACHE_DIR}"
elif [ "${{ runner.os }}" == "Linux" ]; then
make test-postgres-docker
fi
Expand Down Expand Up @@ -571,6 +582,14 @@ jobs:
with:
cache-key: ${{ steps.download-cache.outputs.cache-key }}

- name: Upload Embedded Postgres Cache
uses: ./.github/actions/embedded-pg-cache/upload
# We only use the embedded Postgres cache on macOS and Windows runners.
if: runner.OS == 'macOS' || runner.OS == 'Windows'
with:
cache-key: ${{ steps.download-embedded-pg-cache.outputs.cache-key }}
cache-path: "${{ steps.embedded-pg-cache.outputs.embedded-pg-cache }}"

- name: Upload test stats to Datadog
timeout-minutes: 1
continue-on-error: true
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/dogfood.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Nix
uses: nixbuild/nix-quick-install-action@889f3180bb5f064ee9e3201428d04ae9e41d54ad # v31
uses: nixbuild/nix-quick-install-action@63ca48f939ee3b8d835f4126562537df0fee5b91 # v32
with:
# Pinning to 2.28 here, as Nix gets a "error: [json.exception.type_error.302] type must be array, but is string"
# on version 2.29 and above.
nix_version: "2.28.4"

- uses: nix-community/cache-nix-action@135667ec418502fa5a3598af6fb9eb733888ce6a # v6.1.3
with:
Expand Down
Loading
Loading