Commit Graph

2275 Commits

Author SHA1 Message Date
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
5229d7fd3a feat: implement deprecated flag for templates to prevent new workspaces (#10745)
* feat: implement deprecated flag for templates to prevent new workspaces
* Add deprecated filter to template fetching
* Add deprecated to template table
* Add deprecated notice to template page
* Add ui to deprecate a template
2023-11-20 19:16:18 +00:00
d8df87d5ae fix: insights metrics comparison (#10800)
* fix: insights metrics comparison

* links
2023-11-20 18:37:46 +01:00
9b6433e3a7 chore: remove theme experiment (#10798)
Co-authored-by: Kyle Carberry <kyle@carberry.com>
2023-11-20 09:53:20 -07:00
3aef070959 fix: return non-null warning arrays in healthcheck (#10774) 2023-11-17 22:25:44 +00:00
0f17d7c144 chore: return context.Canceled when in Prepare for rbac (#10763)
Was returning a custom rego canceled error. This conforms with
how Authorize handles this error.
2023-11-17 20:28:59 +00:00
8999d5785a feat: do not fail DERP healthcheck if WebSocket is used (#10714) 2023-11-17 16:00:49 +01:00
fc249fab1e skip TestCollectInsights (#10749) 2023-11-17 10:57:53 +01:00
0e5eecd7da feat: add more logging around echo tar (#10731) 2023-11-16 16:52:04 +01:00
198b56c137 fix(coderd): fix memory leak in watchWorkspaceAgentMetadata (#10685)
Fixes #10550
2023-11-16 17:03:53 +02:00
bd17290ff4 chore(coderd/autobuild): address some logic errors in autostart tests (#10713) 2023-11-15 16:26:10 +00:00
9d310388e5 feat(coderd): /debug/health: add parameter to force healthcheck (#10677) 2023-11-15 15:54:15 +00:00
290180b104 feat!: bump workspace activity by 1 hour (#10704)
Marked as a breaking change as the previous activity bump was always the TTL duration of the workspace/template.

This change is more cost conservative, only bumping by 1 hour for workspace activity. To accommodate wrap around, eg bumping a workspace into the next autostart, the deadline is bumped by the TTL if the workspace crosses the autostart threshold.

This is a niche case that is likely caused by an idle terminal making a workspace survive through a night. The next morning, the workspace will get activity bumped the default TTL on the autostart, being similar to as if the workspace was autostarted again.

In practice, a good way to avoid this is to set a max_deadline of <24hrs to avoid wrap around entirely.
2023-11-15 09:42:27 -06:00
1516c6636b feat: add SQL queries for v2 PG Coordinator (#10572)
re #10528

Adds SQL queries to support Tailnet v2 API in the PG Coordinator
2023-11-15 10:13:27 +04:00
e0afee1b85 feat: add debug endpoint for single tailnet (#10485) 2023-11-13 17:14:12 -06:00
75ab16d19a fix: prevent db deadlock when workspaces go dormant (#10618) 2023-11-13 13:40:20 -06:00
b69c237b8a feat(coderd/healthcheck): allow configuring database hc threshold (#10623)
* feat(coderd/healthcheck): allow configuring database hc threshold
* feat(coderd): add database hc latency, plumb through
* feat(coderd): allow configuring healthcheck refresh interval
2023-11-13 14:14:43 +00:00
a4f1319108 feat(cli): allow showing schedules for multiple workspaces (#10596)
* coder list: adds information about next start / stop to available columns (not default)
* coder schedule: show now essentially coder list with a different set of columns
* Updates cli schedule unit tests to use new dbfake

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2023-11-10 13:51:49 +00:00
ed7e43b54c feat: expose parameter insights as Prometheus metrics (#10574) 2023-11-09 10:30:40 +01:00
e23873ff8f feat: add endpoint for resolving autostart status (#10507) 2023-11-08 23:24:56 -06:00
2cf2904515 fix: improve language of latest build error (#10593) 2023-11-08 18:38:46 +00:00
aded7b1513 feat: implement bitbucket-server external auth defaults (#10520)
* feat: implement bitbucket-server external auth defaults

Bitbucket cloud != Bitbucket server
Add reasonable defaults for server

* change "bitbucket" to "bitbucket-cloud"
2023-11-08 11:05:51 -06:00
26740cf00d chore(scripts/rules.go): broaden scope of testingWithOwnerUser linter (#10548)
* Updated testingWithOwnerUser ruleguard rule to detect:
  a) Passing client from coderdenttest.New() to clitest.SetupConfig() similar to what already exists for AGPL code
  b) Usage of any method of the owner client from coderdenttest.New() - all usages of the owner client must be justified with a `//nolint:gocritic` comment.
* Fixed resulting linter complaints.
* Added new coderdtest helpers CreateGroup and UpdateTemplateMeta.
* Modified check_enterprise_import.sh to ignore scripts/rules.go.
2023-11-08 14:54:48 +00:00
0a550815e9 feat: expose app insights as Prometheus metrics (#10346) 2023-11-07 17:14:59 +01:00