Commit Graph

7133 Commits

Author SHA1 Message Date
Ammar Bandukwala 0d9010e150
chore: fix 30% startup time hit from userpassword (#12769)
pbkdf2 is too expensive to run in init, so this change makes it load
lazily. I introduced a lazy package that I hope to use more in my
`GODEBUG=inittrace=1` adventure.


Benchmark results:

```
$ hyperfine "coder --help" "coder-new --help"
Benchmark 1: coder --help
  Time (mean ± σ):      82.1 ms ±   3.8 ms    [User: 93.3 ms, System: 30.4 ms]
  Range (min … max):    72.2 ms …  90.7 ms    35 runs
 
Benchmark 2: coder-new --help
  Time (mean ± σ):      52.0 ms ±   4.3 ms    [User: 62.4 ms, System: 30.8 ms]
  Range (min … max):    41.9 ms …  62.2 ms    52 runs
 
Summary
  coder-new --help ran
    1.58 ± 0.15 times faster than coder --help
```
2024-03-26 20:47:14 -05:00
dependabot[bot] 73fbdbbe2d
chore: bump github.com/coreos/go-oidc/v3 from 3.9.0 to 3.10.0 (#12739)
Bumps [github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/coreos/go-oidc/releases)
- [Commits](https://github.com/coreos/go-oidc/compare/v3.9.0...v3.10.0)

---
updated-dependencies:
- dependency-name: github.com/coreos/go-oidc/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 12:45:42 -05: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
dependabot[bot] 0bea8906d4
chore: bump google.golang.org/api from 0.170.0 to 0.171.0 (#12737)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.170.0 to 0.171.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.170.0...v0.171.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 17:14:01 +00:00
dependabot[bot] a323e30450
chore: bump github.com/aws/aws-sdk-go-v2 from 1.25.3 to 1.26.0 (#12738)
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.25.3 to 1.26.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.25.3...v1.26.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 12:03:01 -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 f418ece9ae
test(cli): prevent flake due to outdated build in TestSSH (#12760)
Fixes #12752
2024-03-26 10:46:58 +00:00
Spike Curtis 51491fc01b
fix(provisionersdk): change test to use bash script instead of binary echo (#12759)
Just upgraded to macOS 14.4 and TestAgentScript/Run fails for me with error `signal: killed`.  I opened the test directory in a terminal and sure enough, when you execute the `echo` binary, it is immediately killed.  The binary has no extended attributes and is byte-identical to the one in `/bin/`.

This fix uses a different strategy: instead of copying the `echo` binary from the system around, we just copy a small bash script that _calls_ the `echo` command.
2024-03-26 14:37:20 +04:00
Colin Adler 5f28220eec
fix(coderd): add timeout to websocket waitgroup on shutdown (#12754) 2024-03-26 03:04:15 +00:00
Kayla Washburn-Love cfb484fa25
fix: always use bash when executing web terminal tests (#12755) 2024-03-25 16:58:07 -06:00
dependabot[bot] 064a08efa5
ci: bump the github-actions group with 1 update (#12743)
Bumps the github-actions group with 1 update: [contributor-assistant/github-action](https://github.com/contributor-assistant/github-action).


Updates `contributor-assistant/github-action` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/contributor-assistant/github-action/releases)
- [Commits](https://github.com/contributor-assistant/github-action/compare/v2.3.1...v2.3.2)

---
updated-dependencies:
- dependency-name: contributor-assistant/github-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 23:40:35 +03:00
Asher 40e5ad5499
feat: make OAuth2 provider not enterprise-only (#12732) 2024-03-25 11:52:22 -08:00
Garrett Delfosse 60f335113c
chore: add protocol lag to shared ports description (#12728) 2024-03-25 15:28:38 -04:00
Kyle Carberry fd8010c26d
chore: make `build` only run on main (#12753) 2024-03-25 19:15:18 +00:00
Kayla Washburn-Love 541ccd940c
chore: change e2e testing port (#12751) 2024-03-25 13:07:34 -06:00
Kyle Carberry 03ab37b343
chore: remove middleware to request version and entitlement warnings (#12750)
This cleans up `root.go` a bit, adds tests for middleware HTTP transport
functions, and removes two HTTP requests we always always performed previously
when executing *any* client command.

It should improve CLI performance (especially for users with higher latency).
2024-03-25 15:01:42 -04:00
Cian Johnston ba3879ac47
fix(cli): fix newline escape sequence in support blurb (#12749) 2024-03-25 16:51:48 +00:00
Marcin Tojek 1e0bbd5e10
docs: describe operational readiness (#12723) 2024-03-25 17:10:24 +01:00
Mathias Fredriksson 7e183db199
test(coderd): fix todo for increased accuracy in insights test (#12727)
This PR updates the tests in `insights_test.go` to enable commented-out scenarios. This behavior was fixed by previous PRs in this stack. Note that the updated golden files are correct since they are "second template only" meaning that the newly introduced data is considered as expected. In other golden files there is no change since "only count once" is applied.
2024-03-25 17:55:53 +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
Cian Johnston 01f9a9ab77
feat(cli): unhide support bundle cmd (#12745)
* chore(cli): add another test to ensure no secret leakage

* feat(cli): unhide support bundle cmd
2024-03-25 15:14:27 +00: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
Mathias Fredriksson f34592f45d
fix(coderd): skip logging error for cancelled query in agent report stats (#12730) 2024-03-25 12:20:16 +02:00
Jon Ayers 951dfaa99c
feat: add workspace_id to workspace_build audit logs (#12718) 2024-03-22 15:10:32 -05:00
Kayla Washburn-Love 0966fe2560
fix: create workspace with optional auth providers (#12729) 2024-03-22 13:26:02 -06: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
Kyle Carberry a6b8f381f0
feat: support windows containers in bootstrap script (#12662)
Fixes #7462.
2024-03-22 14:48:51 +00:00
Muhammad Atif Ali 58cbd8335f
chore(site): reorganize template schedule strings page (#12714) 2024-03-22 15:44:16 +03:00
Marcin Tojek a7d9d87ba2
docs: use scale testing utility (#12643) 2024-03-22 11:33:31 +00:00
Colin Adler 37a05372fa
fix: disable relay if built-in DERP is disabled (#12654)
Fixes https://github.com/coder/coder/issues/12493
2024-03-21 16:53:41 -05:00
Kyle Carberry d3c9aaf57b
chore: update hero image for refreshed dashboard (#12712)
* chore: update hero image for refreshed dashboard

I used html.to.figma for this. It's in the following Figma:
https://www.figma.com/file/m4zkIU7e64BNyRlUShuluq/README-Screenshot?type=design&node-id=13-1993&mode=design&t=o2AhL8y7u8uFMVPI-0

I couldn't take screenshots directly, because I'm on Linux and the macOS
browser with the icons look much better.

* Try stacked images

* Try stacked inverted
2024-03-21 16:28:02 -04:00
Cian Johnston 28730ca3d8
fix(support): sanitize manifest (#12711) 2024-03-21 19:55:34 +00:00
Cian Johnston f2a9e515df
feat(cli/support): confirm before creating bundle (#12684)
Forces user to confirm before creating a support bundle.
Also adds contextual information to the bundle under cli_logs.txt.
2024-03-21 17:06:28 +00:00
Cian Johnston 8ea5fb7115
chore(coderd/workspaceapps/apptest): fix test flake due to concurrent usage of same deployment (#12700)
- Updates existing tests under workspaceapps/apptest to not reuse existing appDetails as assertWorkspaceLastUsed(Not)?Updated calls FlushStats() which was causing racy test behaviour and incorrect test assertions.
- Expands scope of assertWorkspaceLastUsedAtUpdated and its counterpart to ProxySubdomain tests.
2024-03-21 15:38:38 +00:00
Cian Johnston 5454f4997b
chore(ci): clean up databases after test finishes in CI (#12702) 2024-03-21 14:53:16 +00:00
Mathias Fredriksson 9c84fb7fb1
fix(coderd/agentapi): always write agent stats when provided (#12699) 2024-03-21 16:47:06 +02:00
Steven Masley bd6ad88077
chore: nolint always return error function (#12701) 2024-03-21 09:35:10 -05:00
Steven Masley b4492fffba
chore: support multiple key:value search query params (#12690)
This more closely aligns with GitHub's label search style. Actual search params need to be converted to allow this format, by default they will throw an error if they do not support listing.
2024-03-21 08:37:19 -05:00
Bruno Quaresma 8499eacf67
chore(site): add tests for deprecate template flow (#12685)
Closes #12505
2024-03-21 10:37:08 -03:00
Steven Masley 131d0bd2ba
chore: fix linting issue in main(#12697) 2024-03-20 20:15:01 -05:00
dependabot[bot] f93491ffe8
chore: bump github.com/docker/docker from 24.0.7+incompatible to 24.0.9+incompatible (#12692)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-21 02:14:30 +03:00
Dean Sheather 2b773f9034
fix: allow proxy version mismatch (with warning) (#12433) 2024-03-20 18:24:18 +00:00
Garrett Delfosse 4d9fe05f5a
feat: add awsiamrds db auth driver (#12566) 2024-03-20 13:14:43 -04:00