Commit Graph

20 Commits

Author SHA1 Message Date
Ammar Bandukwala 2bd6d2908e
feat: convert entire CLI to clibase (#6491)
I'm sorry.
2023-03-23 17:42:20 -05:00
Marcin Tojek a69137b1f7
feat: Update CLI to handle managed variables (#6220)
* WIP

* hcl

* useManagedVariables

* fix

* Fix

* Fix

* fix

* go:build

* Fix

* fix: bool flag

* Insert template variables

* API

* fix

* Expose via API

* More wiring

* CLI for testing purposes

* WIP

* Delete FIXME

* planVars

* WIP

* WIP

* UserVariableValues

* no dry run

* Dry run

* Done FIXME

* Fix

* Fix: CLI

* Fix: migration

* API tests

* Test info

* Tests

* More tests

* fix: lint

* Fix: authz

* Address PR comments

* Fix

* fix

* fix

* CLI: create

* unit tests: create templates with variables

* Use last variables

* Fix

* Fix

* Fix

* Push tests

* fix: variable is required if Default is nil

* WIP

* Redact sensitive values

* Fixes

* Fixes

* Fix: arg description

* Fix

* Variable param

* Fix: gen

* Fix

* Fix: goldens
2023-02-17 09:07:45 +01:00
Ammar Bandukwala 592ce3b118
feat(cli): allow direct tar upload in template update/create (#5720) 2023-01-16 14:32:11 -06:00
Ricky Grassmuck f7baf45ae3
feat: support partial parameter files (#5392)
Fixes https://github.com/coder/coder/issues/5390
2022-12-13 19:58:57 -06:00
Ammar Bandukwala 95fb59696e
Refactor Provisioner to distinguish Plan and Apply (#5036) 2022-11-11 16:45:58 -06:00
Garrett Delfosse d277e28427
feat: change template max_ttl to default_ttl (#4843) 2022-11-09 19:36:25 +00:00
Kyle Carberry 11abb85df5 fix: Rename `IncludeProvisionerD` to `IncludeProvisionerDaemon` in test
This was an artifact from merging!
2022-09-07 20:29:26 +00:00
Joe Previte 1359850715
feat(cli): validate name length on template create (#3823)
* feat(cli): add template create validation test

This adds a test to validate that `template create` prints an error
message if called with a template name exceeding the 32-char limit.

* fixup

* fixup test

* feat(cli): add name validation to templatecreate

This adds a validation step to ensure the template name is less than 32
characters.

* fixup!: use utf8.RuneCountInString

* fixup!: remove pty from test
2022-09-07 15:01:18 -05:00
Kyle Carberry 67c4605370
chore: Reduce test times (#3856)
* chore: Reduce test times

* Rename IncludeProvisionerD to IncludeProvisionerDaemon

* Make  TestTemplateDAUs use Tailnet
2022-09-04 11:28:09 -05:00
Mathias Fredriksson 159137dc10
fix: Use stdin/out defined in command (#3199) 2022-07-26 17:23:32 +03:00
Mathias Fredriksson 7d07e670ca
chore: Improve test cleanup (#3112) 2022-07-22 15:14:45 +03: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
Mathias Fredriksson 17ba4c8e88
fix: Allow template names to be re-used after deletion (#2454)
Fixes #2152
2022-06-17 19:18:07 +00:00
Spike Curtis 93b1425d85
Stop showing persistent vs ephemeral for resources (#2333)
Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-16 18:36:11 +00:00
Cian Johnston 3e419ddb3d
feat: enforce template-level constraints for TTL and autostart (#2018)
This PR adds fields to templates that constrain values for workspaces derived from that template.

- Autostop: Adds a field max_ttl on the template which limits the maximum value of ttl on all workspaces derived from that template. Defaulting to 168 hours, enforced on edits to workspace metadata. New workspaces will default to the templates's `max_ttl` if not specified.
- Autostart: Adds a field min_autostart_duration which limits the minimum duration between successive autostarts of a template, measured from a single reference time. Defaulting to 1 hour, enforced on edits to workspace metadata.
2022-06-07 13:37:45 +01:00
Abhineet Jain 7c3e1a5d97
feat: Read params from file for template/workspace creation (#1541)
* Read params from file for template/workspace creation

* Use os.ReadFile

* Refactor reading params into a separate module

* Add comments and unit tests

* Rename variable

* Uncomment and fix unit test

* Fix comment

* Refactor tests

* Fix unit tests for windows

* Fix unit tests for Windows

* Add comments for the hotfix
2022-05-20 11:29:10 -04:00
Spike Curtis 1871b09697
feat: in-process provisionerd connection (#1568)
* in-process provisionerd connection

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

* disable lint for server.go/newProvisionerDaemon

Signed-off-by: Spike Curtis <spike@coder.com>
2022-05-19 17:47:45 -05:00
Mathias Fredriksson 56076a0aa2
feat: Unify cli behavior for templates create and update (#1385)
Fixes #565
2022-05-12 14:54:58 +03:00
Kyle Carberry fb9dc4f346
feat: Improve resource preview and first-time experience (#946)
* Improve CLI documentation

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Add tree view

* Improve table UI

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Rename `tunnel` to `skip-tunnel`

This command was `true` by default, which causes
a confusing user experience.

* Add disclaimer about editing templates

* Add help to template create

* Improve workspace create flow

* Add end-to-end test for config-ssh

* Improve testing of config-ssh

* Fix workspace list

* Fix config ssh tests

* Update cli/configssh.go

Co-authored-by: Cian Johnston <public@cianjohnston.ie>

* Fix requested changes

* Remove socat requirement

* Fix resources not reading in TTY

Co-authored-by: Cian Johnston <public@cianjohnston.ie>
2022-04-11 18:54:30 -05:00
Kyle Carberry 02ad3f14f5
chore: Rename Projects to Templates (#880)
Customer feedback indicated projects was a confusing name.
After querying the team internally, it seemed unanimous
that it is indeed a confusing name.

Here's for a lil less confusion @ashmeer7 🥂
2022-04-06 12:42:40 -05:00
Renamed from cli/projectcreate_test.go (Browse further)