Commit Graph

7866 Commits

Author SHA1 Message Date
Ethan
e5d4f3557b chore: only show license expiry warning for deployment admins (#14488) 2024-09-02 17:54:39 +10:00
dependabot[bot]
faf245234f ci: bump crate-ci/typos from 1.23.6 to 1.24.1 in the github-actions group (#14431)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 05:22:39 +00:00
dependabot[bot]
c9fcab3717 chore: bump github.com/fergusstrange/embedded-postgres from 1.28.0 to 1.29.0 (#14430)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 10:15:52 +05:00
dependabot[bot]
ead8fae63d chore: bump framer-motion from 10.17.6 to 10.18.0 in /offlinedocs (#14290)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 10:02:00 +05:00
Steven Masley
0ef85147cd chore: match templates search error with workspace search error (#14479)
* chore: make templates search error the same as workspaces
2024-08-30 15:14:59 -05:00
Cian Johnston
0f8251be41 feat(coderd/database/dbpurge): retain most recent agent build logs (#14460)
Updates the `DeleteOldWorkspaceAgentLogs` to:
- Retain logs for the most recent build regardless of age,
- Delete logs for agents that never connected and were created before
   the cutoff for deleting logs while still retaining the logs most recent build.
2024-08-30 17:39:09 +01:00
Steven Masley
10c958bba1 chore: implement organization sync and create idpsync package (#14432)
* chore: implement filters for the organizations query
* chore: implement organization sync and create idpsync package

Organization sync can now be configured to assign users to an org based on oidc claims.
2024-08-30 11:19:36 -05:00
Danny Kopping
043f4f5327 docs: add documentation for notifications feature (#14478) 2024-08-30 17:30:06 +02:00
Mathias Fredriksson
13e5c51c30 chore(dogfood): optimize dockerfile for envbuilder cache probing (#14497) 2024-08-30 17:54:19 +03:00
Danny Kopping
9596f236c1 fix: use negative deadline to ensure timeout in TestWebhook/timeout (#14498) 2024-08-30 16:46:13 +02:00
Danny Kopping
0f414a00d3 fix: restore closing SMTP message on method exit (#14496) 2024-08-30 13:03:25 +02:00
Cian Johnston
a74273f1fd chore(coderd/database/dbpurge): replace usage of time.* with quartz (#14480)
Related to #10576

This PR introduces quartz to coderd/database/dbpurge and updates the following unit tests to make use of Quartz's functionality:

- TestPurge
- TestDeleteOldWorkspaceAgentLogs

Additionally, updates DeleteOldWorkspaceAgentLogs to replace the hard-coded interval with a parameter passed into the query. This aids in testing and brings us a step towards allowing operators to configure the cutoff interval for workspace agent logs.
2024-08-30 11:55:47 +01:00
Danny Kopping
c90be9b0c1 fix: correctly close SMTP message and await response (#14495) 2024-08-30 11:37:50 +02:00
Ethan
851df91991 fix: serve test derp map locally (#14490) 2024-08-30 18:43:51 +10:00
Ethan
628750232f fix: delete workspace agent stats after 180 days (#14489)
Fixes #13430.

The test for purging old workspace agent stats from the DB was consistently failing when ran with Postgres towards the end of the month, but not with the in-memory DB. 

This was because month intervals are calculated differently for `time.Time` and the `interval` type in Postgres:

```
ethan=# SELECT
    '2024-08-30'::DATE AS original_date,
    ('2024-08-30'::DATE - INTERVAL '6 months') AS sub_date;
 original_date |      sub_date
---------------+---------------------
 2024-08-30    | 2024-02-29 00:00:00
(1 row)
```

Using `func (t Time) AddDate(years int, months int, days int) Time`, where `months` is `-6`:
```
Original: 2024-08-30 00:00:00 +0000 UTC
6 Months Earlier: 2024-03-01 00:00:00 +0000 UTC
```

Since 6 months was chosen arbitrarily, we should be able to change it to 180 days, to remove any ambiguity between the in-memory DB, and the Postgres DB. The alternative solution would involve implementing Postgres' month interval algorithm in Go.

The UI only shows stats as old as 168 days (24 weeks), so a frontend change isn't required for the extra days of stats we lose in some cases.
2024-08-30 18:30:04 +10:00
Kayla Washburn-Love
4672849d05 chore: clean up usage of Object.keys (#14484) 2024-08-29 17:21:29 -06:00
Kayla Washburn-Love
d2a22c538b chore: add more stories and use new groups query for user settings page (#14481) 2024-08-29 17:00:12 -06:00
Kayla Washburn-Love
6bc93520c4 fix: fix light mode styles for organization delete button (#14485) 2024-08-29 16:10:31 -06:00
Asher
cd38e297b6 fix: make non-existent asset paths return a 404 (#14472)
Before, if a file was not found we would serve the app.

This would cause either the login page or the workspace
page to load (and consequently error because `assets` is
likely not a valid user).
2024-08-29 13:52:08 -08:00
Asher
ef7fcf3930 fix: include dormant users in template acl query (#14461)
The issue is that if you add a user and then immediately go to give them
permissions, you can add them but they will not show up in the UI.  They
also do not show up in the audit log entry.
2024-08-29 13:48:28 -08:00
Kayla Washburn-Love
49afab12d5 feat: show organization name for groups on user profile (#14448) 2024-08-29 10:55:00 -06:00
Ethan
4b5c45d6df feat(cli): add aws check to ping p2p diagnostics (#14450) 2024-08-29 21:41:12 +10:00
Ethan
e65eb0321c fix: support additional http headers on agent (#14464) 2024-08-29 14:15:15 +10:00
Steven Masley
6dbfe6f7ae chore: remove duplicates using the symmetric difference function (#14469)
The `SymmetricDifferenceFunc` used to include duplicates, which was incorrect.
2024-08-28 21:06:27 -05:00
Jaayden Halko
15d74a11a0 feat: improve custom roles create/edit page (#14456)
* fix: improve show/hide checkbox text

* feat: add parent checkbox for grouped resource permissions

* fix: align action list item to a grid

* chore: add additional tests

* fix: format
2024-08-28 18:13:33 -04:00
dependabot[bot]
f3ea740b27 chore: bump next from 14.2.4 to 14.2.7 in /offlinedocs (#14473)
Bumps [next](https://github.com/vercel/next.js) from 14.2.4 to 14.2.7.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.4...v14.2.7)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 14:20:04 -06:00
Steven Masley
b96ac677f1 chore: add organization search query to workspaces (#14474)
* chore: add organization search query to workspaces
2024-08-28 15:18:45 -05:00
Steven Masley
54fe082551 chore: implement filters for the organizations query (#14468)
Required for organization sync. Allows fetching a filtered set of orgs.
2024-08-28 13:24:28 -05:00
dependabot[bot]
7667d64686 chore: bump the mui group across 1 directory with 6 updates (#14400)
* chore: bump the mui group across 1 directory with 6 updates

Bumps the mui group with 6 updates in the /site directory:

| Package | From | To |
| --- | --- | --- |
| [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material) | `5.16.0` | `5.16.7` |
| [@mui/lab](https://github.com/mui/material-ui/tree/HEAD/packages/mui-lab) | `5.0.0-alpha.129` | `5.0.0-alpha.173` |
| [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) | `5.16.0` | `5.16.7` |
| [@mui/system](https://github.com/mui/material-ui/tree/HEAD/packages/mui-system) | `5.16.0` | `5.16.7` |
| [@mui/utils](https://github.com/mui/material-ui/tree/HEAD/packages/mui-utils) | `5.16.0` | `5.16.6` |
| [@mui/x-tree-view](https://github.com/mui/mui-x/tree/HEAD/packages/x-tree-view) | `7.9.0` | `7.13.0` |



Updates `@mui/icons-material` from 5.16.0 to 5.16.7
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/v5.16.7/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.7/packages/mui-icons-material)

Updates `@mui/lab` from 5.0.0-alpha.129 to 5.0.0-alpha.173
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/next/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-lab)

Updates `@mui/material` from 5.16.0 to 5.16.7
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/v5.16.7/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.7/packages/mui-material)

Updates `@mui/system` from 5.16.0 to 5.16.7
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/v5.16.7/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.7/packages/mui-system)

Updates `@mui/utils` from 5.16.0 to 5.16.6
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/v5.16.6/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.6/packages/mui-utils)

Updates `@mui/x-tree-view` from 7.9.0 to 7.13.0
- [Release notes](https://github.com/mui/mui-x/releases)
- [Changelog](https://github.com/mui/mui-x/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/mui-x/commits/v7.13.0/packages/x-tree-view)

---
updated-dependencies:
- dependency-name: "@mui/icons-material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mui
- dependency-name: "@mui/lab"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mui
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mui
- dependency-name: "@mui/system"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mui
- dependency-name: "@mui/utils"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mui
- dependency-name: "@mui/x-tree-view"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: mui
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix breaking changes

* Fix fmt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: BrunoQuaresma <bruno_nonato_quaresma@hotmail.com>
2024-08-28 15:19:05 -03:00
Danny Kopping
f24cb5cc96 fix: prevent test flakiness (#14467)
Signed-off-by: Danny Kopping <danny@coder.com>
2024-08-28 16:33:27 +02:00
Ethan
c597c9260d fix: wait for provisioner daemon jobs to finish after sigterm (#14466) 2024-08-28 20:16:15 +10:00
Danielle Maywood
839918c5e7 chore(docs): document agent api debug endpoints (#14454)
* chore(docs): add agent api debug docs

* chore(docs): add sections to agent api readme

* chore(docs): link debug manifest to agentsdk.Manifest schema

* chore(docs): add high level overview of agent api debug docs

* chore(docs): link to agent api docs from reference

* chore(docs): fix invalid paths

* chore(docs): use env variable for coder agent debug address
2024-08-28 09:47:14 +01:00
Ethan
8c15192433 feat(cli): add p2p diagnostics to ping (#14426)
First PR to address #14244.

Adds common potential reasons as to why a direct connection to the workspace agent couldn't be established to `coder ping`:
- If the Coder deployment administrator has blocked direction connections (`CODER_BLOCK_DIRECT`).
- If the client has no STUN servers within it's DERP map.
- If the client or agent appears to be behind a hard NAT, as per Tailscale `netInfo.MappingVariesByDestIP`

Also adds a warning if the client or agent has a network interface below the 'safe' MTU for tailnet. This warning is always displayed at the end of a `coder ping`.
2024-08-28 15:39:01 +10:00
Kayla Washburn-Love
b36d979a60 chore: add provisioner api version to /buildinfo (#14446) 2024-08-27 13:40:51 -06:00
dependabot[bot]
f3c76ce244 chore: bump eslint-config-next from 14.0.1 to 14.2.6 in /offlinedocs (#14402)
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 14.0.1 to 14.2.6.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.2.6/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 13:39:25 -06:00
Ethan
63fe2305f8 fix: detect nested dotfiles scripts (#14455) 2024-08-28 02:14:23 +10:00
Marcin Tojek
47f2c7d683 feat: notify about manual failed builds (#14419) 2024-08-27 14:35:28 +00:00
Ethan
0afff43f9d chore: remove dogfood import block (#14449) 2024-08-27 06:28:25 +00:00
Asher
499769187b fix: increase group name limit to 36 from 32 (#14443) 2024-08-26 11:38:31 -08:00
Asher
88d7181a47 fix: filter "add group member" by organization (#14404)
This is accomplished by using the members endpoint instead of the users
endpoint, and to that end the UserAutocomplete component has been
reworked to support either endpoint as separate components with a shared
base.

* Add Storybook for groups page

This ensures it is using the right endpoint for the add member dropdown.

* Add ability to mock react-query errors
2024-08-26 11:13:34 -08:00
Asher
83f9ea17b4 chore: update organizations doc link (#14361) 2024-08-26 10:40:18 -08:00
Steven Masley
93eef7b542 chore: keep entitlements in the options only, simplify fields (#14434)
* chore: refactor entitlements to keep it in just the options

Duplicating the reference did not feel valuable, just confusing
2024-08-26 13:05:03 -05:00
Jaayden Halko
fb6b954222 chore: update secondary and disabled text colors (#14355) 2024-08-26 12:22:32 -04:00
Garrett Delfosse
ded612d3ec fix: use authenticated urls for pubsub (#14261) 2024-08-26 15:04:04 +00:00
Cian Johnston
6914862903 fix(cli): add check for DisableOwnerWorkspaceExec in scaletest (#14417)
- Adds `--use-host-login` to `coder exp scaletest workspace-traffic`
- Modifies getScaletestWorkspaces to conditionally filter workspaces if `CODER_DISABLE_OWNER_WORKSPACE_ACCESS` is set
- Adds a warning if `CODER_DISABLE_OWNER_WORKSPACE_ACCESS` is set and scaletest workspaces are filtered out due to ownership mismatch.
- Modifies `coderdtest.New` to detect cross-test bleed of `CODER_DISABLE_OWNER_WORKSPACE_ACCESS` and fast-fail.
2024-08-26 12:02:54 +01:00
Steven Masley
c8eacc6df7 chore!: allow CreateUser to accept multiple organizations (#14383)
* chore: allow CreateUser to accept multiple organizations

In a multi-org deployment, it makes more sense to allow for multiple
org memberships to be assigned at create. The legacy param will still
be honored.

* Handle sdk deprecation better by maintaining cli functions
2024-08-23 21:23:51 +00:00
Steven Masley
af125c3795 chore: refactor entitlements to be a safe object to use (#14406)
* chore: refactor entitlements to be passable as an argument

Previously, all usage of entitlements requires mutex usage on the
api struct directly. This prevents passing the entitlements to
a sub package. It also creates the possibility for misuse.
2024-08-23 16:21:58 -05:00
Steven Masley
cb6a47227f chore: implement generalized symmetric difference for set comparison (#14407)
* chore: implement generalized symmetric difference for set comparison

Going to be used in Organization Sync + maybe group sync. Felt
better to reuse, rather than copy
2024-08-23 14:52:35 -05:00
Cian Johnston
4bd7fe8506 fix(examples/templates/gcp-devcontainer): fix location of env file (#14422) 2024-08-23 17:46:02 +01:00
Cian Johnston
53e5746636 feat(examples/templates/gcp-devcontainer): add envbuilder provider (#14405)
This PR modifies the gcp-devcontainer example template to include
support for devcontainer caching using the envbuilder provider.

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Muhammad Atif Ali <atif@coder.com>
2024-08-23 17:36:24 +01:00