Commit Graph

1998 Commits

Author SHA1 Message Date
1e6ea6133c fix: pass in time parameter to prevent flakes (#11023)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-12-04 12:20:22 -05:00
ccd5e1a749 fix: use database for user creation to prevent flake (#10992) 2023-12-04 11:05:17 -05:00
2f54f769be feat: allow IDP to return single string for roles/groups claim (#10993)
* feat: allow IDP to return single string instead of array for roles/groups claim

This is to support ADFS
2023-12-04 10:01:45 -06:00
baf3bf6b9c feat: add workspace_id, owner_name to agent manifest (#10199)
Co-authored-by: Kyle Carberry <kyle@carberry.com>
Co-authored-by: Atif Ali <atif@coder.com>
2023-12-04 00:41:54 +03:00
6b3c4c00a2 fix: UpdateWorkspaceDormantDeletingAt interval out of range (#11000) 2023-12-02 11:47:08 -06:00
49ed66c7ad chore: remove ALTER TYPE .. ADD VALUE from migration 65 (#10998)
Follow up of Follow up of https://github.com/coder/coder/pull/10966
2023-12-02 11:40:23 -06:00
cbcf7561e5 chore: remove ALTER TYPE .. ADD VALUE from migration 46 (#10997)
Follow up of https://github.com/coder/coder/pull/10966
2023-12-02 11:38:12 -06:00
427572199e chore: remove ALTER TYPE .. ADD VALUE from migration 18 (#10996)
Follow up of https://github.com/coder/coder/pull/10966
2023-12-02 11:35:25 -06:00
8e684c8195 feat: run all migrations in a transaction (#10966)
Updates coder/customers#365

This PR updates our migration framework to run all migrations in a single transaction. This is the same behavior we had in v1 and ensures that failed migrations don't bring the whole deployment down. If a migration fails now, it will automatically be rolled back to the previous version, allowing the deployment to continue functioning.
2023-12-01 16:11:10 -06:00
13b89f79df feat: purge old provisioner daemons (#10949) 2023-12-01 12:43:05 +00:00
571d358e4b feat: add queries to clean lost connections in PGCoordinator (#10938)
Adds cleanup queries to clean out "lost" peer and tunnel state after 24 hours.  We leave this state in the database so that anything trying to connect to the peer can see that it was lost, but clean it up after 24 hours to ensure our table doesn't grow without bounds.
2023-12-01 10:02:30 +04:00
967db2801b chore: refactor ResolveAutostart tests to use dbfake (#10603) 2023-11-30 19:33:04 -06:00
0a16bda786 chore: add external auth providers to oidctest (#10958)
* implement external auth in oidctest
* Refactor more external tests to new oidctest
2023-11-30 14:05:15 -06:00
07895006d9 refactor(coderd/healthcheck): make Warnings an object with { Code, Message } (#10950)
- Adds health.Message { code string, mesasge string }
- Refactors existing warnings []string to be of type []health.Message instead
2023-11-30 14:49:50 +00:00
4f9292859d feat(coderd/healthcheck): add access URL error codes and healthcheck doc (#10915)
Relates to #8965

- Added error codes for separate code paths in health checks
- Prefixed errors and warnings with error code prefixes
- Added a docs page with details on each code, cause and solution

Co-authored-by: Muhammad Atif Ali <atif@coder.com>
2023-11-30 12:15:40 +00:00
2b574e2b2d feat: add dismissed property to the healthcheck section (#10940) 2023-11-29 16:37:40 +00:00
cb6c0f3cbb chore: refactor oidc group and role sync to methods (#10918)
The 'userOIDC' method body was getting unwieldy.
I think there is a good way to redesign the flow, but
I do not want to undertake that at this time.
The easy win is just to move some LoC to other methods
and cleanup the main method.
2023-11-29 09:24:00 -06:00
2b71e38b31 feat: add status to tailnet mapping query (#10936)
Adds the `status` column to the mapping query so that we can add graceful disconnect logic around it
2023-11-29 16:53:01 +04:00
2dc565d5de chore: remove New----Builder from dbfake function names (#10882)
Drop "New" and "Builder" from the function names, in favor of the top-level resource created.  This shortens tests and gives a nice syntax.  Since everything is a builder, the prefix and suffix don't add much value and just make things harder to read.

I've also chosen to leave `Do()` as the function to insert into the database.  Even though it's a builder pattern, I fear `.Build()` might be confusing with Workspace Builds.  One other idea is `Insert()` but if we later add dbfake functions that update, this might be inconsistent.
2023-11-29 11:06:04 +04:00
48d69c9e60 fix: update autostart context to include querying users (#10929) 2023-11-28 17:56:49 -06:00
18c4a98865 fix: numerical validation grammer (#10924) 2023-11-28 10:14:53 -08:00
19b6d194fc feat: manage health settings using Coder API (#10861) 2023-11-28 18:15:17 +01:00
452668c893 chore: avoid dbmock test errors in dbgen (#10923) 2023-11-28 17:04:25 +00:00
14bd489af6 feat: add queries for PGCoord HTMLDebug (#10913)
Adds queries for implementing HTMLDebug on the new PGCoordinator
2023-11-28 20:19:32 +04:00
54c3fc63d9 fix: docuemnt workspace filter query param correctly (#10894) 2023-11-27 12:57:24 -05:00
abb2c7656a chore: add claims to oauth link in db for debug (#10827)
* chore: add claims to oauth link in db for debug
2023-11-27 10:47:23 -06:00
f441ad66e1 fix(codersdk): keep workspace agent connection open after dial context (#10863) 2023-11-27 14:29:57 +02:00
3a0a4ddfcd chore: convert dbfake.ProvisionerJobResources to builder (#10881)
Convert to builder for consistency with rest of the package.  This will make it easier to use, and means we can drop "Builder" from function arguments since they are all builders in the package.
2023-11-27 14:46:31 +04:00
4548ad7cef chore: remove dbfake.Workspace (#10880)
Remove dbfake.Workspace and use builder instead.
2023-11-27 14:39:16 +04:00
78283a7fb9 chore: remove dbfake.WorkspaceWithAgent (#10879)
Replace dbfake.WorkspaceWithAgent() with the builder pattern and remove this function.
2023-11-27 14:30:15 +04:00
82d5130b07 chore: convert dbfake.Workspace and .WorkspaceWithAgent to a builder pattern (#10878)
Converts dbfake Workspace and WorkspaceWithAgent to builder pattern.
2023-11-27 14:16:31 +04:00
b73397e08c fix(site): add workspace proxy section to health page (#10862)
* Adds workspace proxy section to health page
* Conditionally places workspace proxy warnings in errors or warnings based on calculated severity
* Adds some more stories we were missing for HealthPage
2023-11-27 09:26:02 +00:00
d5ddcbdda0 chore: fix flake in templates_test.go (#10875) 2023-11-27 15:29:10 +10:00
dd161b172e feat: allow auditors to read template insights (#10860)
- Adds a template_insights pseudo-resource
- Grants auditor and template admin roles read access on template_insights
- Updates existing RBAC checks to check for read template_insights, falling back to template update permissions where necessary
- Updates TemplateLayout to show Insights tab if can read template_insights or can update template
2023-11-24 17:21:32 +00:00
e73901cf56 fix(coderd): remove nil ptr deref in watchWorkspace (#10859)
Fixes #10849
2023-11-24 15:16:21 +00:00
411ce46442 feat(coderd/healthcheck): add health check for proxy (#10846)
Adds a health check for workspace proxies:
- Healthy iff all proxies are healthy and the same version,
- Warning if some proxies are unhealthy,
- Error if all proxies are unhealthy, or do not all have the same version.
2023-11-24 15:06:51 +00:00
b501046cf9 test: increase test coverage around health severity (#10858) 2023-11-24 15:42:17 +01:00
34841cf2b7 fix: healthcheck warnings should be empty array (#10856) 2023-11-24 12:37:07 +01:00
a7c27cad26 feat: add database support for dismissed healthchecks (#10845) 2023-11-23 16:18:12 +00:00
78df68348a feat: include health severity in reports (#10817) 2023-11-23 16:08:41 +01:00
7f39ff854e fix: skip autostart for suspended/dormant users (#10771) 2023-11-22 11:14:32 -06:00
6ecba0fda7 fix(coderd): prevent logging error for query cancellation in watchWorkspaceAgentMetadata (#10843) 2023-11-22 15:32:31 +00:00
8dd003ba5e fix: preserve order of node reports in healthcheck (#10835) 2023-11-22 11:15:11 +01:00
a9c0c01629 chore: fix flake in listening ports test (#10833) 2023-11-22 09:30:51 +00:00
b25e5dc90b chore: remove dbfake.WorkspaceBuild in favor of builder pattern (#10814)
I'd like to convert dbfake into a builder pattern to prevent a proliferation of XXXWithYYY methods.  This is one step of the way by removing the Non-builder function.
2023-11-22 13:04:58 +04:00
51b58cfc98 fix: only update last_used_at when connection count > 0 (#10808) 2023-11-21 18:10:41 -06:00
214123d476 test: skip flaky HealthyWithNodeDegraded (#10826) 2023-11-21 20:46:58 +01:00
5d5b5aa074 chore: use dbfake for ssh tests rather than provisionerd (#10812)
Refactors SSH tests to skip provisionerd and instead use dbfake to insert workspaces and builds.  This should make tests faster and more reliable.

dbfake.WorkspaceBuild is refactored to use a "builder" pattern with "fluent" options, as the number of options and variants was starting to get out of hand.
2023-11-21 16:22:08 +04:00
048dc0450f feat: ensure coder remains healthy with single degraded DERP server (#10813) 2023-11-21 12:58:25 +01:00
abafc0863c feat(coderd): store workspace proxy version in the database (#10790)
Stores workspace proxy version in database upon registration.
2023-11-21 11:21:25 +00:00