Commit Graph

10779 Commits

Author SHA1 Message Date
Ethan 5145cd002d chore(scaletest): add tls to infrastructure (#19412)
Closes https://github.com/coder/internal/issues/850

This PR has the scaletest infrastructure retrieve and use TLS certificates from the persistent observability cluster.

To support creating multiple instances of the infrastructure simultaneously, `var.name` can be set to `alpha`, `bravo` or `charlie`, which retrieves the corresponding certificates.

Also:
- Adds support for wildcard apps.
- Retrieves the Cloudflare token from GCP secrets.
2025-08-25 12:25:09 +10:00
dependabot[bot] 236844e5cc chore: bump coder/cursor/coder from 1.3.0 to 1.3.1 in /dogfood/coder (#19514)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=coder/cursor/coder&package-manager=terraform&previous-version=1.3.0&new-version=1.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 01:33:01 +00:00
dependabot[bot] 3fadf1ae6e chore: bump coder/vscode-web/coder from 1.3.1 to 1.4.1 in /dogfood/coder (#19513)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=coder/vscode-web/coder&package-manager=terraform&previous-version=1.3.1&new-version=1.4.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 01:31:29 +00:00
dependabot[bot] 7977fa87aa chore: bump coder/claude-code/coder from 2.0.7 to 2.1.0 in /dogfood/coder (#19512)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=coder/claude-code/coder&package-manager=terraform&previous-version=2.0.7&new-version=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 01:30:33 +00:00
Atif Ali 2b3ae549ca chore: rename docker-compose.yaml to compose.yaml (#19480)
Docker recommends using a `compose.yaml` file.
2025-08-23 11:32:14 +05:00
ケイラ 3b6c85a3f9 chore: add @Parkreiner as site/ CODEOWNER (#19502) 2025-08-22 13:40:24 -06:00
Bruno Quaresma cde5b624f4 feat: display the number of idle tasks in the navbar (#19471)
Depends on: https://github.com/coder/coder/pull/19377

Closes https://github.com/coder/coder/issues/19323

**Screenshot:**

<img width="1511" height="777" alt="Screenshot 2025-08-21 at 11 52 21"
src="https://github.com/user-attachments/assets/be04e507-bf04-47d0-8748-2f71b93b5685"
/>

**Screen recording:**


https://github.com/user-attachments/assets/f70b34fe-952b-427b-9bc9-71961ca23201



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- New Features
- Added a Tasks navigation item showing a badge with the number of idle
tasks and a tooltip: “You have X tasks waiting for input.”

- Improvements
  - Fetches per-user tasks with periodic refresh for up-to-date counts.
- Updated active styling for the Tasks link for clearer navigation
state.
  - User menu now always appears on medium+ screens.

- Tests
- Expanded Storybook with preloaded, user-filtered task scenarios to
showcase idle/task states.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-08-22 15:24:32 -03:00
DevCats 6fbe777317 chore: add auggie icon (#19500)
add auggie icon
2025-08-22 12:53:33 -05:00
ケイラ 7e23081c2f chore: fix vite types (#19477) 2025-08-22 09:00:03 -06:00
Mathias Fredriksson 427b23f49a feat(coderd): add tasks list and get endpoints (#19468)
Fixes coder/internal#899

Example API response:

```json
{
  "tasks": [
    {
      "id": "a7a27450-ca16-4553-a6c5-9d6f04808569",
      "organization_id": "241e869f-1a61-42c9-ae1e-9d46df874058",
      "owner_id": "9e9b9475-0fc0-47b2-9170-a5b7b9a075ee",
      "name": "task-hardcore-herschel-bd08",
      "template_id": "accab607-bbda-4794-89ac-da3926a8b71c",
      "workspace_id": "a7a27450-ca16-4553-a6c5-9d6f04808569",
      "initial_prompt": "What directory are you in?",
      "status": "running",
      "current_state": {
        "timestamp": "2025-08-22T10:03:27.837842Z",
        "state": "working",
        "message": "Listed root directory contents, working directory reset",
        "uri": ""
      },
      "created_at": "2025-08-22T09:21:39.697094Z",
      "updated_at": "2025-08-22T09:21:39.697094Z"
    },
    {
      "id": "50f92138-f463-4f2b-abad-1816264b065f",
      "organization_id": "241e869f-1a61-42c9-ae1e-9d46df874058",
      "owner_id": "9e9b9475-0fc0-47b2-9170-a5b7b9a075ee",
      "name": "task-musing-dewdney-f058",
      "template_id": "accab607-bbda-4794-89ac-da3926a8b71c",
      "workspace_id": "50f92138-f463-4f2b-abad-1816264b065f",
      "initial_prompt": "What is 1 + 1?",
      "status": "running",
      "current_state": {
        "timestamp": "2025-08-22T09:22:33.810707Z",
        "state": "idle",
        "message": "Completed arithmetic calculation",
        "uri": ""
      },
      "created_at": "2025-08-22T09:18:28.027378Z",
      "updated_at": "2025-08-22T09:18:28.027378Z"
    }
  ],
  "count": 2
}
```
2025-08-22 17:11:31 +03:00
Cian Johnston fe36e9c120 fix(dogfood/coder): allow mutable ai_prompt parameter (#19493) 2025-08-22 15:08:42 +01:00
Edward Angert 49f32d14eb docs: add dev containers and scheduling to prebuilt workspaces known issues (#18816)
closes #18806 

- [x] scheduling limitation
- [x] dev containers limitation
- [x] edit intro


[preview](https://coder.com/docs/@18806-prebuilds-known-limits/admin/templates/extending-templates/prebuilt-workspaces)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Clarified the introduction and administrator responsibilities for
prebuilt workspaces.
* Integrated compatibility information about DevContainers and workspace
scheduling more contextually.
* Added explicit notes on limitations with dev containers integration
and workspace autostart/autostop features.
* Improved configuration examples and clarified scheduling instructions.
* Enhanced explanations of scheduling behavior and lifecycle steps for
better understanding.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
Co-authored-by: Sas Swart <sas.swart.cdk@gmail.com>
Co-authored-by: Susana Ferreira <susana@coder.com>
2025-08-22 15:54:28 +02:00
Cian Johnston 5e49d8c569 chore: reduce execution time of TestProvisionerJobs (#19475)
Note: this commit was partially authored by AI.

- Replaces coderdtest.CreateTemplate/TemplateVersion() with direct dbgen
calls. We do not need a fully functional template for these tests.
- Removes provisioner daemon creation/cleanup. We do not need a running
provisioner daemon here; this functionality is tested elsewhere.
  - Simplifies provisioner job creation test helpers.

This reduces the test runtime by over 50%:

Old:
```
time go test -count=100 ./cli -test.run=TestProvisionerJobs
ok      github.com/coder/coder/v2/cli   50.149s
```

New:
```
time go test -count=100 ./cli -test.run=TestProvisionerJobs
ok      github.com/coder/coder/v2/cli   21.898
```
2025-08-22 13:40:06 +01:00
Danny Kopping 4970da433c chore: remove coderabbit (#19491) 2025-08-22 13:28:40 +02:00
Danny Kopping e549084b7f chore: add pull request template for AI guidelines (#19487) 2025-08-22 12:07:01 +02:00
Cian Johnston 213fffbfa6 chore: add git-config module to dogfood template (#19489)
As a developer, I want to be immediately able to run `git commit` in a
fresh workspace.
2025-08-22 09:37:48 +01:00
Dean Sheather 82f2e15974 chore: add unknown usage event type error (#19436)
- Adds `usagetypes.UnknownEventTypeError` type, which is returned by
`ParseEventWithType`
- Changes `ParseEvent` to not be a generic function since it doesn't
really need it
- Adds `User-Agent` to tallyman requests
2025-08-22 16:32:35 +10:00
Spike Curtis b90bc7c398 feat: use cloud secret for DNS token in scaletest TF (#19466)
Removes the requirement to obtain a Cloudflare DNS token from our scaletest/terraform/action builds. Instead, by default, we pull the token from Google Secrets Manager and use the `scaletest.dev` DNS domain.

Removes cloudflare_email as this was unneeded.  
  
Removes the cloudflare_zone_id and instead pulls it from a data source via the Cloudflare API.  
  
closes https://github.com/coder/internal/issues/839
2025-08-22 07:41:49 +02:00
Ethan a71e5cc8b0 test: add increasing integer to GetRandomNameHyphenated (#19481)
Fixes flakes like the following:
```
workspaces_test.go:4938: 
	Error Trace:	/home/runner/work/coder/coder/coderd/coderdtest/coderdtest.go:1279
											/home/runner/work/coder/coder/coderd/workspaces_test.go:4938
											/home/runner/work/coder/coder/coderd/workspaces_test.go:5044
	Error:      	Received unexpected error:
								POST http://127.0.0.1:42597/api/v2/users/me/workspaces: unexpected status code 409: Workspace "romantic-mcclintock" already exists.
									name: This value is already in use and should be unique.
	Test:       	TestWorkspaceCreateWithImplicitPreset/SinglePresetWithParameters
```

https://github.com/coder/coder/actions/runs/17142665868/job/48633017007?pr=19464
 
Which are caused by insufficient randomness when creating multiple
workspaces with random names. Two words is not enough to avoid flakes.
We have a `testutil.GetRandomName` function that appends a monotonically
increasing integer, but this alternative function that uses hyphens
doesn't add that integer. This PR fixes that by just
`testutil.GetRandomName`
2025-08-22 12:20:03 +10:00
Andrew Aquino 9a872f903e feat: show workspace health error alert above agents in WorkspacePage (#19400)
closes #19338 

<img width="1840" height="1191" alt="image"
src="https://github.com/user-attachments/assets/eeefda13-88d1-4a26-ba57-9749abda3f17"
/>
2025-08-21 17:22:25 -07:00
Rafael Rodriguez ad5e6785f4 feat: add filtering options to provisioners list (#19378)
## Summary

In this pull request we're adding support for additional filtering
options to the `provisioners list` CLI command and the
`/provisionerdaemons` API endpoint.

Resolves: https://github.com/coder/coder/issues/18783

### Changes

#### Added CLI Options

- `--show-offline`: When this option is provided, all provisioner
daemons will be returned. This means that when `--show-offline` is not
provided only `idle` and `busy` provisioner daemons will be returned.
- `--status=<list_of_statuses>`: When this option is provided with a
comma-separated list of valid statuses (`idle`, `busy`, or `offline`)
only provisioner daemons that have these statuses will be returned.
- `--max-age=<duration>`: When this option is provided with a valid
duration value (e.g., `24h`, `30s`) only provisioner daemons with a
`last_seen_at` timestamp within the provided max age will be returned.

#### Query Params

- `?offline=true`: Include offline provisioner daemons in the results.
Offline provisioner daemons will be excluded if `?offline=false` or if
offline is not provided.
- `?status=<list_of_statuses>`: Include provisioner daemons with the
specified statuses.
- `?max_age=<duration>`: Include provisioner daemons with a
`last_seen_at` timestamp within the max age duration.

#### Frontend

- Since offline provisioners will not be returned by default anymore
(`--show-offline` has to be provided to see them), a checkbox was added
to the provisioners list page to allow for offline provisioners to be
displayed
- A revamp of the provisioners page will be done in:
https://github.com/coder/coder/issues/17156, this checkbox change was
just added to maintain currently functionality with the backend updates

Current provisioners page (without checkbox)

<img width="1329" height="574" alt="Screenshot 2025-08-20 at 10 51
00 AM"
src="https://github.com/user-attachments/assets/77b73650-0b62-44f0-a77f-acbe5710809f"
/>

Provisioners page with checkbox (unchecked)

<img width="1314" height="626" alt="Screenshot 2025-08-20 at 10 48
40 AM"
src="https://github.com/user-attachments/assets/7ba164ad-6d3f-417b-bd39-338c0161b145"
/>

Provisioner page with checkbox (checked) and URL updated with query
parameters

<img width="1306" height="597" alt="Screenshot 2025-08-20 at 10 50
14 AM"
src="https://github.com/user-attachments/assets/e78d0986-bbf8-491b-9d56-b682973237a0"
/>

### Show Offline vs Offline Status

To list offline provisioner daemons, users can either:

1. Include the `--show-offline` option

OR

2. Include `offline` in the list of values provided to the `--status`
option
2025-08-21 16:03:34 -04:00
Bruno Quaresma d77c3d0226 feat: filter tasks that are waiting for user input (#19377)
Closes https://github.com/coder/coder/issues/19324

<img width="1624" height="974" alt="Screenshot 2025-08-15 at 14 45 39"
src="https://github.com/user-attachments/assets/a738d9af-f548-413b-a0e7-3f311cb997ee"
/>

---------

Co-authored-by: ケイラ <mckayla@hey.com>
2025-08-21 15:06:11 -03:00
Callum Styan 014a2d5b0f perf: don't call GetUserByID unnecessarily for Agents metrics loops (#19395)
At the moment, the loop which retrieves and updates the values of the
agents metrics excessively calls `GetUserByID` (a DB query). First it
retrieves a list of all workspaces, filtering out inactive agents (not
entirely clear to me whether this is non-running workspaces, or just
dead agents), and then iterates over those workspaces to get the rest of
the relevant data for the metrics. The next call is `GetUserByID` for
`workspace.OwnerID`. This is unnecessary because the `workspaces_visible` view we pull workspaces from has already been joined with the users table to get the username/name/etc.

This should at least partially resolve
https://github.com/coder/internal/issues/726 
---------

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2025-08-21 11:01:32 -07:00
Bruno Quaresma 8aafbcb3be feat: show workspace build logs during tasks creation (#19413)
This is part of https://github.com/coder/coder/issues/19363

**Screenshot:**
<img width="1610" height="974" alt="Screenshot 2025-08-19 at 12 32 54"
src="https://github.com/user-attachments/assets/c7435b67-49ac-4b88-ae2d-014787cea5f2"
/>


**Video demo:**


https://github.com/user-attachments/assets/2249affd-3d51-4ff0-8a5f-a0358a90d659
2025-08-21 15:01:03 -03:00
Bruno Quaresma 54440af953 fix: fix workspaces pagination (#19448)
Fixes #18707 

**Before:**


https://github.com/user-attachments/assets/6d4fba3e-0f24-4f60-adb6-d48d73b720ff

**After:**


https://github.com/user-attachments/assets/483dad99-3095-4647-990d-8386dd0c4d75
2025-08-21 14:59:37 -03:00
Cian Johnston 86f9bed608 chore: fix TestCheckInactiveUsers flake (#19469)
THIS CODE WAS NOT WRITTEN BY A HUMAN.
Use a fixed time interval to avoid timing flakes.
2025-08-21 16:35:31 +01:00
dependabot[bot] fe289e8824 chore: bump github.com/go-viper/mapstructure/v2 from 2.3.0 to 2.4.0 (#19470)
Bumps
[github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure)
from 2.3.0 to 2.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/go-viper/mapstructure/releases">github.com/go-viper/mapstructure/v2's
releases</a>.</em></p>
<blockquote>
<h2>v2.4.0</h2>
<h2>What's Changed</h2>
<ul>
<li>refactor: replace interface{} with any by <a
href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a>
in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/115">go-viper/mapstructure#115</a></li>
<li>build(deps): bump github/codeql-action from 3.29.0 to 3.29.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/114">go-viper/mapstructure#114</a></li>
<li>Generic tests by <a
href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a>
in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/118">go-viper/mapstructure#118</a></li>
<li>Fix godoc reference link in README.md by <a
href="https://github.com/peczenyj"><code>@​peczenyj</code></a> in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/107">go-viper/mapstructure#107</a></li>
<li>feat: add StringToTimeLocationHookFunc to convert strings to
*time.Location by <a
href="https://github.com/ErfanMomeniii"><code>@​ErfanMomeniii</code></a>
in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/117">go-viper/mapstructure#117</a></li>
<li>feat: add back previous StringToSlice as a weak function by <a
href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a>
in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/119">go-viper/mapstructure#119</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/ErfanMomeniii"><code>@​ErfanMomeniii</code></a>
made their first contribution in <a
href="https://redirect.github.com/go-viper/mapstructure/pull/117">go-viper/mapstructure#117</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/go-viper/mapstructure/compare/v2.3.0...v2.4.0">https://github.com/go-viper/mapstructure/compare/v2.3.0...v2.4.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/go-viper/mapstructure/commit/b9794a5f0e73d425210d6614ed833067029155f5"><code>b9794a5</code></a>
Merge pull request <a
href="https://redirect.github.com/go-viper/mapstructure/issues/119">#119</a>
from go-viper/string-to-weak-slice</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/17cdcb0741054e2a33938adf6bd1f2a5c0aa8f30"><code>17cdcb0</code></a>
feat: add back previous StringToSlice as a weak function</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/3caca3614c3ab2c5b5d359c44fdcd72058887b19"><code>3caca36</code></a>
Merge pull request <a
href="https://redirect.github.com/go-viper/mapstructure/issues/117">#117</a>
from ErfanMomeniii/main</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/9a861bc115f2b54ed4e494662f29c172d9ef046a"><code>9a861bc</code></a>
Merge pull request <a
href="https://redirect.github.com/go-viper/mapstructure/issues/107">#107</a>
from peczenyj/patch-2</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/86ed5b59da0615fb8c3a413f401cdf0231f1234c"><code>86ed5b5</code></a>
refactor: update</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/ace5b4e8b3dec99468ffa9498e42fb09d177b0a6"><code>ace5b4e</code></a>
chore: add interface any linter</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/1a4f1aef38bfa8549762aaf42c7c18a5d268e76e"><code>1a4f1ae</code></a>
Merge pull request <a
href="https://redirect.github.com/go-viper/mapstructure/issues/118">#118</a>
from go-viper/generic-tests</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/a2689090ed4348033c36724d866faf1f911a9f63"><code>a268909</code></a>
fix: lint</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/17f1fd44eb7606b109c9bb017c0a1c6d3e93b5cd"><code>17f1fd4</code></a>
test: add more comments</li>
<li><a
href="https://github.com/go-viper/mapstructure/commit/b48c8566836bf291bfee2b217d51fc36e8e61f6f"><code>b48c856</code></a>
test: expand tests</li>
<li>Additional commits viewable in <a
href="https://github.com/go-viper/mapstructure/compare/v2.3.0...v2.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/go-viper/mapstructure/v2&package-manager=go_modules&previous-version=2.3.0&new-version=2.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/coder/coder/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-21 15:08:50 +00:00
Callum Styan bcdade7d8c fix: add database constraint to enforce minimum username length (#19453)
Username length and format, via regex, are already enforced at the
application layer, but we have some code paths with database queries
where we could optimize away many of the DB query calls if we could be
sure at the database level that the username is never an empty string.

For example: https://github.com/coder/coder/pull/19395

---------

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2025-08-21 07:56:41 -07:00
Spike Curtis 72f58c0483 fix: limit test parallelism in make test (#19465)
In order to get `make test` to reliably pass again on our dogfood
workspaces, we're having to resort to setting parallelism.

It also reworks our CI to call the `make test` target, instead of
rolling a different command.

Behavior changes:
 * sets 8 packages x 8 tests in parallel by default on `make test`
* by default, removes the `-short` flag. In my testing it makes only a
few seconds difference on ~200s, or 1-2%
* by default, removes the `-count=1` flag that busts Go's test cache.
With a fresh cache and no code changes, `make test` executes in ~15
seconds.

Signed-off-by: Spike Curtis <spike@coder.com>
2025-08-21 16:37:31 +04:00
Dean Sheather 8d0bc485df chore: add actionlint and zizmor linters (#19459) 2025-08-21 22:14:43 +10:00
Danny Kopping 338e8b5161 fix: use new http transport for webhook handler (#19462) 2025-08-21 12:08:32 +02:00
Danielle Maywood 2521e732be refactor: generate task name fallback on coderd (#19447)
Instead of generating the fallback task name on the website, we instead
generate it on coderd.
2025-08-21 11:06:30 +01:00
Atif Ali 62fa731b34 chore(dogfood): add IDE selection parameter (#19194)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-21 13:32:45 +05:00
Ethan 444874d9db ci: add check-build job to require make build to pass on prs (#19460)
We've had `build` fail on main one or two times, and it's easily
preventable by just running `make build` on PRs.

I didn't add `build` to required as it's already pretty complex, and
we'd be making it more complex by skipping half of it when not on
coder/coder main.
2025-08-21 17:59:18 +10:00
Spike Curtis 229d05193d fix: speed up GetTailnetTunnelPeerBindings query (#19444)
relates to: https://github.com/coder/internal/issues/718

Optimizes the GetTailnetTunnelPeerBindings query to reduce its execution time.

Before: https://explain.dalibo.com/plan/c2fd53f913aah21c

After: https://explain.dalibo.com/plan/6bc67d323g7afh61

At a high level, we first assemble the total list of peer IDs needed by the query, and only then go into the `tailnet_peers` table to extract their info. This saves us some time instead of hashing the entire `tailnet_peers` table.
2025-08-21 07:53:56 +02:00
Ethan 51d8a05301 test: disable direct connections for a deterministic reachable peers metric (#19458)
closes https://github.com/coder/internal/issues/921

Not sure what I was thinking when I wrote this test case, but it was
relying on the connection being p2p on every ping, which is technically
and evidently not always the case. Instead we'll require a DERP peer,
and block direct connections.
2025-08-21 11:46:56 +10:00
Dean Sheather bfd392b0bf fix: use int64 in publisher delay (#19457) 2025-08-21 11:23:50 +10:00
Rowan Smith baf30679e0 chore: fix typo in clientNetcheckSummary for support bundle command (#19441)
This PR fixes a typo in the original support bundle implementation for
the `clientNetcheckSummary` var.
2025-08-21 10:08:51 +10:00
Brett Kolodny ee789dac9a fix: redirect users to /login if their oauth token is invalid (#19429)
[As mentioned in the
issue](https://github.com/coder/coder/issues/12056#issuecomment-3206975879)
the problem here is the fact this endpoint is returning a 401 instead of
a 200 in this specific case.

Since we actually have enough information before performing this
mutation to know that it'll fail in the case of a bad auth token we'd
ideally re-work the code not to call the mutation on logout and just
perform the local clean up. Unfortunately it seems like the interactions
that this mutation is having with React Query at large is necessary for
our code to work as intended and thus it's not currently possible to
move the local clean up (the code inside of the `onSuccess`) outside of
the mutation. Shout out to @Parkreiner for helping me confirm this.

So until we can re-work the `AuthProvider` to be less brittle this PR
changes `onSuccess` to `onSettled` so that while the mutation still
fails with a 401, the local clean up still runs.

Closes #12056
2025-08-20 15:04:57 -04:00
Benjamin Peinhardt 02fc173df4 fix: fix flake due to two time.Now() calls (#19450)
fixes https://github.com/coder/internal/issues/559

This test is looking to see that after calling `coder schedule extend
<workspace> 10h`, the scheduled stop time of the workspace is updated
appropriately (or at least that the information printed to the terminal
indicates that).

By using two `time.Now()` calls for the current time and the expected
time, there was the possibility that the second call just barely crossed
over the hour mark. This is shown in the error message when the test
would flake: `wanted "2025-04-07T22:"; got " 2025-04-07T23:00:00+05:30
\r\n"` (the 00:00 letting us know we just barely crossed the hour).

Using the same time object to construct the expected time should fix the
issue.
2025-08-20 12:12:02 -05:00
Cian Johnston 9ad124d489 feat(coderd/telemetry): track AI task usage (#19418)
Relates to https://github.com/coder/internal/issues/868
2025-08-20 17:59:09 +01:00
Rafael Rodriguez 5b1e809862 fix: support oidc group allowlist in oss (#19430)
## Summary

In this pull request we're adding support for OIDC allowed groups in the
OSS version as part of work for
https://github.com/coder/coder/issues/17027.

### Changes

- Restored support for parsing group allow list in OSS code

### Testing

- Added tests for OSS code
- Tested allowed/prohibited group OIDC flows in premium and OSS
2025-08-20 10:09:13 -05:00
Steven Masley a19dfa9a0a docs: add generative ai contribution guidelines (#19427)
Initial language that gives us something to point to if needed.
2025-08-20 09:13:40 -05:00
Hugo Dutka d536b91bfc chore(coderd/database/dbauthz): migrate more tests to mocked db (#19300)
Related to https://github.com/coder/internal/issues/869

---------

Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
Co-authored-by: Steven Masley <stevenmasley@gmail.com>
2025-08-20 14:10:18 +00:00
Jakub Domeracki fc7f53ffce chore: update monaco-editor to resolve DOMPurify CVEs #19445 (#19446)
https://github.com/coder/coder/issues/19445
2025-08-20 16:00:10 +02:00
Susana Ferreira 5b08f8b4a0 fix: change createWorkspace to use dbtime.Time (#19414)
The `createWorkspace` function was updated to use an injected Clock,
which makes it possible to mock time in tests:
https://github.com/coder/coder/pull/19264/files#diff-46f90baab52ea3ad914acbde30d656dbc8e46f5918d19bc056c445a1dc502482R1130
For database operations, however, it is recommended to use `dbtime.Time`
since it rounds to the microsecond, the smallest unit of precision
supported by Postgres.
2025-08-20 14:58:00 +01:00
Dean Sheather 1a601c30ad chore: move usage types to new package (#19103) 2025-08-20 23:48:38 +10:00
Dean Sheather 6eb02d1c2a chore: wire up usage tracking for managed agents (#19096)
Wires up the usage collector and publisher to coderd.

Relates to coder/internal#814
2025-08-20 23:38:09 +10:00
Garrett Delfosse dd867bd743 fix: fix jetbrains toolbox connection tracking (#19348)
Fixes https://github.com/coder/coder/issues/18350

I attempted the route of relying on just the session env vars, in hopes
that this issue was fixed in Toolbox and the process name matching was
no longer need, but it was not a fruitful endeavor and it seems to be
using the same connection logic as it did in gateway, just with new
binary and flag names.
2025-08-20 08:39:08 -04:00
Susana Ferreira 560cf84251 fix: prevent activity bump for prebuilt workspaces (#19263)
## Description

This PR ensures that activity-based deadline extensions ("activity
bumping") are not applied to prebuilt workspaces. Prebuilds are managed
by the reconciliation loop and must not have `deadline` or
`max_deadline` values set or extended, as they are not part of the
regular lifecycle executor path.

## Changes

- Update `ActivityBumpWorkspace` SQL query to discard prebuilt
workspaces
- Update application layer to avoid calling activity bump logic on
prebuilt workspaces

Related with: 
* Issue: https://github.com/coder/coder/issues/18898
* PR: https://github.com/coder/coder/pull/19252
2025-08-20 12:19:14 +01:00