Repository navigation
Tags
Tags
v0.0.32-pre0 Trial release: first terraform-provider-coderd release signed with the Cloud KMS key (EF0673941FEDAD5AA5AC2630EBCCC3677A166837).
chore(deps): bump github.com/coder/coder/v2 from 2.38.4 to 2.39.0 (#465) Bumps [github.com/coder/coder/v2](https://github.com/coder/coder) from 2.38.4 to 2.39.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/coder/coder/releases">github.com/coder/coder/v2's releases</a>.</em></p> <blockquote> <h2>v2.39.0</h2> <h2>Changelog</h2> <blockquote> <p>[!NOTE] This is a mainline Coder release. We advise enterprise customers without a staging environment to install our latest stable release while we refine this version. Learn more about our Release Schedule.</p> </blockquote> <h3>BREAKING CHANGES</h3> <ul> <li> <p>Connection log migration blocks reads and writes (<a href="https://redirect.github.com/coder/coder/issues/30466">#30466</a>)</p> <blockquote> <p>A migration rewrites the <code>connection_logs</code> table under a lock that blocks reads and writes, about 50 seconds per 10 million rows.</p> <p>Migration: Plan a maintenance window for large deployments.</p> </blockquote> </li> <li> <p>Template insights and Prometheus usage reporting are now per app (<a href="https://redirect.github.com/coder/coder/issues/29796">#29796</a>, <a href="https://redirect.github.com/coder/coder/issues/29906">#29906</a>)</p> <blockquote> <p>Template insights and the <code>coderd_insights_applications_usage_seconds</code> metric now report per app. In the API, <code>type</code> is replaced by <code>method</code>. In the metric, <code>application_name</code> is now <code>display_name</code>.</p> <p>Migration: Update dashboards, alerts and scripts.</p> </blockquote> </li> <li> <p>CLI confirmations and restart error reporting (<a href="https://redirect.github.com/coder/coder/issues/30150">#30150</a>, <a href="https://redirect.github.com/coder/coder/issues/30140">#30140</a>, <a href="https://redirect.github.com/coder/coder/issues/30199">#30199</a>)</p> <blockquote> <p><code>coder update</code> and <code>coder users edit-roles --roles</code> now ask for confirmation, so scripts need <code>-y</code>. <code>coder update</code> also returns an error if the restart fails.</p> </blockquote> </li> <li> <p>Unsafe workspace app URL schemes cause template builds to fail (<a href="https://redirect.github.com/coder/coder/issues/31262">#31262</a>)</p> <blockquote> <p>Template builds fail if a <code>coder_app</code> URL uses an unsafe scheme such as <code>javascript:</code>.</p> <p>Migration: Check templates before upgrading.</p> </blockquote> </li> <li> <p>API keys created from scoped tokens have restricted scopes (<a href="https://redirect.github.com/coder/coder/issues/30256">#30256</a>)</p> <blockquote> <p>API keys created from a scoped token can't go beyond that token's scopes.</p> </blockquote> </li> </ul> <h3>SECURITY</h3> <ul> <li>Server: Group sync may only add users to groups of the syncing org (<a href="https://redirect.github.com/coder/coder/issues/30706">#30706</a>, 296da93f6b) (<a href="https://github.com/eric-hughes-coder"><code>@eric-hughes-coder</code></a>)</li> </ul> <h3>Features</h3> <h4>AI Governance</h4> <h5>AI Gateway session costs and usage</h5> <ul> <li>Tidy AI Gateway sessions list columns and tooltips (<a href="https://redirect.github.com/coder/coder/issues/30733">#30733</a>, afe74722cc) (<a href="https://github.com/tracyjohnsonux"><code>@tracyjohnsonux</code></a>)</li> <li>Show cache tokens on AI Gateway session page (<a href="https://redirect.github.com/coder/coder/issues/30511">#30511</a>, 9efe7a3d67)</li> <li>Add cost to AI Gateway session threads API (<a href="https://redirect.github.com/coder/coder/issues/30509">#30509</a>, 15a5844253) (<a href="https://github.com/ssncferreira"><code>@ssncferreira</code></a>)</li> <li>Show cost and model prices on AI Gateway session page (<a href="https://redirect.github.com/coder/coder/issues/30512">#30512</a>, 5bd641a720)</li> <li>Add approximate cost note to AI Gateway session summary (<a href="https://redirect.github.com/coder/coder/issues/31259">#31259</a>, 926742b4d5) (<a href="https://github.com/ssncferreira"><code>@ssncferreira</code></a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/coder/coder/commit/8d897357dd61b3c564463356fdba40c64658e6e7"><code>8d89735</code></a> fix(coderd/httpmw): anchor CSRF exemption patterns (<a href="https://redirect.github.com/coder/coder/issues/31125">#31125</a>) (<a href="https://redirect.github.com/coder/coder/issues/31435">#31435</a>)</li> <li><a href="https://github.com/coder/coder/commit/823decdc54143b513899982e36cb999fffe97b0a"><code>823decd</code></a> docs: document ACP subagents (<a href="https://redirect.github.com/coder/coder/issues/31430">#31430</a>) (<a href="https://redirect.github.com/coder/coder/issues/31497">#31497</a>)</li> <li><a href="https://github.com/coder/coder/commit/e22dce114211d4764813b820b242b56c9000aace"><code>e22dce1</code></a> fix(site): show pinned and unloaded chats in project sidebar folders (<a href="https://redirect.github.com/coder/coder/issues/31343">#31343</a>)...</li> <li><a href="https://github.com/coder/coder/commit/cfe6303d63ad0cbf196d93fe29cab05af6330e85"><code>cfe6303</code></a> docs(docs): add Coder Agents projects page (<a href="https://redirect.github.com/coder/coder/issues/30684">#30684</a>) (<a href="https://redirect.github.com/coder/coder/issues/31429">#31429</a>)</li> <li><a href="https://github.com/coder/coder/commit/fcdd867c5eecb904c967834d40de23a802905d5d"><code>fcdd867</code></a> fix: bump gomarkdown/markdown to fix GHSA-cv23-7vc5-jfh7 (backport 2.39) (<a href="https://redirect.github.com/coder/coder/issues/31">#31</a>...</li> <li><a href="https://github.com/coder/coder/commit/48cd3a239a59684e84be152cca41693c715209ce"><code>48cd3a2</code></a> fix: bump bundled terraform to 1.17.1 (backport 2.39) (<a href="https://redirect.github.com/coder/coder/issues/31458">#31458</a>)</li> <li><a href="https://github.com/coder/coder/commit/289138dd3b1139889bd9cfbfeef673834e41f27c"><code>289138d</code></a> fix(coderd/database): lock the workspaces row when claiming a prebuild (<a href="https://redirect.github.com/coder/coder/issues/3151">#3151</a>...</li> <li><a href="https://github.com/coder/coder/commit/5f58fb27d2b7bf574fc69bfc5ffd54a0e66af5fe"><code>5f58fb2</code></a> fix: confine read_skill_file reads to the skill directory (<a href="https://redirect.github.com/coder/coder/issues/31462">#31462</a>) (<a href="https://redirect.github.com/coder/coder/issues/31487">#31487</a>)</li> <li><a href="https://github.com/coder/coder/commit/bb8912dc460119a62f0bea45ec944d6b6d00b92e"><code>bb8912d</code></a> fix: wait for full completion before asserting in tests (<a href="https://redirect.github.com/coder/coder/issues/30885">#30885</a>)</li> <li><a href="https://github.com/coder/coder/commit/296da93f6b538953895cfd7f7af6a5cf141b41fb"><code>296da93</code></a> fix(coderd/idpsync): Group sync may only add users to groups of the syncing o...</li> <li>Additional commits viewable in <a href="https://github.com/coder/coder/compare/v2.38.4...v2.39.0">compare view</a></li> </ul> </details> <br /> <details> <summary>Most Recent Ignore Conditions Applied to This Pull Request</summary> | Dependency Name | Ignore Conditions | | --- | --- | | github.com/coder/coder/v2 | [>= 2.15.0.a, < 2.15.1] | | github.com/coder/coder/v2 | [>= 2.18.0.a, < 2.18.1] | | github.com/coder/coder/v2 | [>= 2.35.a, < 2.36] | </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chore(coderd_template): drop workarounds for Coder versions before v2… ….15.0 (#450) `coderd_template` still had workarounds for Coder versions before v2.15.0, which couldn't set `max_port_share_level` when creating a template. After every create we sent a second PATCH just to set it, and at the end of every create and update we fetched the template again to get the real values. v2.15.0 came out over two years ago, so this removes both. We now send `max_port_share_level` in the create request, and read the update result straight from the PATCH response. The template resource now needs Coder v2.15.0 or later. One gotcha: without the port sharing control entitlement (i.e. AGPL), Coder rejects any `max_port_share_level` on create, even `public`, which is the only level it allows there. So we just leave it out in that case. The extra PATCH for `use_classic_parameter_flow` stays, as Coder only accepts it on create from v2.25.0.
feat: add coderd_ai_model_price resource (#445) Closes AIGOV-677 This adds a `coderd_ai_model_price` resource for managing custom AI Gateway model prices. It replaces the `model_config.cost` field we removed from `coderd_agents_model` in #413, which stopped doing anything once cost tracking moved to AI Gateway. I've made it a standalone resource rather than a field on `coderd_agents_model`, since prices are deployment-wide and keyed on provider type and model, whilst agents models are org-scoped. Plenty of AI Gateway users (Claude Code, Cursor, Copilot) won't have any agents models at all. For now the resource takes a `provider_type` string, since that's how prices are keyed today. AIGOV-612 will add per-provider prices, so we can either ship this as-is and add an optional `ai_provider_id` once that lands (which wouldn't break existing configs), or just wait for AIGOV-612. I'm happy to pick that up myself if we'd rather wait. Unfortunately, Coder has no API to delete a custom price, so for now destroying the resource just removes it from state and warns that the custom price is still set in Coder. Adding a delete endpoint to coder/coder would mean waiting on 2.38, whereas everything else the resource needs has been there since 2.37.0. We'll wire up a real delete once that endpoint exists.
feat(internal/provider): accept OpenAI reasoning_mode in coderd_agent… …s_model model_config (#444) Coder now supports OpenAI's Pro reasoning mode for chat models (coder/coder#29584): `provider_options.openai.reasoning_mode = "pro"` in the model config, for models from the GPT-5.6 Sol generation onward, including GPT-6 Astra. ## Problem `coderd_agents_model.model_config` is validated against the provider's pinned `codersdk.ChatModelCallConfig` at plan time (#388), so with the current `github.com/coder/coder/v2 v2.37.1` pin any config that sets the new field fails before it is ever sent to Coder: ``` Error: Unrecognized model_config settings model_config contains a setting that is not part of the Coder chat model config schema this provider was built against, so it would be silently dropped before reaching Coder: provider_options.openai.reasoning_mode. If the setting is valid for your Coder deployment, upgrade the provider to a version built against your Coder release; otherwise remove it or fix the field name. ``` ## Fix - Bump `github.com/coder/coder/v2` to `main` commit `a970c6c92e46` (`v2.34.0-rc.0.0.20260921160322-a970c6c92e46`), the same pseudo-version pattern as #388 and #413. Diffing the `ChatModelCallConfig` JSON tags between v2.37.1 and the new pin shows the `model_config` schema change is purely additive (`provider_options.openai.reasoning_mode` and `openai_config.reasoning_model`); no existing key is removed, so there is no migration and this is not a breaking release. - Adapt test helpers to the renamed `codersdk.CreateUserRequest` (`OrganizationIDs` replaces `OrganizationID`, `DisableLogin` is gone). Provider code is unaffected. No field-specific tests or examples are added for `reasoning_mode`; the existing validator and canonicalization tests cover the mechanism, matching how earlier dependency-bump fields were handled (review feedback, 0293fa2). ## Compatibility Using `reasoning_mode` requires a Coder release that includes coder/coder#29584 (newer than 2.37); Coder validates the value server-side and OpenAI rejects it for models without Pro. `integration/agents-model-test` is intentionally left unchanged because the integration harness pulls `ghcr.io/coder/coder:latest`, which does not yet echo the field back. > Xum opened this PR on behalf of @ibetitsmike.
chore: change `default_org_member_roles` to set (#438) <!-- Coder Agents on behalf of @Emyrk. --> Followup to #355 (comment). Change `default_org_member_roles` on `coderd_organization` from a list to a set. - Duplicate role names have no meaning, and ordering does not matter. - Replaces the `minimum-implicit-member` experiment note in the attribute description with "Requires a Coder Deployment running v2.37.0 or later." The experiment was promoted to GA and removed in coder/coder#27472, first shipped in v2.37.0. - Drops `minimum-implicit-member` from the acceptance test's `CoderExperiments(...)` list, since Coder v2.37.0+ no longer recognises it. - Existing state migrates in place; Terraform converts list-of-string to set-of-string without a schema version bump. --- <sub>Coder Agents on behalf of @Emyrk.</sub> --------- Co-authored-by: Ethan Dickson <ethanndickson@gmail.com>
fix: move coderd_default_agents_model state without a configured prov… …ider (#429) ## Problem Upgrading from v0.0.23 to v0.0.24 with the documented migration ```hcl moved { from = coderd_default_agents_model.this to = coderd_agents_default_model.this } ``` fails deterministically at plan time: ```text Error: Unable to Move Default Agents Model State The provider was not configured before Terraform attempted to move coderd_default_agents_model state. ``` Terraform Core calls the `MoveResourceState` RPC **before** `ConfigureProvider` (hashicorp/terraform#35922), so the mover's `r.data` is always nil — it errored on the nil check and otherwise depended on `r.data.DefaultOrganizationID` to fill `id`/`organization_id`. Every user of the `moved` block hit this; no configuration change could avoid it. ## Fix Make the state mover fully offline: carry over only the source state's `model_id` and write null `id`/`organization_id`. The first apply then adopts the configured organization in place: - `Update` resolves the organization via `resolveOrganizationID` (prior state, then plan) instead of trusting prior state alone. - `organization_id` uses the shared adoption-friendly `RequiresReplaceIf` (replace only when both state and config are non-null), so adoption is an in-place update while genuine org changes still replace. - `Read` warns and preserves state instead of refreshing while `organization_id` is still null, mirroring the legacy handling in `coderd_agents_model`. Regression coverage drives the migration through Terraform's real RPC lifecycle: a two-step `resource.Test` persists v0.0.23-schema state with an in-test legacy provider, then plans/applies the dogfood-shaped config (`moved` block, org data source) against the real provider factories, asserting in-place updates and final state. With the fix reverted, the test reproduces the dogfood error verbatim. Also records the lesson in AGENTS.md. Refs coder/dogfood#453
docs: group registry sidebar by subcategory (#426) ## Problem All `coderd_*` resources and data sources render on the Terraform Registry with an empty `subcategory`, so the sidebar lists every resource/data source flat with no grouping. ## Fix Add per-resource doc templates under `templates/resources/<name>.md.tmpl` and `templates/data-sources/<name>.md.tmpl` (the [tfplugindocs conventional paths](https://github.com/hashicorp/terraform-plugin-docs#conventional-paths), matching the pattern used by hashicorp/aws, azurerm, google). Each is a copy of tfplugindocs' default template with a hardcoded `subcategory`, grouping pages into: - **Agents** — `agents_mcp_server`, `agents_model`, `agents_system_prompt`, `agents_default_model` - **AI Governance** — `ai_provider` - **Deployment** — `license`, `oauth2_provider_settings`, `provisioner_key`, `workspace_proxy` - **Identity & Access Management** — `organization`, `organization_group_sync`, `organization_sync_settings`, `group`, `user` - **Templates** — `template` The templates also drop the `HasImportIDConfig`/`HasImportIdentityConfig` branches from tfplugindocs' default template: no resource in this repo ships `import-by-string-id.tf`/`import-by-identity.tf` example files, so those branches were always-false dead code. Resource templates keep a single `HasImport` (`terraform import`) section; data-source templates have no import section (data sources are never imported). Regenerated `docs/` with `make gen`; the diff against the base branch is exactly the `subcategory` line per file (19 files), nothing else changed. ## Stacking Stacked on #423 (which stacks on #422). Covers the stack's org-scoped `coderd_agents_default_model` rename (subcategory: Agents); the base already includes the #425 `agents_system_prompt` rename. ## Note for future resources With per-resource templates, a new resource/data source added without a matching `templates/` file falls back to tfplugindocs' embedded default (`subcategory: ""`) and renders uncategorized at the top of the sidebar. Copy a sibling template and set the right subcategory when adding one. ## Testing - `make build`, `make fmt`, and `make gen` (idempotent, no drift) are all clean. - `tfplugindocs validate --provider-name coderd` passes. - `make lint` has 15 pre-existing `usetesting` findings, unchanged from the base (verified via `git stash`); unrelated to this change. --------- Co-authored-by: Ethan Dickson <ethan@coder.com>
PreviousNext