Commit Graph

1760 Commits

Author SHA1 Message Date
Mathias Fredriksson 592340c6ce fix: Data race in cliui.Styles without clone (#3164) 2022-07-25 16:30:52 +03:00
Kyle Carberry fd4954b4e5 fix: Use membership endpoint to ensure user exists in team (#3129)
This was using the incorrect GitHub endpoint prior, which fetched a team
by slug. Any user in a GitHub organization can view all teams, so this
didn't block signups like intended.

I've verified this API returns an error when the calling user is not a
member  of the team requested.

Fixes #3105.
2022-07-22 13:54:08 -05:00
Mathias Fredriksson 51dd1fde3b fix: Remove use of require in require.Eventually in tests (#3110)
* fix: Remove use of `require` in `require.Eventually` in tests

Because require uses `t.FailNow()` and `require.Eventually` runs the
function in a goroutine, which is not allowed.

* feat: Add ruleguard for require.Eventually

Co-authored-by: Cian Johnston <cian@coder.com>
2022-07-22 20:02:49 +03:00
Mathias Fredriksson ef7d357e19 fix: Move timeout ctx closer to use in tests, increase timeout (#3109)
Some contexts were moved closer to use so that test setup doesn't affect
timeout. And timeout was increased for some others to avoid flakyness
due to slow test runners.
2022-07-22 17:42:09 +03:00
Mathias Fredriksson 7d07e670ca chore: Improve test cleanup (#3112) 2022-07-22 15:14:45 +03:00
David Wahler 7f54628848 config-ssh: always support agent name in host alias (#3036) 2022-07-21 14:49:32 -05:00
Jon Ayers e01905821f fix: avoid emitting version warning when connection error encountered (#3082) 2022-07-21 14:28:24 -05:00
Jon Ayers 62e685669f feat: add verbose error messaging (#3053) 2022-07-20 15:17:51 -05:00
Mathias Fredriksson 3e5affd28a fix: Increase test timeout for TestCreate/CreateFromListWithSkip (#3077)
Considering database load and CI performance during testing, we should
avoid failing too early.
2022-07-20 17:51:33 +00:00
Mathias Fredriksson 4fde5366be fix: Improve TestSSH reliability on macOS (#3067)
Related issue: https://github.com/coder/coder/issues/2122
2022-07-20 19:24:15 +03:00
Mathias Fredriksson 034416f141 chore: Speed up port-forward tests (#3062)
* chore: Speed up port-forward tests

* chore: Add t.Helper and ensure listener closure on error
2022-07-20 18:11:25 +03:00
Colin Adler 1033e02d79 feat: add coder server postgres-builtin-serve to run the built-in DB (#2997) 2022-07-14 21:51:44 +00:00
David Wahler b5f5e909bd Return template parameters in consistent order (#2975)
* return parameters from Terraform provisioner in sorted order

* persist parameter indices in database and return them in correct order from API

* don't re-sort parameters by name when creating templates
2022-07-13 15:29:34 -05:00
Kyle Carberry 8b76e40629 fix: Fetch GitHub teams by name for performance (#2955)
In large organizations with thousands of teams, looping took >5s.
This fetches organizations by team name, which should be very fast!
2022-07-13 00:45:43 +00:00
Kyle Carberry 5ee112bc00 fix: Fetch all GitHub teams on login (#2951)
This wasn't looping prior, so organizations with >100 teams
couldn't login. Contributes to #2848.
2022-07-12 23:06:27 +00:00
Mathias Fredriksson 59facdd8dc fix: Show schedule commands in help, improve template (#2923)
* fix: Show schedule commands in help, improve template

* chore: Remove schedule long help, fixed by listing missing commands

* chore: Clean up annotation usage with template function

* fix: Drive-by fix for trailing whitespace for flags

Introduced in c7681370b5.
2022-07-12 23:24:53 +03:00
Cian Johnston 5e6320163d change default aws linux instance type to t3.micro, reduce default template TTL (#2776)
- make default template max TTL 24 hours (still less than 168)
- make default workspace autostop 2 hours unless specified otherwise
- add instance type selector to aws templates
2022-07-12 19:37:59 +01:00
Abhineet Jain 61c52b3090 feat: default confirm to no for cli delete (#2919) 2022-07-12 10:36:07 -07:00
Ketan Gangatirkar 536c77af5d fix: confirm when deleting template (#2866)
* prompt for confirmation before deleting templates (#2830)

* populate templateNames from the interactive picker too

* allow skipping delete confirmation prompt with --yes flag

* eliminate unnecessary newline

* test both confirmation of delete and `--yes` with no confirmation

* fix failing test that needed --yes

* remove unnecessary empty line the linter disliked

* make the tests correct
2022-07-11 13:13:56 -05:00
Ketan Gangatirkar 5eecbaa534 fix: trim leading and trailing spaces from template parameters (#2829) (#2879) 2022-07-11 11:46:03 -05:00
Mathias Fredriksson 749694b7de fix: Standardize and wrap example descriptions at 80 chars (#2894) 2022-07-11 19:08:09 +03:00
Mathias Fredriksson c7681370b5 fix: Wrap help flags at 100 chars (#2893)
Because the actual flags take quite a bit of space, wrapping at 80
characters creates a very cramped output for e.g. `coder server`, for
this reasons, flags are wrapped at 100 chars (vs. standard 80).

The `Consumes $ENV_FLAG` message was put on a newline for consistency,
this should allow users to learn where to look for the informations.

Side note: we should perhaps stop adding period (`.`) at the end of flag
descriptions to be consistent, for instance, command helps usually don't
have one.

This change fixes the biggest issue in #2363, but not all `--help`
output is guaranteed (yet) to wrap at 80-100 chars.

Fixes #2363
2022-07-11 17:07:25 +03:00
Kyle Carberry dff6e97f83 feat: Add allowlist of GitHub teams for OAuth (#2849)
Fixes #2848.
2022-07-08 21:37:18 -05:00
Ketan Gangatirkar 2609be767d feat: add timestamps to output at end of some workspace and template subcommands (#2831) 2022-07-08 14:27:56 -05:00
Kyle Carberry 584448e089 fix: worksapces -> workspaces in template create CLI (#2857)
Fixes #2846.
2022-07-08 14:22:30 -05:00
Kyle Carberry dc58d1b734 fix: Update text in logout tests (#2851)
This fixes CI!
2022-07-07 21:46:31 -05:00
Ketan Gangatirkar 4f1e9dae27 Ketan/cli help tweak (#2803)
* fix CLI help text for logout

"log out" is verb, "logout" is a noun

* add CLI help for port-forward command (#2802)

* found another noun where a verb should be
2022-07-04 15:48:08 -05:00
Jon Ayers e5d5fa7706 fix: reprompt for matching passwords on mismatch (#2758)
- Previously we only re-prompted for the password confirmation.
2022-07-01 11:49:39 -05:00
Jon Ayers 554d9917c0 feat: make 'templates update [name]' optional (#2761)
- If the name is not specified the current working directory
  name is used or the name specified by "--directory". This
  reflects 'templates create" behavior.
2022-07-01 11:49:29 -05:00
Abhineet Jain de1fc40000 fix: consistent workspace status b/w CLI and UI (#2743) 2022-07-01 14:40:03 +00:00
Jon Ayers 6ad0f31687 fix: don't check version on gitssh cmds (#2757) 2022-06-30 12:03:41 -05:00
Jon Ayers 7df5827767 feat: add version checking to CLI (#2725) 2022-06-29 17:49:40 -05:00
Colin Adler 6a55889362 fix: disable wireguard in portforward and gitssh tests (#2728) 2022-06-29 17:37:26 +00:00
Steven Masley ea7f9e2d47 chore: Parameter listing cmd default adding scope column (#2718) 2022-06-29 11:29:21 -05:00
Colin Adler 2b6dcb842d Revert "feat: add version checking to CLI" (#2712) 2022-06-29 02:42:23 +00:00
Jon Ayers 7ee7be3391 feat: add version checking to CLI (#2643)
* feat: add version checking to CLI
2022-06-28 20:55:34 -05:00
Jon Ayers 4b6189c9e9 fix: fix panic in template pull (#2710) 2022-06-28 19:54:28 -05:00
Kyle Carberry 69f27efead fix: Close parameter file before test exit (#2694)
Flake seen here:
https://github.com/coder/coder/runs/7079404499?check_suite_focus=true
2022-06-27 14:42:26 -05:00
Jon Ayers 2353687610 feat: unexpose coderdtest.NewWithAPI (#2613)
* feat: unexpose coderdtest.NewWithAPI
2022-06-27 13:50:52 -05:00
Jon Ayers 3a3aa493f1 fix: use absolute path for config-ssh coder binary (#2647) 2022-06-27 12:15:55 -05:00
Kyle Carberry 6429dfee1f test: Use a template to prevent migrations from running for every test (#2462)
* test: Use a template to prevent migrations from running for every test

* Create a single makefile target

* Fix built-in race

* Extend timeout of built-in PostgreSQL fetch
2022-06-27 17:07:39 +00:00
Steven Masley f41b50a253 feat: Updating workspace prompts new parameters (#2598) 2022-06-27 16:19:10 +00:00
Kyle Carberry 16ac54cbd9 fix: Wait for workspace build to complete before running SSH tests (#2671)
This was causing a race shown here:
https://github.com/coder/coder/runs/7063713786?check_suite_focus=true
2022-06-26 23:10:52 +00:00
Kyle Carberry dac6838fc3 fix: Await workspace build job before waiting for CLI output (#2670)
This was causing occasional flakes seen here:
https://github.com/coder/coder/runs/7063142245?check_suite_focus=true
2022-06-26 22:05:37 +00:00
Jon Ayers d1c69866e8 fix: provide environment variable for CLI session token (#2648) 2022-06-24 18:50:35 -05:00
Colin Adler 6aed58f486 feat: add ssh support over wireguard (#2642) 2022-06-24 16:21:46 -05:00
Abhineet Jain bd07284a68 feat: Add success messages for CLI commands (#2634) 2022-06-24 16:30:22 +00:00
Colin Adler 05b67ab1cf feat: peer wireguard (#2445) 2022-06-24 10:25:01 -05:00
Abhineet Jain c6b1daabc5 feat: Download default terraform version when minor version mismatches (#1775) 2022-06-22 23:11:52 +00:00
Kyle Carberry 437066ce20 fix: Stop sending additional signals in Shutdown test (#2582)
Coder was exiting before the additional signals were handled,
which caused occasional CI failures.
2022-06-22 11:32:34 -05:00