Commit Graph

580 Commits

Author SHA1 Message Date
e8be092af0 chore: add sqlc push action on releases (#11171)
* add sqlc push action on releases
* Make sqlc push optional
2023-12-19 20:31:55 +00:00
213b768785 feat(coderd): insert provisioner daemons (#11207)
* Adds UpdateProvisionerDaemonLastSeenAt
* Adds heartbeat to provisioner daemons
* Inserts provisioner daemons to database upon start
* Ensures TagOwner is an empty string and not nil
* Adds COALESCE() in idx_provisioner_daemons_name_owner_key
2023-12-18 16:44:52 +00:00
e46431078c feat: add AgentAPI using DRPC (#10811)
Co-authored-by: Spike Curtis <spike@coder.com>
2023-12-18 22:53:28 +10:00
3f6096b0d7 chore: unit test to enforce authorized queries match args (#11211)
* chore: unit test to enforce authorized queries match args
* Also check querycontext arguments
2023-12-15 20:31:07 +00:00
e63de9a259 chore: enforcement of dbauthz tests was broken (#11218)
* chore: enforcement of dbauthz tests was broken

Implemented missing tests to catch back up

---------

Co-authored-by: Cian Johnston <cian@coder.com>
2023-12-15 18:30:21 +00:00
b36071c6bb feat: allow templates to specify max_ttl or autostop_requirement (#10920) 2023-12-15 18:27:56 +10:00
fad457420b fix: copy StringMap on insert and query in dbmem (#11206)
Addresses the issue in #11185 for the StringMap datatype.

There are other slice data types in our database package that also need to be fixed, but that'll be a different PR
2023-12-14 22:23:29 +04:00
133dc66143 feat: add a theme picker (#11140) 2023-12-14 10:38:44 -07:00
5b0e6bfa2a feat(coderd/database): add api_version to provisioner_daemons table (#11204)
Adds column api_version to the provisioner_daemons table.
This is distinct from the coderd version, and is used to handle breaking changes in the provisioner daemon API.
2023-12-14 12:52:41 +00:00
b7bdb17460 feat: add metrics to workspace agent scripts (#11132)
* push startup script metrics to agent
2023-12-13 11:45:43 -06:00
4f7ae6461b feat(coderd/database): add UpsertProvisionerDaemons query (#11178)
Co-authored-by: Marcin Tojek <marcin@coder.com>
2023-12-13 12:31:40 +00:00
6800fc8477 chore: bump go (->v1.21.5) and sqlc (->v1.24.0) to new versions (#11170) 2023-12-12 18:50:23 -06:00
e52d848d05 chore: validate queries using sqlc-vet in github actions (#11163) 2023-12-12 15:53:26 -06:00
dba0dfa859 chore: correct 500 -> 404 on workspace agent mw (#11129)
* chore: correct 500 -> 404
2023-12-12 15:14:32 -06:00
0181e036f6 chore: remove unused query failing to prepare (#11167) 2023-12-12 15:02:15 -06:00
b02796655e fix(coderd/database): remove column updated_at from provisioner_daemons table (#11108) 2023-12-12 11:19:28 +00:00
197cd935cf chore(Makefile): use linter version from dogfood Dockerfile (#11147)
* chore(Makefile): use golangci-lint version from dogfood Dockerfile

* chore(dogfood/Dockerfile): update golangci-lint to latest version

* chore(coderd): address linter complaints
2023-12-12 10:02:32 +00:00
6775a86785 chore: make "users"."avatar_url" NOT NULL (#11112) 2023-12-11 10:09:51 -07:00
d8e95001e8 chore: add theme_preference column to users table (#11069) 2023-12-08 21:59:53 +00:00
e73a202aed feat: show dormant workspaces by default (#11053) 2023-12-07 18:09:35 -06:00
ce49a55f56 chore: update build_reason 'autolock' -> 'dormancy' (#11074) 2023-12-07 17:11:57 -06:00
228cbec99b fix: stop updating agent stats from deleted workspaces (#11026)
Co-authored-by: Steven Masley <stevenmasley@gmail.com>
2023-12-07 13:55:29 -05:00
8aea6040c8 fix: use unique workspace owners over unique users (#11044) 2023-12-07 10:53:15 -05:00
941e3873a8 fix: implement fake DeleteOldWorkspaceAgentStats (#11076) 2023-12-07 14:08:16 +01:00
b376b2cd13 feat: add user/settings page for managing external auth (#10945)
Also add support for unlinking on the coder side to allow reflow.
2023-12-06 08:41:45 -06:00
f6891bc465 fix: implement fake DeleteOldWorkspaceAgentLogs (#11042) 2023-12-06 14:31:43 +01:00
81a3b36884 feat: add endpoints to list all authed external apps (#10944)
* feat: add endpoints to list all authed external apps

Listing the apps allows users to auth to external apps without going through the create workspace flow.
2023-12-05 14:03:44 -06:00
feaa9894a4 fix(site/src/api/typesGenerated): generate HealthSection enums (#11049)
Relates to #8971

- Introduces a codersdk.HealthSection enum type
- Refactors existing references using strings to use new HealthSection type
2023-12-05 20:00:27 +00:00
5fad611020 feat(coderd): add last_seen_at and version to provisioner_daemons table (#11033)
Related to #10676

- Adds columns last_seen_at and version to provisioner_daemons table
- Adds the above to codersdk.ProvisionerDaemons struct
2023-12-05 13:54:38 +00: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
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
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
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
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
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
a7c27cad26 feat: add database support for dismissed healthchecks (#10845) 2023-11-23 16:18:12 +00:00