* chore: add database test fixture to insert non-unique linked_ids
* chore: create unit test to exercise failed email change bug
* fix: add postgres triggers to keep user_links clear of deleted users
* Add migrations to prevent deleted users with links
* Force soft delete of users, do not allow un-delete
* Detects the following pattern where the CLI is initialized with a client authenticated as the "first user":
client := coderdtest.New(t, ...)
[...]
user := coderdtest.CreateFirstUser(t, client)
[...]
clitest.SetupConfig(t, client, root)
* Updates documentation regarding role permissions on workspaces.
* 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
* test: add unit test that deletes abandoned workspace
This is to ensure we do not break this functionality in future.
This is important incase this edge case happens, an admin can
clean up the abandoned resources.
* 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