Commit Graph

1026 Commits

Author SHA1 Message Date
784696dfa5 feat: add prometheus metrics to database.Store (#7713)
* Adds dbmetrics package and wraps database.Store with a Prometheus HistogramVec of timings.
* Adds Wrappers method to database.Store to avoid double-wrapping interfaces
* Fixes test flake in TestLicensesListFake
2023-05-31 14:55:57 +01:00
7c3dbbbe93 fix: stream provisioner logs (#7712)
* stream provisioner logs

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix imports

Signed-off-by: Spike Curtis <spike@coder.com>

* Better logging, naming, arg order

Signed-off-by: Spike Curtis <spike@coder.com>

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-05-31 06:15:58 +00:00
43e0968dac feat: format healthcheck responses (#7723) 2023-05-30 16:59:39 -05:00
73d795f426 chore: Revert to only using 1 timezone support for template DAUs (#7721)
* chore: Revert to only using 1 timezone support for template DAUs

Keeping the logic to support more in case we optimize later
2023-05-30 15:37:07 -04:00
022372dd73 feat(healthcheck): add websocket report (#7689) 2023-05-30 14:22:32 -05:00
77b0ca0b53 refactor(site): Improve workspaces filtering (#7681) 2023-05-30 14:52:13 -03:00
c795a0e500 feat: Fix Deployment DAUs to work with local timezones (#7647)
* chore: Add timezone param to DAU SQL query
* Merge DAUs response
* Pass time offsets to metricscache
2023-05-30 13:18:27 -04:00
702c9081e0 fix: do not skip parameter validation if min or max = 0 (#7707) 2023-05-30 14:57:06 +02:00
0fd2ea4044 test(coderd/rbac): Increase TestFilter timeout (#7694) 2023-05-26 15:44:05 +03:00
d9299caa12 feat: order workspaces by running first (#7656)
* wip

* use updated sql

* wip

* Implement sorting in databasefake.go

* More fixes

* sql fmt

---------

Co-authored-by: Marcin Tojek <marcin@coder.com>
2023-05-25 13:35:47 -03:00
14efdadd3c feat: Collect agent SSH metrics (#7584) 2023-05-25 12:52:36 +02:00
05da1e94a2 Fix pubsub goroutines in tests (#7677)
Signed-off-by: Spike Curtis <spike@coder.com>
2023-05-25 14:46:32 +04:00
67cc196c92 feat: pubsub reports dropped messages (#7660)
* Implementation; need linux tests

Signed-off-by: Spike Curtis <spike@coder.com>

* Pubsub with errors tests and fixes

Signed-off-by: Spike Curtis <spike@coder.com>

* Deal with test goroutines

Signed-off-by: Spike Curtis <spike@coder.com>

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-05-25 06:22:30 +00:00
d413b261d8 chore: deduplicate CLI telemetry reports (#7669) 2023-05-24 12:45:41 -05:00
ec117e841a chore: add CLI invokation telemetry (#7589) 2023-05-24 11:08:03 -05:00
cd416c86dd refactor: workspace builds (#7541)
* refactor workspace builds

Signed-off-by: Spike Curtis <spike@coder.com>

* make gen

Signed-off-by: Spike Curtis <spike@coder.com>

* Remove ParameterResolver from typescript

Signed-off-by: Spike Curtis <spike@coder.com>

* rename conversion -> database/db2sdk

Signed-off-by: Spike Curtis <spike@coder.com>

* tests for db2sdk

Signed-off-by: Spike Curtis <spike@coder.com>

* Tests for ParameterResolver

Signed-off-by: Spike Curtis <spike@coder.com>

* wsbuilder tests

Signed-off-by: Spike Curtis <spike@coder.com>

* Move parameter validation tests to richparameters_test.go

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix CI generation; rename mock->dbmock

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix test imports

Signed-off-by: Spike Curtis <spike@coder.com>

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-05-23 12:06:33 +04:00
4a320617b4 feat(workspaces): change sorting order of the workspace list (#7594)
* feat(workspaces): implement sorting order on workspace list

* split slice into its own function and test it

* use require instead of assert

* Update coderd/workspaces_internal_test.go

Co-authored-by: Cian Johnston <cian@coder.com>

* refactor tests into table tests

* fix test

---------

Co-authored-by: Cian Johnston <cian@coder.com>
2023-05-22 20:51:29 +00:00
5d711fc95a chore: CORs option for yarn dev server (#7630)
* chore: Yarn dev servers require CORs headers for external proxies

Adds a flag to set CORs headers to `*` for yarn dev servers
2023-05-22 20:02:39 +02:00
dd5b0b2721 fix(scim): ensure scim users aren't created with their own org (#7595) 2023-05-18 20:54:45 -04:00
ec5ef51b49 feat: add session token injection to provisioner (#7461) 2023-05-17 23:29:22 -05:00
00a2413c03 feat: add telemetry support for workspace agent subsystem (#7579) 2023-05-17 22:49:25 -05:00
224d25d4e1 feat: add 'impending deletion' badges to workspaces page (#7530)
* update deleting logic

* added status badge on workspaces page

* licensing and feature flagging

* preset filter for failed workspaces

* remove comment

* PR feedback

* Revert "PR feedback"

This reverts commit 2dfbb50acd.

* PR feedback 2
2023-05-15 07:59:17 -07:00
70d2203b9e chore: reduce the log output of skipped tests (#7520)
With the introduction of the workspace proxy tests there was a lot
of output if a test was eventually skipped.
2023-05-14 19:37:00 -05:00
26490aecca chore: improve postgres test time by removing cleanup (#7522)
We don't need to delete databases on cleanup... and we don't need to
always run without a cache either!
2023-05-14 15:32:44 -05:00
f05f12231d feat: update slog to use logfmt (#7477) 2023-05-14 20:23:13 +00:00
cd38cb8290 feat: Add template version warnings (#7483) 2023-05-12 09:21:49 +00:00
8f768f8276 feat: Workspace Proxy picker show latency to each proxy (#7486)
* chore: Add cors to workspace proxies to allow for latency checks
* Add latency check to wsproxy

Use performance API timings.
- Fix cors and timing headers
- Accept custom headers
2023-05-11 15:42:30 -05:00
640fcf450c chore: improve terraform install performance (#7478) 2023-05-11 19:30:51 +00:00
ae3473dc1b feat: add deleted_at field to workspace model (#7475)
* added impending_deletion workspace field

* gen docs

* update golden files

* added test

* PR comments
2023-05-11 08:47:53 -07:00
b7f4f3a771 chore: Implement workspace proxy going away (graceful shutdown) (#7459)
* chore: Implement workspace proxy going away

When a workspace proxy shuts down, the health status of that
proxy should immediately be updated. This is purely a courtesy
and technically not required
2023-05-10 19:23:16 -05:00
a42a36a474 feat: add workspace actions cleanup configuration flags to CLI template create and edit (#7453)
* added cleanup flags on template create

* added cleanup flags on template edit

* fixed tests

* added to tests
2023-05-10 12:57:11 -07:00
3f9af6f5e7 chore: Allow cors requests to workspace proxies for latency checks (#7484)
* CSP addition for web requests
* chore: Add cors to workspace proxies to allow for latency checks
2023-05-10 17:19:55 +00:00
b5ad628460 chore: Allow editing proxy fields via api. (#7435)
* chore: Add ability to update workspace proxy fields
2023-05-09 13:46:50 -05:00
fc1bc374cb chore: Drop application host call, default to regions for info (#7457)
* chore: Drop application host call, default to regions for info
2023-05-09 09:28:25 -05:00
8899dd89ca chore: add global caching to rbac (#7439)
Co-authored-by: Steven Masley <stevenmasley@coder.com>
2023-05-08 08:59:01 -05:00
5ffa6dae50 feat: add inactivity cleanup and failure cleanup configuration fields to Template Schedule Form (#7402)
* added workspace actions entitlement

* added workspace actions experiment

* added new route for template enterprise meta

* removing new route; repurposing old

* add new fields to get endpoints

* removed workspace actions experiment

* added logic to enterprise template store

* added new form fields

* feature flagged new fields

* fix validation

* fixed submit btn

* fix tests

* changed ttl defaults

* added FE tests

* added BE tests

* fixed lint

* adjusted comment language

* fixing unstaged changes check

* fix test

* Update coderd/database/migrations/000122_add_template_cleanup_ttls.down.sql

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Update coderd/database/migrations/000122_add_template_cleanup_ttls.up.sql

Co-authored-by: Dean Sheather <dean@deansheather.com>

---------

Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-05-05 08:19:26 -07:00
a6a44896bf fix: pubsub ordering (#7404)
* fix: pubsub sends messages in order

Signed-off-by: Spike Curtis <spike@coder.com>

* Drop messages rather than block

Signed-off-by: Spike Curtis <spike@coder.com>

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-05-05 09:39:07 +04:00
11ac3be4d8 fix: redirect to login on gitauth invalid session (#7416) 2023-05-04 17:19:44 +00:00
4e52112112 fix: template versions test flake (#7400) 2023-05-03 20:19:49 -05:00
8bd9f9c351 feat: unified tracing between coderd<->provisionerd (#7370) 2023-05-03 23:02:35 +00:00
3368b8b65f chore: Minor rbac memory optimization (#7391)
* test: Add benchmark for static rbac roles
* static roles should only be allocated once
* A unit test that modifies the ast value should not mess with the globals
* Cache subject AST values to avoid reallocating slices
2023-05-03 14:42:24 -05:00
2e9310b203 chore: add workspace actions entitlement and experiment (#7361)
* added workspace actions entitlement

* added workspace actions experiment
2023-05-03 11:34:43 -07:00
434c4be9f1 chore: Add listing proxies to cli 'coder proxy ls' (#7376)
* feat: Add listing proxies to cli 'coder proxy ls'

* Add unit test

* Ignore errors

* Make gen and update golden files

* Update golden files
2023-05-03 10:12:56 -05:00
90c57a538c fix: make telemetry source a string not an enum (#7390) 2023-05-03 14:33:51 +00:00
a1db82582f chore: Dynamic CSP connect-src to support terminals connecting to workspace proxies (#7352)
* chore: Expose proxy hostnames to csp header
2023-05-02 08:30:44 -05:00
4b9621f9ae fix(coderd): don't hang on first gitauth clone (#7331)
Previously, the `coder git ssh` command would hang on the API, which was endlessly polling the database for oauth tokens that expire in the future.

Some oAuth implementations (including GitHub by default) will not give back a token expiry date, and the absence of such a date was represented as a zero data in the database as opposed to a null value.

Follow-up calls to `git clone` would succeed because this hot path doesn't check expiry, perhaps originally by mistake.

In addition to fixing the zero date issue, this PR removes all gitauth PubSub, which added too much complexity when the polling interval is 1 second.
2023-05-01 19:19:41 +00:00
4a9d1c16c7 chore: UI/UX for regions (#7283)
* chore: Allow regular users to query for all workspaces
* FE to add workspace proxy options to account settings
* WorkspaceProxy context syncs with coderd on region responses

---------

Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-04-28 16:04:52 -05:00
59efa4a528 fix(audit): ensure template creation errors are audited (#7315) 2023-04-27 18:55:34 -05:00
77d9937dc4 fix: vite fatals on receiving HTTP4xx (#7306)
* fix: vite fatals on receiving HTTP4xx

* tune Vite

* fmt

* rewrite

* fmt
2023-04-27 19:04:24 +02:00
bb0a38b161 feat: Implement aggregator for agent metrics (#7259) 2023-04-27 12:34:00 +02:00