Garrett Delfosse
5789ea5397
chore: move stat reporting into workspacestats package ( #13386 )
2024-05-29 11:49:08 -04:00
Steven Masley
afd9d3b35f
feat: add api for patching custom org roles ( #13357 )
...
* chore: implement patching custom organization roles
2024-05-29 09:49:43 -05:00
Steven Masley
1b4ca00428
chore: include custom roles in list org roles ( #13336 )
...
* chore: include custom roles in list org roles
* move cli show roles to org scope
2024-05-23 07:54:59 -10:00
Kayla Washburn-Love
3f1e9c038a
feat(coderd): add endpoints for editing and deleting organizations ( #13287 )
2024-05-21 12:46:31 -06:00
Steven Masley
c61b64be61
feat: add hidden enterprise cmd command to list roles ( #13303 )
...
* feat: add hidden enterprise cmd command to list roles
This includes custom roles, and has a json ouput option for
more granular permissions
2024-05-21 13:14:00 -05:00
Marcin Tojek
b8b80fe6d2
feat: store coder_workspace_tags in the database ( #13294 )
2024-05-20 13:30:19 +00:00
Kayla Washburn-Love
a63d427efd
chore: add unique org name constraint to db ( #13311 )
2024-05-17 12:40:38 -06:00
Steven Masley
ad8c314130
chore: implement api for creating custom roles ( #13298 )
...
api endpoint (gated by experiment) to create custom_roles
2024-05-16 13:47:47 -05:00
Colin Adler
85de0e966d
chore: fix TestMeasureLatency/MeasureLatencyRecvTimeout flake ( #13301 )
2024-05-16 13:42:42 -05:00
Steven Masley
cf91eff7cf
chore: implement databased backend for custom roles ( #13295 )
...
Includes db schema and dbauthz layer for upserting custom roles. Unit test in `customroles_test.go` verify against escalating permissions through this feature.
2024-05-16 13:11:26 -05:00
Mathias Fredriksson
a0fce363cd
feat(coderd): add times_used to coder_apps in insights API ( #13292 )
...
For now, only applied to `coder_app`s, same logic can be implemented for
VS Code, SSH, etc.
Part of #13099
2024-05-16 16:53:01 +03:00
Steven Masley
1f5788feff
chore: remove rbac psuedo resources, add custom verbs ( #13276 )
...
Removes our pseudo rbac resources like `WorkspaceApplicationConnect` in favor of additional verbs like `ssh`. This is to make more intuitive permissions for building custom roles.
The source of truth is now `policy.go`
2024-05-15 11:09:42 -05:00
Steven Masley
cb6b5e8fbd
chore: push rbac actions to policy package ( #13274 )
...
Just moved `rbac.Action` -> `policy.Action`. This is for the stacked PR to not have circular dependencies when doing autogen. Without this, the autogen can produce broken golang code, which prevents the autogen from compiling.
So just avoiding circular dependencies. Doing this in it's own PR to reduce LoC diffs in the primary PR, since this has 0 functional changes.
2024-05-15 09:46:35 -05:00
Danny Kopping
4671ebb330
feat: measure pubsub latencies and expose metrics ( #13126 )
2024-05-10 12:31:49 +00:00
Kayla Washburn-Love
d8e0be6ee6
feat: add support for multiple banners ( #13081 )
2024-05-08 15:40:43 -06:00
Mathias Fredriksson
619ec927e9
test(coderd/database): fix DST issue in dbpurge test ( #13170 )
...
Fixes #13165
2024-05-06 14:14:38 +03:00
Colin Adler
886a97b425
chore: fix build ci ( #13164 )
2024-05-06 05:01:47 +00:00
Mathias Fredriksson
a69fc657f2
chore(coderd/database): reduce dbpurge load with smaller batches of agent stats ( #13049 )
2024-04-23 15:01:56 +03:00
Cian Johnston
e57ca3cdaa
feat(scripts): add script to check schema between migrations ( #13037 )
...
- migrations: allow passing in a custom migrate.FS
- gen/dump: extract some functions to dbtestutil
- scripts: write script to test migrations
2024-04-23 12:43:14 +01:00
Kayla Washburn-Love
fab5591cf6
chore: change site_configs.value to text ( #13036 )
...
* chore: change `site_configs.value` to `text`
* `make gen`
2024-04-22 17:25:36 -06:00
Mathias Fredriksson
3adcccb618
fix(coderd/database): reduce db load via dbpurge advisory locking ( #13021 )
2024-04-22 11:10:32 +00:00
Mathias Fredriksson
e17e8aa3c9
feat(coderd/database): keep only 1 day of workspace_agent_stats after rollup ( #12674 )
2024-04-22 13:11:50 +03:00
Colin Adler
3aa0d73811
chore: fix down migration 196 ( #13006 )
...
It didn't account for null values.
2024-04-18 18:47:02 -05:00
Colin Adler
777dfbe965
feat(enterprise): add ready for handshake support to pgcoord ( #12935 )
2024-04-16 15:01:10 -05:00
Colin Adler
231fc26c92
fix(coderd): properly calculate query latency for tailnet queries ( #12944 )
...
The defer used seems correct, but the `time.Since` will always resolve
immediately since it's a param to the deferred function.
2024-04-16 19:03:27 +00:00
Colin Adler
ba52a4fbe2
chore: fix linting issue ( #12945 )
...
The error wasn't used.
2024-04-16 13:50:46 -05:00
Spike Curtis
a231b5aef5
feat: add src_id and dst_id indexes to tailnet_tunnels ( #12911 )
...
Fixes #12780
Adds indexes to the `tailnet_tunnels` table to speed up `GetTailnetTunnelPeerIDs` and `GetTailnetTunnelPeerBindings` queries, which match on `src_id` and `dst_id`.
2024-04-11 10:05:53 +04:00
Steven Masley
0a8c8ce5cc
chore: remove InsertWorkspaceAgentStat query ( #12869 )
...
* chore: remove InsertWorkspaceAgentStat query
InsertWorkspaceAgentStats (batch) exists. We only used the singular in
a single unit test place. Removing the single for the batch, reducing
the interface size.
2024-04-09 12:35:27 -05:00
Garrett Delfosse
f96ce80ab9
feat: add owner groups to workspace data ( #12841 )
2024-04-05 15:06:17 -04:00
Steven Masley
a3187dc30f
chore: enforce unique linked_ids ( #12815 )
...
* chore: enforce unique linked_ids
Duplicate linked_ids make no sense. 2 users cannot share the same
source user from a provider
2024-04-03 13:17:11 -05:00
Danny Kopping
79fb8e43c5
feat: expose workspace statuses (with details) as a prometheus metric ( #12762 )
...
Implements #12462
2024-04-02 09:57:36 +02:00
Steven Masley
eeb3d63be6
chore: merge authorization contexts ( #12816 )
...
* chore: merge authorization contexts
Instead of 2 auth contexts from apikey and dbauthz, merge them to
just use dbauthz. It is annoying to have two.
* fixup authorization reference
2024-03-29 10:14:27 -05:00
Mathias Fredriksson
79441e3609
perf(coderd/database): optimize GetWorkspaceAgentAndLatestBuildByAuthToken ( #12809 )
2024-03-28 19:38:16 +02:00
Mathias Fredriksson
d50c20c453
fix(coderd/database): add fk index for workspace_agent_scripts ( #12791 )
2024-03-28 14:31:58 +02:00
Mathias Fredriksson
47fd190064
fix(coderd/database): improve perf of GetTemplateInsightsByInterval ( #12773 )
...
Refs #12122
2024-03-27 14:10:46 +02:00
Mathias Fredriksson
0da29d74ac
fix(coderd/database): improve query perf of GetTemplateAppInsights ( #12767 )
...
Refs #12122
2024-03-27 12:28:36 +02:00
Colin Adler
4d5a7b2d56
chore(codersdk): move all tailscale imports out of codersdk ( #12735 )
...
Currently, importing `codersdk` just to interact with the API requires
importing tailscale, which causes builds to fail unless manually using
our fork.
2024-03-26 12:44:31 -05:00
Mathias Fredriksson
ae0ee622bb
fix(coderd/database): improve data exclusion in UpsertTemplateUsageStats ( #12764 )
...
The PostgreSQL query analyzer wasn't able to eliminate the agent stats without re-introducing this filter.
Before: https://explain.dalibo.com/plan/21h7gb4f4bef391g
After: https://explain.dalibo.com/plan/721ec1cccee91egc
2024-03-26 17:21:05 +02:00
Mathias Fredriksson
b183236482
feat(coderd/database): use template_usage_stats in *ByTemplate insights queries ( #12668 )
...
This PR updates the `*ByTempalte` insights queries used for generating Prometheus metrics to behave the same way as the new rollup query and re-written insights queries that utilize the rolled up data.
2024-03-25 17:42:02 +02:00
Mathias Fredriksson
2332d8197a
feat(coderd/database): use template_usage_stats in GetUserActivityInsights query ( #12672 )
...
This PR updates the `GetUserActivityInsights` query to use rolled up `template_usage_stats` instead of raw agent and app stats.
2024-03-25 16:16:41 +02:00
Mathias Fredriksson
a8ed689bda
feat(coderd/database): use template_usage_stats in GetUserLatencyInsights query ( #12671 )
...
This PR updates the `GetUserLatencyInsights` query to use rolled up `template_usage_stats` instead of raw agent and app stats.
2024-03-25 16:07:40 +02:00
Mathias Fredriksson
5738a03930
feat(coderd/database): use template_usage_stats in GetTemplateAppInsights query ( #12669 )
...
This PR updates the `GetTemplateAppInsights` query to use rolled up `template_usage_stats` instead of raw agent and app stats.
2024-03-25 15:58:37 +02:00
Mathias Fredriksson
5f3be62c83
feat(coderd/database): use template_usage_stats in GetTemplateInsightsByInterval query ( #12667 )
...
This PR updates the `GetTemplateInsightsByInterval` query to use rolled up `template_usage_stats` instead of raw agent and app stats.
2024-03-25 15:45:49 +02:00
Mathias Fredriksson
35d08434a9
feat(coderd/database): use template_usage_stats in GetTemplateInsights query ( #12666 )
...
This PR updates the `GetTemplateInsights` query to use rolled up `template_usage_stats` instead of raw agent and app stats.
2024-03-25 15:33:31 +02:00
Steven Masley
c674128105
chore: allow search by build params in workspace search filter ( #12694 )
...
* chore: workspace search filter allow search by params
* has_param will return all workspaces with the param existance
* exact matching
2024-03-22 14:22:47 -05:00
Mathias Fredriksson
b4fd819f0d
test(coderd): enable dbrollup service for insights tests ( #12673 )
2024-03-22 20:18:20 +02:00
Mathias Fredriksson
12e6fbf11e
feat(coderd/database): add dbrollup service to rollup insights ( #12665 )
...
Add `dbrollup` service that runs the `UpsertTemplateUsageStats` query
every 5 minutes, on the minute. This allows us to have fairly real-time
insights data when viewing "today".
2024-03-22 18:42:43 +02:00
Mathias Fredriksson
04f0510b09
feat(coderd/database): add template_usage_stats table and rollup query ( #12664 )
...
Add `template_usage_stats` table for aggregating tempalte usage data.
Data is rolled up by the `UpsertTemplateUsageStats` query, which fetches
data from the `workspace_agent_stats` and `workspace_app_stats` tables.
2024-03-22 18:33:34 +02:00
Cian Johnston
28730ca3d8
fix(support): sanitize manifest ( #12711 )
2024-03-21 19:55:34 +00:00
Cian Johnston
5454f4997b
chore(ci): clean up databases after test finishes in CI ( #12702 )
2024-03-21 14:53:16 +00:00