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).
* chore: add /v2 to import module path
go mod requires semantic versioning with versions greater than 1.x
This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```
Migrate generated files to import /v2
* Fix gen
* database: add autostart_schedule and ttl to InsertWorkspace; make gen
* coderd: workspaces: consume additional fields of CreateWorkspaceRequest
* cli: update: add support for TTL and autostart_schedule
* cli: create: add unit tests
* coder: import `time/tzdata` for embedded timezone database
* autobuild: fix unit test that only runs with a real db
* feat(cli): add test for delete
This adds a new test for the `delete` command to ensure it works as
expected when provided the correct args.
* fix(cli): use ExecuteC() to match Cobra
This modifies the `cli.Root().Execute()` to `cli.Root).ExecuteC()` to
match the default behavior of Cobra. We do this so errors will always
print the "run --help" line.
* feat(cli): add WithoutParameters test for delete
This adds a new test to the `delete_test.go` suite to ensure the correct
behavior occurs when `delete` is called without an argument.
* fixup! feat(cli): add WithoutParameters test for delete
* refactor(cli): show --help error message on main
This adds an error message which shows when there is an error with any
commands called to improve the UX.
* fixup! refactor(cli): show --help error message on main
* refactor(cli): handle err with FormatCobraError
This adds a new helper function called `FormatCobraError` to `root.go`
so that we can colorize and add "--help" message to cobra command errors
like calling `delete`.
* refactor(cli): add root_test.go, move delete test
* 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>
* chore: Fix golangci-lint configuration and patch errors
Due to misconfiguration of a linting rules directory, our linter has not been
working properly. This change fixes the configuration issue, and all remaining
linting errors.
* Fix race in peer logging
* Fix race and return
* Lock on bufferred amount low
* Fix mutex lock
* chore: Add golangci-lint and codecov
* Use consistent file names
* Format settings.json
* Add golangci-lint and codecov GitHub Actions
* Add base Go file for linting
* Add test coverage