Commit Graph

1998 Commits

Author SHA1 Message Date
504cedf15a feat: add telemetry for external provisioners (#10322) 2023-10-18 14:20:30 -05:00
619df23ad1 chore: fix linting issues and generated files (#10317) 2023-10-17 14:41:35 -06:00
1656249e07 feat: add all safe experiments to the deployment page (#10276)
* added new option table type for experiments

* added tests

* fixed go tests

* added go test for new param

* removing query change

* clearing ExperimentsAll

* dont mutate ExperimentsAll

* added new route for safe experiments

* added new route for safe experiments

* added test for new route

* PR feedback

* altered design

* alias children
2023-10-17 14:49:19 -04:00
6ebe9b0402 feat: add UI for autostart workspace days (#10263)
* feat: add ui for selecting auto start days
2023-10-16 09:29:42 -05:00
6875faf238 fix(coderd/provisionerdserver): pass through api ctx to provisionerdserver (#10259)
Passes through coderd API ctx to provisionerd server so we can cancel workspace updates when API is shutting down.
2023-10-16 13:50:07 +01:00
39c0539d42 feat: add controls to template for determining startup days (#10226)
* feat: template controls which days can autostart
* Add unit test to test blocking autostart with DaysOfWeek
2023-10-13 11:57:18 -05:00
98b6c8bcb0 chore(coderd): report full license in telemetry (#10258)
Will aid in cross-referencing deployments to sales accounts.
2023-10-13 11:43:06 -05:00
4857d4bd55 feat(codersdk/agentsdk): use new agent metadata batch endpoint (#10224)
Part of #9782
2023-10-13 17:32:28 +03:00
7eeba15d16 feat(coderd): add support for sending batched agent metadata (#10223)
Part of #9782
2023-10-13 16:37:55 +03:00
d56f49f619 fix(coderd): make activitybump aware of default template ttl (#10253)
The refactored ActivityBump query did not take into account the
template-level TTL, resulting in potentially incorrect bump
amounts for workspaces that have both a user-defined and template-
defined TTL that differ.

This change is ported over from PR#10035 to reduce the overall
size of that PR.

Also includes a drive-by unit test in autobuild for checking template autostop/TTL.

Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-10-13 13:53:02 +01:00
88605b9d01 chore: add display name to member role (#10239)
* chore: add display name to member role
* Do not let member role be assignable
* Ignore org member role for assignability atm
2023-10-12 10:52:32 -05:00
782c22a293 test(coderd/database/dbtestutil): allow access to *sql.DB (#10238) 2023-10-12 15:07:16 +03:00
7df40b85f2 chore(coderd/coderdtest): use testing.TB for use in benchmarks (#10237) 2023-10-12 15:03:16 +03:00
ac623b4717 feat: implement basic archive ui to make archiving failed versions easy (#10182)
* feat: implement basic archive ui to make archiving failed versions easy.
2023-10-11 15:06:10 +00:00
1e950fa9a8 feat: archive template versions to hide them from the ui (#10179)
* api + cli implementation
2023-10-11 09:26:22 -05:00
7c71053eab fix: stop leaking User into API handlers unless authorized
Fixes an issue where we extracted the `{user}` parameter from the URL and added it to the API Handler context regardless of whether the caller had permission to read the User.
2023-10-11 09:41:14 +04:00
ec9b480ac0 fix: use is-dormant instead of dormant_at (#10191) 2023-10-10 19:00:09 -05:00
e7d9b8d858 feat: allow prefixes at the beginning of subdomain app hostnames (#10150) 2023-10-10 20:02:39 +00:00
91555c3a85 feat: support configurable web terminal rendering (#10095)
* feat: support configurable web terminal rendering

- Added a deployment option for configuring web terminal rendering.
  Valid values are 'webgl', 'canvas', and 'dom'.
2023-10-10 13:18:02 -05:00
69d13f1676 chore: add archive column to template versions (#10178)
* chore: add archive column to template versions
2023-10-10 10:52:42 -05:00
c11f241622 feat: add --version flag to coder templates pull, default to active version (#10153)
Fixes https://github.com/coder/coder/issues/9837
2023-10-10 10:20:31 -05:00
db8592fa93 chore: refactor workspace conversion to accept ownerName (#10171)
Refactors workspace conversion to accept the ownerName, rather than a slice of users, since all it does is search the slice for the owner and use the username.

This is in preparation for a fix to `postWorkspacesByOrganization()` that will remove the need to pass the user object.

Also avoids panicing if the required user is not in the slice, since `findUser` could return nil in the old code, which would then get dereferenced for the username.
2023-10-10 16:55:28 +04:00
b780bff429 chore: drop unused redirectToLoginOnMe parameter (#10164)
The parameter seems to be vestigial from an earlier use of the middleware, but is always set to `false` in the code.
2023-10-10 16:13:00 +04:00
78b9201b31 chore: move AsSystemRestricted to caller (#10163)
Moves escalation to SystemRestricted out of the function that queries the database for the User. This is in prepartion for a refactor such that we don't need SystemRestricted in `ExtractUserParam` middleware.
2023-10-10 15:57:51 +04:00
8a47262faf fix: ignore logged errors in TestWorkspaceAgent/Timeout
fixes #10167

Annoyingly, there isn't a good way to stop the publish from being sent on shutdown, and subscribing to them in the test is too fragile because empty messages are sent in a bunch of places, so we can't reliably tell it's regarding timeouts.
2023-10-10 15:45:47 +04:00
a0485c00ac chore: refactor ExtractUserParam to call function
Refactors `ExtractUserParam` to separate the part that actually obtains the user from the database and the part that sets it on the middleware context.  This is in preparation for further refactor that removes `ExtractUserParam` middleware from 
`organizations/{organization}/members/{user}` paths.
2023-10-10 15:00:53 +04:00
c83af5e627 chore(cli): add linter to detect potential spurious usage of owner user in cli tests (#10133)
* Detects the following pattern where the CLI is initialized with a client authenticated as the "first user":

    client := coderdtest.New(t, ...)
    [...]
    user := coderdtest.CreateFirstUser(t, client)
    [...]
    clitest.SetupConfig(t, client, root)

* Updates documentation regarding role permissions on workspaces.
2023-10-10 11:14:20 +01:00
f36fba2486 fix: revert: use CRC32 to shorten app subdomain
This reverts commit 0e28397c82.
2023-10-10 18:12:46 +10:00
9c098b218f feat: allow external auth providers to expose extra metadata (#10157) 2023-10-09 23:02:16 -05:00
3eb9a43190 fix: use query to get external-auth by id (#10156) 2023-10-09 22:25:50 -05:00
a61f8ee45c fix: apply default ExtraTokenKeys to oauth (#10155) 2023-10-09 22:11:05 -05:00
863c2e7b64 feat: allow storing extra oauth token properties in the database (#10152) 2023-10-09 18:49:30 -05:00
35538e1051 feat: add external-auth cli (#10052)
* feat: add `external-auth` cli

* Add subcommands

* Improve descriptions

* Add external-auth subcommand

* Fix docs

* Fix gen

* Fix comment

* Fix golden file
2023-10-09 23:04:35 +00:00
3bbfcc593e feat: add request_id to HTTP trace spans (#10145) 2023-10-09 14:05:10 -05:00
b9c7bc4d3c fix: check for nil pointer in AwaitWorkspaceAgents
CompletedAt is a pointer and can be nil, need to check before calling IsZero() on it

c.f. https://github.com/coder/coder/runs/17534657301
2023-10-09 22:12:28 +04:00
9e622d00a6 feat(cli): add coder users delete command (#10115) 2023-10-09 11:47:57 -05:00
19dbf19177 fix(coder): properly check for missing organization membership
Fixes a possible panic introduced in https://github.com/coder/coder/pull/9781.
2023-10-06 14:57:21 -05:00
03a7d2f70b chore: fix servertailnet test flake (#10110)
https://github.com/coder/coder/actions/runs/6424100765/job/17444018788?pr=10083#step:5:771
2023-10-06 11:31:53 -05:00
2d2bea79a7 fix: convert the new dashboard theme to be an experiment (#10108) 2023-10-06 09:46:52 -05:00
983e8c3ae8 feat: add API support for workspace automatic updates (#10099)
* Added automatic_updates to workspaces table

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

* Queries and API updates

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

* Golden files

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

* Enable automatic updates on autostart

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

* db migration number

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

* fix imports and ts mock

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

* code review updates

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

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-10-06 13:27:12 +04:00
eb4826a11f chore: remove workspace_actions experiment (#10030) 2023-10-05 14:18:35 -05:00
b32d79ef0b fix: fix failed workspaces continuously auto-deleting (#10069)
- Fixes an issue where workspaces that are eligible for auto-deletion
  are retried every tick (1 minute) even if the previous deletion
  transition failed.

  The updated logic only attempts to delete workspaces that previously
  failed once a day (24 hours since last attempt).
2023-10-05 14:11:39 -05:00
91265678ad chore: add auditing to workspace dormancy (#10070)
- Adds an audit log for workspaces automatically transitioned to the dormant
  state.
- Imposes a mininum of 1 minute on cleanup-related fields. This is to
  prevent accidental API misuse from resulting in catastrophe.
2023-10-05 13:41:07 -05:00
888b97fd86 chore: use JobStatus computed from the db (#10079)
Fixes `main`
2023-10-05 18:25:06 +00:00
f001a57614 fix: only allow promoting successful template versions (#9998) 2023-10-05 10:49:25 -06:00
ab9276bd08 feat: modify workspace_agent_stats index (#10073) 2023-10-05 14:49:08 +02:00
5021e23105 chore: compute job status as column (#10024)
* chore: provisioner job status as column
* use provisioner job status for workspace searching
2023-10-04 20:57:46 -05:00
df8e10cc4c chore: increase ForceCancelInterval for test flakes (#10066)
See https://github.com/coder/coder/actions/runs/6411239320/job/17406394658
2023-10-04 21:16:39 +00:00
7f9b4ad9a8 fix: allow auditors to query deployment stats and insights (#10058)
This is a customer request.
2023-10-04 18:37:25 +00:00
2c2e98cc39 fix(coderd): fetch workspace agent scripts and log sources using system auth ctx (#10043)
* add failing unit test
* fetch log sources and agent scripts using system auth ctx
2023-10-04 15:50:51 +01:00