Commit Graph

54 Commits

Author SHA1 Message Date
04794e6fb8 Merge remote-tracking branch 'origin/main' into jjs/presets 2025-02-07 08:11:01 +00:00
f22885599f fix tests 2025-02-07 07:59:49 +00:00
00f1ec30df Add tests 2025-02-06 07:36:10 +00:00
b3b229c73d test(provisioner/terraform): use cmp.Diff instead of require.Equal (#16449) 2025-02-05 14:20:33 +00:00
7cbd77fd94 feat: improve resources_monitoring for OOM & OOD monitoring (#16241)
As requested for [this
issue](https://github.com/coder/internal/issues/245) we need to have a
new resource `resources_monitoring` in the agent.

It needs to be parsed from the provisioner and inserted into a new db
table.
2025-02-04 18:45:33 +01:00
6caa29a29f chore: fix terraform/provider testdata to use latest terraform-provider (#16309)
provisioner/terraform/testdata current version has been generated using
outdated version of terraform-provider - with some parameters that are
not relevant anymore, causing `generate.sh` to fail when trying to
generate new data.
2025-01-29 15:26:49 +01:00
08463c27d8 feat: add OpenIn option to coder_app (#15743)
This PR is the coder/coder part of [the open_in parameter
issue](https://github.com/coder/terraform-provider-coder/issues/297)
aiming to add a new optional parameter to choose how to open modules.

This PR is heavily linked [to this
PR](https://github.com/coder/terraform-provider-coder/pull/321).

ℹ️ For now, some integrations tests can not be pushed as it requires a
release on the terraform-provider repo.
2025-01-03 11:27:02 +01:00
5861e516b9 chore: add standard test logger ignoring db canceled (#15556)
Refactors our use of `slogtest` to instantiate a "standard logger" across most of our tests.  This standard logger incorporates https://github.com/coder/slog/pull/217 to also ignore database query canceled errors by default, which are a source of low-severity flakes.

Any test that has set non-default `slogtest.Options` is left alone. In particular, `coderdtest` defaults to ignoring all errors. We might consider revisiting that decision now that we have better tools to target the really common flaky Error logs on shutdown.
2024-11-18 14:09:22 +04:00
aa0dc2daa1 chore: track terraform modules in telemetry (#15450)
Addresses https://github.com/coder/nexus/issues/35.

This PR:

- Adds a `workspace_modules` table to track modules used by the
Terraform provisioner in provisioner jobs.
- Adds a `module_path` column to the `workspace_resources` table,
allowing to identify which module a resource originates from.
- Starts pushing this new information into telemetry.

For the person reviewing this PR, do not fret about the 1,500 new lines
- ~1,000 of them are auto-generated.
2024-11-16 21:56:19 +01:00
07d41716ad fix(provisioner): handle multiple agents, apps, scripts and envs (#13741) 2024-07-03 14:55:28 +02:00
475c3650ca feat: add support for optional external auth providers (#12021) 2024-02-21 11:18:38 -07:00
c0e169ebf9 feat: support custom order of agent metadata (#12066) 2024-02-08 17:29:34 +01:00
5596fb20b5 chore: move /gitauth to /externalauth on the frontend (#9954)
* chore: move `/gitauth` to `/externalauth` on the frontend

This actually took a lot more jank than anticipated,
so I wanted to split this up before adding the ability
to embed new providers.

* Rename FE

* Fix em' up

* Fix linting error

* Fix e2e tests

* chore: update helm golden files
2023-09-30 14:30:01 -05:00
1262eef2c0 feat: add support for coder_script (#9584)
* Add basic migrations

* Improve schema

* Refactor agent scripts into it's own package

* Support legacy start and stop script format

* Pipe the scripts!

* Finish the piping

* Fix context usage

* It works!

* Fix sql query

* Fix SQL query

* Rename `LogSourceID` -> `SourceID`

* Fix the FE

* fmt

* Rename migrations

* Fix log tests

* Fix lint err

* Fix gen

* Fix story type

* Rename source to script

* Fix schema jank

* Uncomment test

* Rename proto to TimeoutSeconds

* Fix comments

* Fix comments

* Fix legacy endpoint without specified log_source

* Fix non-blocking by default in agent

* Fix resources tests

* Fix dbfake

* Fix resources

* Fix linting I think

* Add fixtures

* fmt

* Fix startup script behavior

* Fix comments

* Fix context

* Fix cancel

* Fix SQL tests

* Fix e2e tests

* Interrupt on Windows

* Fix agent leaking script process

* Fix migrations

* Fix stories

* Fix duplicate logs appearing

* Gen

* Fix log location

* Fix tests

* Fix tests

* Fix log output

* Show display name in output

* Fix print

* Return timeout on start context

* Gen

* Fix fixture

* Fix the agent status

* Fix startup timeout msg

* Fix command using shared context

* Fix timeout draining

* Change signal type

* Add deterministic colors to startup script logs

---------

Co-authored-by: Muhammad Atif Ali <atif@coder.com>
2023-09-25 16:47:17 -05:00
ee24260614 feat: allow configuring display apps from template (#9100) 2023-08-30 14:53:42 -05:00
22e781eced chore: add /v2 to import module path (#9072)
* 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
2023-08-18 18:55:43 +00:00
9f2a931eb8 feat(coderd): support ephemeral parameters (#8367) 2023-07-10 13:44:03 +02:00
c6fcd7ee93 fix: report failed CompletedJob (#8318) 2023-07-06 07:26:33 +00:00
6639c69fad feat: add "display_order" column to coder_parameter to keep parameters sorted in UI (#8227) 2023-06-30 12:41:55 +02:00
b4f14cc6a9 feat: include coder_parameters from external modules (#8195) 2023-06-26 13:46:30 +00:00
125e9ef00e fix: validate that parameter names are unique (#7882) 2023-06-07 09:44:50 -08:00
660bbb8d38 refactor: deprecate login_before_ready in favor of startup_script_behavior (#7837)
Fixes #7758
2023-06-06 11:58:07 +03:00
10036ab5fb fix: use minDisabled, maxDisabled for parameter validation (#7755) 2023-06-02 11:43:48 +02:00
ca4fa81570 feat: add agent metadata (#6614) 2023-03-31 15:26:19 -05:00
6378294071 chore: upgrade from deprecated protobuf import (#6883)
This was displaying a warning when running `go get ./...`.
2023-03-30 14:17:44 +00:00
ffb4cd5962 chore: fix race when expecting parameters (#6814)
See https://github.com/coder/coder/actions/runs/4532378002/jobs/7983840014
2023-03-27 14:18:33 -05:00
c7fb5f960c feat: preserve original order of rich parameters (#6747)
* WIP

* orderedParameters

* fix

* WIP

* TestS
2023-03-24 09:37:27 +01:00
fce8a4adf0 feat: preserve order of rich parameters (#6689)
* WIP

* TDD

* Implement

* WIP
2023-03-21 16:28:17 +01:00
2d4706ac33 feat: mark coder_parameter as "required" (#6433)
* Add required column

* Pass through providerd

* Pass the required property down

* Optional

* Fix

* Fix

* Fix

* fix

* CLI create: support for optional fields

* Use HTML API to mark fields required

* Fix

* Improve validation

* more fixes

* make fmt

* Fix

* WIP

* Fix: test

* CLI update tets

* OptionalParameterAdded

* Fix: migration
2023-03-07 16:38:31 +01:00
22e3ff96be feat(agent): Add shutdown lifecycle states and shutdown_script support (#6139)
* feat(api): Add agent shutdown lifecycle states

* feat(agent): Add shutdown_script support

* feat(agent): Add shutdown_script timeout

* feat(site): Support new agent lifecycle states

---

Co-authored-by: Marcin Tojek <marcin@coder.com>
2023-03-06 21:34:00 +02:00
7f226d4f90 feat: add support for coder_git_auth data source (#6334)
* Add git auth providers schema

* Pipe git auth providers to the schema

* Add git auth providers to the API

* Add gitauth endpoint to query authenticated state

* Add endpoint to query git state

* Use BroadcastChannel to automatically authenticate with Git

* Add error validation for submitting the create workspace form

* Fix panic on template dry-run

* Add tests for the template version Git auth endpoint

* Show error if no gitauth is configured

* Add gitauth to cliui

* Fix unused method receiver

* Fix linting errors

* Fix dbauthz querier test

* Fix make gen

* Add JavaScript test for git auth

* Fix bad error message

* Fix provisionerd test race

See https://github.com/coder/coder/actions/runs/4277960646/jobs/7447232814

* Fix requested changes

* Add comment to CreateWorkspacePageView
2023-02-27 10:18:19 -06:00
a79f4a095d fix: allow mapped resources in our terraform provider (#6255) 2023-02-17 16:05:38 +00:00
e161c45b47 Revert "fix: allow mapped resources in our terraform provider (#6242)" (#6248)
This reverts commit d5af536ea2.
2023-02-17 12:55:54 +01:00
d5af536ea2 fix: allow mapped resources in our terraform provider (#6242)
Fixes #6234.
2023-02-16 13:04:40 -06:00
981cac5e28 chore: Invert delay_login_until_ready, now login_before_ready (#5893) 2023-01-27 20:07:47 +00:00
138887de7e feat: Add workspace agent lifecycle state reporting (#5785) 2023-01-24 14:24:27 +02:00
6ebadabe4e feat: Add basic support for rich parameters to coderd and provisionerd (#5710) 2023-01-17 11:22:11 +01:00
ac27cf8c07 fix: properly apply metadata when multiple resources share the same id (#5443) 2022-12-21 13:48:49 -05:00
eff99f78fa feat: Add support for MOTD file in coder agents (#5147) 2022-11-24 12:22:20 +00:00
97dbd4dc5d Implement Quotas v3 (#5012)
* provisioner/terraform: add cost to resource_metadata

* provisionerd/runner: use Options struct

* Complete provisionerd implementation

* Add quota_allowance to groups

* Combine Quota and RBAC licenses

* Add Opts to InTx
2022-11-14 17:57:33 +00:00
90c34b74de feat: Add connection_timeout and troubleshooting_url to agent (#4937)
* feat: Add connection_timeout and troubleshooting_url to agent

This commit adds the connection timeout and troubleshooting url fields
to coder agents.

If an initial connection cannot be established within connection timeout
seconds, then the agent status will be marked as `"timeout"`.

The troubleshooting URL will be present, if configured in the Terraform
template, it can be presented to the user when the agent state is either
`"timeout"` or `"disconnected"`.

Fixes #4678
2022-11-09 17:27:05 +02:00
a672ae8c7d feat: Extract instance type when provisioning VMs (#4839)
This should help us identify what instances our users consume.
2022-11-01 21:51:57 +00:00
10df2fd4fb feat: add new required slug property to coder_app, use in URLs (#4573) 2022-10-28 17:41:31 +00:00
2a66395fb7 feat: use app wildcards for apps if configured (#4263)
* feat: use app wildcards for apps if configured

* feat: relative_path -> subdomain

- rename relative_path -> subdomain when referring to apps
    - migrate workspace_apps.relative_path to workspace_apps.subdomain
- upgrade coder/coder terraform module to 0.5.0
2022-10-05 19:23:01 +00:00
4c8be34d81 feat: add health check monitoring to workspace apps (#4114) 2022-09-23 15:51:04 -04:00
214e59452f feat: Show custom resource icons in the UI (#4020) 2022-09-13 11:32:59 -03:00
8a94b72c7d feat: Allow hide resources (#3977) 2022-09-09 16:38:00 -03:00
303b280e0e fix: Associate spot instances with their instance IDs for auth (#3383)
Fixes #2162.
2022-08-04 10:20:56 -05:00
69664ed168 fix: Use "virtual_machine_id" for instance identity with Azure (#3355)
This was using the wrong property, causing automatic auth to break.
2022-08-03 12:19:13 -05:00
8a2811210a feat: Add backend API support for resource metadata (#3242)
* Initial support for metadata in provisioner API and Terraform provisioner

* add support for nullable metadata fields

* handle metadata fields in provisionerd and API
2022-08-01 16:53:05 -05:00