Skip to content

[pull] main from coder:main #96

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 342 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
342 commits
Select commit Hold shift + click to select a range
da5d5ba
fix: implement prebuild schedules methods for dbmem (#18469)
evgeniy-scherbina Jun 20, 2025
8e3022e
docs: add documentation for prebuild scheduling feature (#18462)
evgeniy-scherbina Jun 20, 2025
9c1feff
docs: add troubleshooting section to JetBrains Toolbox docs (#18394)
matifali Jun 20, 2025
d61353f
fix(agent/agentcontainers): read WorkspaceFolder from config (#18467)
DanielleMaywood Jun 20, 2025
72f7d70
feat: allow TemplateAdmin to delete prebuilds via auth layer (#18333)
ssncferreira Jun 20, 2025
9b5d499
chore: refactor dynamic parameters into dedicated package (#18420)
Emyrk Jun 20, 2025
556b095
chore: add cacheCloser to cleanup all opened files (#18473)
Emyrk Jun 20, 2025
4fe0a4b
feat: add ephemeral parameter dialog for workspace start/restart (#18…
blink-so[bot] Jun 20, 2025
fae30a0
chore: remove unnecessary redeclarations in for loops (#18440)
aslilac Jun 20, 2025
6e4508e
chore: assume template versions without tf values to be empty (#18479)
Emyrk Jun 20, 2025
cbe4627
docs: document how to tag coder users in dx data cloud (#17805)
EdwardAngert Jun 20, 2025
579c851
chore: update template opt-in checkbox (#18481)
jaaydenh Jun 20, 2025
0258f1d
docs: update Railway.com installation link (#18484)
matifali Jun 20, 2025
0a483ea
feat: add idle app status (#18415)
code-asher Jun 20, 2025
738442b
chore: add amazon-q icon SVG to static icons (#18295)
DevelopmentCats Jun 21, 2025
725bc37
fix: restrict database access from outside in docker compose installa…
jabacrack Jun 21, 2025
49fcffc
fix!: stop workspace before update (#18425)
johnstcn Jun 23, 2025
66e8dbb
feat: persist generated `coder_app` id (#18487)
dannykopping Jun 23, 2025
0a12ec5
fix(enterprise/coderd): skip org membership check for prebuilds user …
johnstcn Jun 23, 2025
c3bc1e7
feat(agent/agentcontainers): fall back to workspace folder name (#18466)
DanielleMaywood Jun 23, 2025
2f55e29
fix: complete job and mark workspace as deleted when no provisioners …
johnstcn Jun 23, 2025
183eaa2
ci: bump the github-actions group with 5 updates (#18497)
dependabot[bot] Jun 23, 2025
ba08d38
chore: bump github.com/coder/terraform-provider-coder/v2 from 2.6.0 t…
dependabot[bot] Jun 23, 2025
659b787
chore: set wsbuilder to use preview parameters (#18474)
Emyrk Jun 23, 2025
c1b35bf
chore: use database in current context for file cache (#18490)
Emyrk Jun 23, 2025
7254c08
chore: remove parallel queries in the same transaction (#18489)
Emyrk Jun 23, 2025
82af2e0
feat: implement dynamic parameter validation (#18482)
Emyrk Jun 23, 2025
4699393
fix: upsert `coder_app` resources in case they are persistent (#18509)
dannykopping Jun 23, 2025
7dd90f3
chore: show iframe controls on preview slug only (#18480)
code-asher Jun 23, 2025
6877142
feat: create experimental template embed page for dynamic params (#17…
jaaydenh Jun 23, 2025
f6e4ba6
chore: remove per request dynamic parameters opt in and rely on templ…
Emyrk Jun 23, 2025
5ed0c7a
chore: improve dynamic parameter validation errors (#18501)
Emyrk Jun 23, 2025
796dc7a
chore: ignore splunk.com in linkspector (#18502)
dannykopping Jun 24, 2025
4f98fd4
fix: fix validation error during workspace creation without preset (#…
SasSwart Jun 24, 2025
d892427
fix: do not warn on valid known experiments (#18514)
johnstcn Jun 24, 2025
9d148e9
chore: fix wsproxy flakes (#18522)
deansheather Jun 24, 2025
2afd1a2
chore: disable devtunnel tests on windows (#18521)
deansheather Jun 24, 2025
7c40f86
feat(cli): include license status in support bundle (#18472)
kacpersaw Jun 24, 2025
3fb5d0b
fix(agent/agentcontainers): use correct env for execer commands (#18508)
mafredri Jun 24, 2025
6cc4cfa
feat: allow for default presets (#18445)
dannykopping Jun 24, 2025
0238f29
feat: persist AI task state in template imports & workspace builds (#…
dannykopping Jun 24, 2025
670fa4a
feat: add the /aitasks/prompts endpoint (#18464)
hugodutka Jun 24, 2025
b091b99
chore: update VPN proto to match additional types used by Coder Deskt…
ibetitsmike Jun 24, 2025
4066785
fix: agentcontainers: fix flake when ctx cancelled while running dock…
johnstcn Jun 24, 2025
7b152cd
chore: increase fileCache hit rate in autobuilds lifecycle (#18507)
Emyrk Jun 24, 2025
bca5c35
fix: remove notifications for hard-limited prebuilds (#18528)
evgeniy-scherbina Jun 24, 2025
31d0c6f
feat: add better error display for workspace builds (#18518)
jaaydenh Jun 24, 2025
403f1c3
fix: add bottom padding back (#18476)
jaaydenh Jun 24, 2025
45ab265
chore: add permissions to autobuilder & prebuilder to run wsbuild (#1…
Emyrk Jun 24, 2025
4ff2254
chore: remove ai tasks from experiment (#18511)
hugodutka Jun 24, 2025
1d2b96b
feat: implement efficient backend querying on the tasks page (#18488)
hugodutka Jun 24, 2025
a4f1c64
fix: allow dynamic parameters to consider the prebuilds user an owner…
SasSwart Jun 24, 2025
5816455
fix: remove reference to a deleted variable (#18532)
hugodutka Jun 24, 2025
341b54e
fix: allow dynamic parameters without requiring org membership (#18531)
Emyrk Jun 24, 2025
f44969b
chore: reorder prebuilt workspace authorization logic (#18506)
ssncferreira Jun 24, 2025
dc24922
fix: use the correct key for tasks tab visibility in embedded metadat…
hugodutka Jun 24, 2025
cd484db
fix: only override img size for direct button children (#18540)
BrunoQuaresma Jun 24, 2025
e5eb2a8
fix: prebuild user without ssh key when fetching owner ctx (#18541)
Emyrk Jun 24, 2025
ccf294e
chore: improve visuals of dynamic parameters (#18537)
jaaydenh Jun 24, 2025
b2009b2
chore: add a claude.md markdown file focusing on the frontend (#18510)
jaaydenh Jun 24, 2025
b6c493d
fix: correct hasAITaskResources logic for child modules (#18542)
hugodutka Jun 24, 2025
64a2214
fix(agent/agentcontainers): remove shellquote in favor of %q (#18544)
mafredri Jun 24, 2025
4fd0312
feat: use backend-supplied sidebar app id on the /task/$id page (#18458)
hugodutka Jun 24, 2025
fcf9371
feat(agent/agentcontainers): retry with longer name on failure (#18513)
DanielleMaywood Jun 24, 2025
99d124e
feat(agent): enable devcontainers by default (#18533)
mafredri Jun 24, 2025
7070e47
fix: update workspace table icons in WorkspacesTable (#18525)
johnstcn Jun 24, 2025
b9e32c8
refactor: remove unused enterprise prebuilds id.go (#18543)
ssncferreira Jun 24, 2025
06c997a
chore: make telemetry use_classic_parameter_flow nullable (#18547)
Emyrk Jun 24, 2025
e443f86
feat(agent/agentcontainers): implement ignore customization for devco…
mafredri Jun 24, 2025
b93db1c
fix: site: replace CirclePlayIcon with PlayIcon (#18549)
johnstcn Jun 24, 2025
6ed2204
chore: use pause icon for app idle state (#18546)
code-asher Jun 24, 2025
25f1b76
fix: handle empty strings for Select component (#18553)
jaaydenh Jun 24, 2025
fe22b2c
chore: update coder/preview dependency to v1.0.1 (#18550)
Emyrk Jun 24, 2025
a8e2c75
chore: update Coder icons to reflect new branding (#18517)
Parkreiner Jun 24, 2025
288ec77
feat: add workspace build status to task page (#18520)
code-asher Jun 24, 2025
79c666b
fix(vpn): avoid setting session token header twice (#18524)
ethanndickson Jun 25, 2025
312d2a4
docs: update Claude's guide (#18523)
emmanuel-ferdman Jun 25, 2025
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
e97540a
chore: work around race in lib/pq (#18655)
spikecurtis Jun 30, 2025
d814fdf
fix(.devcontainer): add home volume and fix code-server and filebrows…
mafredri Jun 30, 2025
f89e057
chore: add beta badge to tasks (#18656)
dannykopping Jun 30, 2025
c8bc8d3
chore: bump github.com/moby/moby from 28.2.2+incompatible to 28.3.0+i…
dependabot[bot] Jun 30, 2025
7f23be3
chore: bump github.com/andybalholm/brotli from 1.1.1 to 1.2.0 (#18661)
dependabot[bot] Jun 30, 2025
851cda5
ci: bump the github-actions group with 3 updates (#18665)
dependabot[bot] Jun 30, 2025
b1e8d5d
docs: remove beta label from Coder Desktop (#18651)
matifali Jun 30, 2025
715c7b0
chore: correct RD limitation comment (#18668)
rudskoy Jun 30, 2025
9ccaf86
fix(agent/agentcontainers): always derive devcontainer name from work…
mafredri Jun 30, 2025
b7cb275
fix: stop tearing down non-TTY processes on SSH session end (#18673)
spikecurtis Jun 30, 2025
22c5e84
fix: handle health status when displaying task apps (#18675)
hugodutka Jun 30, 2025
ad67733
fix: display error message on delete workspace error (#18654)
jaaydenh Jun 30, 2025
fc7700a
fix: improve reliability of app statuses (#18622)
code-asher Jun 30, 2025
4756080
feat(site): display devcontainer start error (#18637)
DanielleMaywood Jun 30, 2025
74e1953
docs: bitnami/postgresql primary prefix for persistence.size config k…
Perdjesk Jun 30, 2025
695de6e
chore(coderd/database): optimize AuditLogs queries (#18600)
kacpersaw Jul 1, 2025
0f56f00
chore: add `which-release` script (#18657)
dannykopping Jul 1, 2025
258a839
chore(coderd/database): optimize GetRunningPrebuiltWorkspaces (#18588)
johnstcn Jul 1, 2025
7e372f7
fix(agent/agentcontainers): reset error at start of rebuild (#18686)
DanielleMaywood Jul 1, 2025
3d22e27
fix: handle task sidebar app health check disabled correctly (#18687)
hugodutka Jul 1, 2025
4e95b1d
fix: revert changes to GetRunningPrebuiltWorkspaces (#18688)
johnstcn Jul 1, 2025
57a6d59
docs: add warning about prebuilds incompatibility with certain featur…
ssncferreira Jul 1, 2025
dbfbef6
chore(cli): increase reconciliation interval to 1 minute (#18690)
johnstcn Jul 1, 2025
6f2834f
feat: oauth2 - add authorization server metadata endpoint and PKCE su…
ThomasK33 Jul 1, 2025
1158ca2
fix(dogfood/coder): run go clean cache at workspace shutdown (#18685)
mafredri Jul 1, 2025
d14e9be
feat: add Coder registry links to template creation and editing (#18680)
f0ssel Jul 1, 2025
ab254ad
docs: add section about how to disable path based apps to security be…
EdwardAngert Jul 1, 2025
d22ac1c
chore: don't cache errors in file cache (#18555)
aslilac Jul 1, 2025
0b82f41
feat: allow masking workspace parameter inputs (#18595)
aslilac Jul 1, 2025
0b8ed9c
docs: move the duplicate Coder Desktop install warning to Troubleshoo…
matifali Jul 2, 2025
8a69f6a
fix(agent/agentcontainers): avoid logspam in API updaterLoop (#18710)
mafredri Jul 2, 2025
59c8b56
test: add test that we close stdin on SSH session close (#18711)
spikecurtis Jul 2, 2025
91aa583
docs: mention Windsurf module in Windsurf documentation (#18715)
blink-so[bot] Jul 2, 2025
4072d22
feat: support dynamic parameters on create template request (#18636)
Emyrk Jul 2, 2025
01163ea
feat: allow users to pause prebuilt workspace reconciliation (#18700)
SasSwart Jul 2, 2025
f0c9c4d
feat: oauth2 - add RFC 8707 resource indicators and audience validati…
ThomasK33 Jul 2, 2025
630804e
chore: fix duplicate migration 000345 (#18721)
johnstcn Jul 2, 2025
1b73b1a
docs: add Go LSP MCP configs and tools guide for code navigation (#18…
ThomasK33 Jul 2, 2025
33bbf18
feat: add OAuth2 protected resource metadata endpoint for RFC 9728 (#…
ThomasK33 Jul 2, 2025
eade5b0
fix: handle null response from the template presets endpoint (#18723)
hugodutka Jul 2, 2025
09c5055
feat: implement RFC 6750 Bearer token authentication (#18644)
ThomasK33 Jul 2, 2025
6db6f48
chore: fix broken link in docs (#18733)
rowansmithau Jul 3, 2025
7500aa4
fix(cli): calculate coder ping max correctly (#18734)
ethanndickson Jul 3, 2025
db8ed00
chore: add rdp icon (#18736)
matifali Jul 3, 2025
61b6562
feat: display descriptions in multi-select component (#18730)
jaaydenh Jul 3, 2025
3517457
docs: update release calendar with 2.24 release (#18742)
matifali Jul 3, 2025
8b6d70b
fix(site): update vs code dev container button URLs (#18696)
mafredri Jul 3, 2025
7d412c2
feat(examples/templates): add `docker-devcontainer` template and rena…
mafredri Jul 3, 2025
699dd8e
chore: create interface for pkgs to return codersdk errors (#18719)
Emyrk Jul 3, 2025
74e1d5c
feat: implement OAuth2 dynamic client registration (RFC 7591/7592) (#…
ThomasK33 Jul 3, 2025
4dcf0c3
docs: add comprehensive development documentation (#18646)
ThomasK33 Jul 3, 2025
90a875d
chore: implement tests for dynamic parameter component (#18745)
jaaydenh Jul 3, 2025
60b08f0
fix: remove unique constraint on OAuth2 provider app names (#18669)
ThomasK33 Jul 3, 2025
494dccc
feat: implement MCP HTTP server endpoint with authentication (#18670)
ThomasK33 Jul 3, 2025
2c95a1d
chore: update gofumpt from v0.4.0 to v0.8.0 (#18652)
blink-so[bot] Jul 3, 2025
1555154
feat: add OAuth2 provider functionality as an experiment (#18692)
ThomasK33 Jul 3, 2025
7fbb3ce
feat: add MCP HTTP server experiment and improve experiment middlewar…
ThomasK33 Jul 3, 2025
c650133
refactor: move OAuth2 provider code to dedicated package (#18746)
ThomasK33 Jul 3, 2025
4607e51
refactor: organize OAuth2 provider tests into dedicated packages (#18…
ThomasK33 Jul 3, 2025
a099a8a
feat: use preview to compute workspace tags from terraform (#18720)
Emyrk Jul 3, 2025
5ad1847
fix: add manual confirmation for release calendar update (#18748)
blink-so[bot] Jul 3, 2025
369bccd
feat: establish terminal reconnection foundation (#18693)
BrunoQuaresma Jul 3, 2025
02372ca
docs: align feature stages for July release (#18752)
EdwardAngert Jul 4, 2025
ca13b58
docs: reorganize remote desktop docs (#18716)
matifali Jul 6, 2025
aad14b8
docs: add RDP desktop button gif (#18758)
matifali Jul 6, 2025
a1c77e3
fix: handle `sql/driver.Valuer` types properly in `json` logs (#18760)
ethanndickson Jul 7, 2025
6580971
feat: make readinessProbe and livenessProbe initialDelaySeconds confi…
blink-so[bot] Jul 7, 2025
b26c9e2
feat: update tasks docs (#18659)
bpmct Jul 7, 2025
1e715e2
chore: add suggestions to the tasks docs (#18766)
hugodutka Jul 7, 2025
3477ed6
ci: bump the github-actions group with 6 updates (#18769)
dependabot[bot] Jul 7, 2025
ededcd0
chore: bump go.nhat.io/otelsql from 0.15.0 to 0.16.0 (#18768)
dependabot[bot] Jul 7, 2025
e3627fd
docs: fix markdown in Windsurf doc (#18753)
EdwardAngert Jul 7, 2025
52ff531
chore: bump github.com/go-playground/validator/v10 from 10.26.0 to 10…
dependabot[bot] Jul 7, 2025
935bd34
chore: bump github.com/valyala/fasthttp from 1.62.0 to 1.63.0 (#18771)
dependabot[bot] Jul 7, 2025
f298316
chore: fix some small groups and acl typos (#18732)
aslilac Jul 7, 2025
3dcd2ac
fix: return 404 instead of 401 for missing OAuth2 apps (#18755)
ThomasK33 Jul 7, 2025
83192e2
docs: restore missing AI agent images to fix 404 errors (#18780)
blink-so[bot] Jul 7, 2025
2f42b64
docs: update dynamic parameters for beta release (#18512)
EdwardAngert Jul 8, 2025
8202514
feat!: add ability to cancel pending workspace build (#18713)
kacpersaw Jul 8, 2025
1195f31
chore(site): reduce fetch interval on workspaces page (#18725)
johnstcn Jul 8, 2025
0118e75
fix(agent): disable dev container integration inside sub agents (#18781)
DanielleMaywood Jul 8, 2025
211393a
fix: exclude prebuilt workspaces from lifecycle executor (#18762)
ssncferreira Jul 8, 2025
bf0271f
chore: stop running postgres-only tests if DB is not set (#18784)
spikecurtis Jul 8, 2025
ac4be15
chore(coderd/runtimeconfig): remove dbmem from tests (#18790)
hugodutka Jul 8, 2025
321396d
chore(coderd/rbac/rolestore): remove dbmem from tests (#18789)
hugodutka Jul 8, 2025
e0fb15e
chore(coderd/searchquery): remove dbmem from tests (#18791)
hugodutka Jul 8, 2025
7f68191
chore(coderd/updatecheck): remove dbmem from tests (#18792)
hugodutka Jul 8, 2025
f147ebf
chore(enterprise/audit): remove dbmem from tests (#18794)
hugodutka Jul 8, 2025
733d3f1
chore(enterprise/cli): remove dbmem from tests (#18795)
hugodutka Jul 8, 2025
0dc3612
chore(dogfood): update filebrowser module to version 1.1.1 (#18799)
ssncferreira Jul 8, 2025
b65e133
chore(enterprise/coderd): remove dbmem from tests (#18797)
hugodutka Jul 8, 2025
66e4909
chore(enterprise/trialer): remove dbmem from tests (#18798)
hugodutka Jul 8, 2025
5e9cbe8
chore(coderd): remove dbmem from tests (#18800)
hugodutka Jul 8, 2025
8e038db
chore(enterprise/replicasync): remove dbmem from tests (#18801)
hugodutka Jul 8, 2025
2f50b3b
chore(site): remove dbmem from tests (#18802)
hugodutka Jul 8, 2025
5f50dcc
feat(cli): improve devcontainer support for `coder show` (#18793)
mafredri Jul 8, 2025
6c4db7a
feat(cli): replace open vscode container with devcontainer subagent (…
mafredri Jul 8, 2025
10c1e36
feat: add publishing of helm charts to ghcr registry (#18316)
a1994sc Jul 8, 2025
39ed0c3
docs: simplify PostgreSQL setup by using 'postgresql' as release name…
blink-so[bot] Jul 8, 2025
79d1465
chore: update module sources for Windsurf, Zed and JetBrains (#18759)
matifali Jul 8, 2025
1319ae2
chore: support zip filetypes in the file cache (#18750)
Emyrk Jul 8, 2025
3c2f3d6
chore: remove dbmem (#18803)
hugodutka Jul 9, 2025
dc0919d
feat: sign coder binaries with the release key using GPG (#18774)
jdomeracki-coder Jul 9, 2025
0367dba
chore: optimize GetPrebuiltWorkspaces query (#18717)
johnstcn Jul 9, 2025
9c61ef8
test: fix DeploymentSidebarView stories (#18812)
BrunoQuaresma Jul 9, 2025
00ba027
chore: modify parameter dynamic immutability behavior (#18583)
Emyrk Jul 9, 2025
5a8a19b
feat: auto reconnect the terminal (#18796)
BrunoQuaresma Jul 9, 2025
b882d46
docs: fix relative links in about/contributing (#18818)
EdwardAngert Jul 9, 2025
c1b2304
test(agent/agentssh): use fish shell compatible exit status checking …
ethanndickson Jul 10, 2025
040fa30
docs: update screenshots with new logo (#18830)
EdwardAngert Jul 10, 2025
c25e666
docs: add coder registry link to docs sidebar (#18585)
matifali Jul 11, 2025
3126f21
revert: "docs: add coder registry link to docs sidebar" (#18837)
matifali Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
219 changes: 219 additions & 0 deletions .claude/docs/DATABASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# Database Development Patterns

## Database Work Overview

### Database Generation Process

1. Modify SQL files in `coderd/database/queries/`
2. Run `make gen`
3. If errors about audit table, update `enterprise/audit/table.go`
4. Run `make gen` again
5. Run `make lint` to catch any remaining issues

## Migration Guidelines

### Creating Migration Files

**Location**: `coderd/database/migrations/`
**Format**: `{number}_{description}.{up|down}.sql`

- Number must be unique and sequential
- Always include both up and down migrations

### Helper Scripts

| Script | Purpose |
|--------|---------|
| `./coderd/database/migrations/create_migration.sh "migration name"` | Creates new migration files |
| `./coderd/database/migrations/fix_migration_numbers.sh` | Renumbers migrations to avoid conflicts |
| `./coderd/database/migrations/create_fixture.sh "fixture name"` | Creates test fixtures for migrations |

### Database Query Organization

- **MUST DO**: Any changes to database - adding queries, modifying queries should be done in the `coderd/database/queries/*.sql` files
- **MUST DO**: Queries are grouped in files relating to context - e.g. `prebuilds.sql`, `users.sql`, `oauth2.sql`
- After making changes to any `coderd/database/queries/*.sql` files you must run `make gen` to generate respective ORM changes

## Handling Nullable Fields

Use `sql.NullString`, `sql.NullBool`, etc. for optional database fields:

```go
CodeChallenge: sql.NullString{
String: params.codeChallenge,
Valid: params.codeChallenge != "",
}
```

Set `.Valid = true` when providing values.

## Audit Table Updates

If adding fields to auditable types:

1. Update `enterprise/audit/table.go`
2. Add each new field with appropriate action:
- `ActionTrack`: Field should be tracked in audit logs
- `ActionIgnore`: Field should be ignored in audit logs
- `ActionSecret`: Field contains sensitive data
3. Run `make gen` to verify no audit errors

## Database Architecture

### Core Components

- **PostgreSQL 13+** recommended for production
- **Migrations** managed with `migrate`
- **Database authorization** through `dbauthz` package

### Authorization Patterns

```go
// Public endpoints needing system access (OAuth2 registration)
app, err := api.Database.GetOAuth2ProviderAppByClientID(dbauthz.AsSystemRestricted(ctx), clientID)

// Authenticated endpoints with user context
app, err := api.Database.GetOAuth2ProviderAppByClientID(ctx, clientID)

// System operations in middleware
roles, err := db.GetAuthorizationUserRoles(dbauthz.AsSystemRestricted(ctx), userID)
```

## Common Database Issues

### Migration Issues

1. **Migration conflicts**: Use `fix_migration_numbers.sh` to renumber
2. **Missing down migration**: Always create both up and down files
3. **Schema inconsistencies**: Verify against existing schema

### Field Handling Issues

1. **Nullable field errors**: Use `sql.Null*` types consistently
2. **Missing audit entries**: Update `enterprise/audit/table.go`

### Query Issues

1. **Query organization**: Group related queries in appropriate files
2. **Generated code errors**: Run `make gen` after query changes
3. **Performance issues**: Add appropriate indexes in migrations

## Database Testing

### Test Database Setup

```go
func TestDatabaseFunction(t *testing.T) {
db := dbtestutil.NewDB(t)

// Test with real database
result, err := db.GetSomething(ctx, param)
require.NoError(t, err)
require.Equal(t, expected, result)
}
```

## Best Practices

### Schema Design

1. **Use appropriate data types**: VARCHAR for strings, TIMESTAMP for times
2. **Add constraints**: NOT NULL, UNIQUE, FOREIGN KEY as appropriate
3. **Create indexes**: For frequently queried columns
4. **Consider performance**: Normalize appropriately but avoid over-normalization

### Query Writing

1. **Use parameterized queries**: Prevent SQL injection
2. **Handle errors appropriately**: Check for specific error types
3. **Use transactions**: For related operations that must succeed together
4. **Optimize queries**: Use EXPLAIN to understand query performance

### Migration Writing

1. **Make migrations reversible**: Always include down migration
2. **Test migrations**: On copy of production data if possible
3. **Keep migrations small**: One logical change per migration
4. **Document complex changes**: Add comments explaining rationale

## Advanced Patterns

### Complex Queries

```sql
-- Example: Complex join with aggregation
SELECT
u.id,
u.username,
COUNT(w.id) as workspace_count
FROM users u
LEFT JOIN workspaces w ON u.id = w.owner_id
WHERE u.created_at > $1
GROUP BY u.id, u.username
ORDER BY workspace_count DESC;
```

### Conditional Queries

```sql
-- Example: Dynamic filtering
SELECT * FROM oauth2_provider_apps
WHERE
($1::text IS NULL OR name ILIKE '%' || $1 || '%')
AND ($2::uuid IS NULL OR organization_id = $2)
ORDER BY created_at DESC;
```

### Audit Patterns

```go
// Example: Auditable database operation
func (q *sqlQuerier) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) {
// Implementation here

// Audit the change
if auditor := audit.FromContext(ctx); auditor != nil {
auditor.Record(audit.UserUpdate{
UserID: arg.ID,
Old: oldUser,
New: newUser,
})
}

return newUser, nil
}
```

## Debugging Database Issues

### Common Debug Commands

```bash
# Check database connection
make test-postgres

# Run specific database tests
go test ./coderd/database/... -run TestSpecificFunction

# Check query generation
make gen

# Verify audit table
make lint
```

### Debug Techniques

1. **Enable query logging**: Set appropriate log levels
2. **Use database tools**: pgAdmin, psql for direct inspection
3. **Check constraints**: UNIQUE, FOREIGN KEY violations
4. **Analyze performance**: Use EXPLAIN ANALYZE for slow queries

### Troubleshooting Checklist

- [ ] Migration files exist (both up and down)
- [ ] `make gen` run after query changes
- [ ] Audit table updated for new fields
- [ ] In-memory database implementations updated
- [ ] Nullable fields use `sql.Null*` types
- [ ] Authorization context appropriate for endpoint type
158 changes: 158 additions & 0 deletions .claude/docs/OAUTH2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# OAuth2 Development Guide

## RFC Compliance Development

### Implementing Standard Protocols

When implementing standard protocols (OAuth2, OpenID Connect, etc.):

1. **Fetch and Analyze Official RFCs**:
- Always read the actual RFC specifications before implementation
- Use WebFetch tool to get current RFC content for compliance verification
- Document RFC requirements in code comments

2. **Default Values Matter**:
- Pay close attention to RFC-specified default values
- Example: RFC 7591 specifies `client_secret_basic` as default, not `client_secret_post`
- Ensure consistency between database migrations and application code

3. **Security Requirements**:
- Follow RFC security considerations precisely
- Example: RFC 7592 prohibits returning registration access tokens in GET responses
- Implement proper error responses per protocol specifications

4. **Validation Compliance**:
- Implement comprehensive validation per RFC requirements
- Support protocol-specific features (e.g., custom schemes for native OAuth2 apps)
- Test edge cases defined in specifications

## OAuth2 Provider Implementation

### OAuth2 Spec Compliance

1. **Follow RFC 6749 for token responses**
- Use `expires_in` (seconds) not `expiry` (timestamp) in token responses
- Return proper OAuth2 error format: `{"error": "code", "error_description": "details"}`

2. **Error Response Format**
- Create OAuth2-compliant error responses for token endpoint
- Use standard error codes: `invalid_client`, `invalid_grant`, `invalid_request`
- Avoid generic error responses for OAuth2 endpoints

### PKCE Implementation

- Support both with and without PKCE for backward compatibility
- Use S256 method for code challenge
- Properly validate code_verifier against stored code_challenge

### UI Authorization Flow

- Use POST requests for consent, not GET with links
- Avoid dependency on referer headers for security decisions
- Support proper state parameter validation

### RFC 8707 Resource Indicators

- Store resource parameters in database for server-side validation (opaque tokens)
- Validate resource consistency between authorization and token requests
- Support audience validation in refresh token flows
- Resource parameter is optional but must be consistent when provided

## OAuth2 Error Handling Pattern

```go
// Define specific OAuth2 errors
var (
errInvalidPKCE = xerrors.New("invalid code_verifier")
)

// Use OAuth2-compliant error responses
type OAuth2Error struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description,omitempty"`
}

// Return proper OAuth2 errors
if errors.Is(err, errInvalidPKCE) {
writeOAuth2Error(ctx, rw, http.StatusBadRequest, "invalid_grant", "The PKCE code verifier is invalid")
return
}
```

## Testing OAuth2 Features

### Test Scripts

Located in `./scripts/oauth2/`:

- `test-mcp-oauth2.sh` - Full automated test suite
- `setup-test-app.sh` - Create test OAuth2 app
- `cleanup-test-app.sh` - Remove test app
- `generate-pkce.sh` - Generate PKCE parameters
- `test-manual-flow.sh` - Manual browser testing

Always run the full test suite after OAuth2 changes:

```bash
./scripts/oauth2/test-mcp-oauth2.sh
```

### RFC Protocol Testing

1. **Compliance Test Coverage**:
- Test all RFC-defined error codes and responses
- Validate proper HTTP status codes for different scenarios
- Test protocol-specific edge cases (URI formats, token formats, etc.)

2. **Security Boundary Testing**:
- Test client isolation and privilege separation
- Verify information disclosure protections
- Test token security and proper invalidation

## Common OAuth2 Issues

1. **OAuth2 endpoints returning wrong error format** - Ensure OAuth2 endpoints return RFC 6749 compliant errors
2. **Resource indicator validation failing** - Ensure database stores and retrieves resource parameters correctly
3. **PKCE tests failing** - Verify both authorization code storage and token exchange handle PKCE fields
4. **RFC compliance failures** - Verify against actual RFC specifications, not assumptions
5. **Authorization context errors in public endpoints** - Use `dbauthz.AsSystemRestricted(ctx)` pattern
6. **Default value mismatches** - Ensure database migrations match application code defaults
7. **Bearer token authentication issues** - Check token extraction precedence and format validation
8. **URI validation failures** - Support both standard schemes and custom schemes per protocol requirements

## Authorization Context Patterns

```go
// Public endpoints needing system access (OAuth2 registration)
app, err := api.Database.GetOAuth2ProviderAppByClientID(dbauthz.AsSystemRestricted(ctx), clientID)

// Authenticated endpoints with user context
app, err := api.Database.GetOAuth2ProviderAppByClientID(ctx, clientID)

// System operations in middleware
roles, err := db.GetAuthorizationUserRoles(dbauthz.AsSystemRestricted(ctx), userID)
```

## OAuth2/Authentication Work Patterns

- Types go in `codersdk/oauth2.go` or similar
- Handlers go in `coderd/oauth2.go` or `coderd/identityprovider/`
- Database fields need migration + audit table updates
- Always support backward compatibility

## Protocol Implementation Checklist

Before completing OAuth2 or authentication feature work:

- [ ] Verify RFC compliance by reading actual specifications
- [ ] Implement proper error response formats per protocol
- [ ] Add comprehensive validation for all protocol fields
- [ ] Test security boundaries and token handling
- [ ] Update RBAC permissions for new resources
- [ ] Add audit logging support if applicable
- [ ] Create database migrations with proper defaults
- [ ] Update in-memory database implementations
- [ ] Add comprehensive test coverage including edge cases
- [ ] Verify linting compliance
- [ ] Test both positive and negative scenarios
- [ ] Document protocol-specific patterns and requirements
Loading
Loading