Skip to content

chore(docs): update documentation for coder_workspace_tags #15620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Conversation

johnstcn
Copy link
Member

Adds documentation relating to #15087 and #15427

See also: #15578

@johnstcn johnstcn self-assigned this Nov 21, 2024
@johnstcn johnstcn requested a review from matifali November 25, 2024 10:19
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few commnents but looks good to me.


- You will need to have an [external provisioner](https://coder.com/docs/admin/provisioners#external-provisioners) with the correct tagset running in order to import this template.
- When specifying values for the `coder_workspace_tags` data source, you are restricted to using a subset of Terraform's capabilities.
- You must specify default values for all data sources and variables referenced by the `coder_workspace_tags` data source.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we exposing an explicit error if this is not the case to inform the user on what they can do to fix it. Think about it in context of #15447 .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below comment, but TL;DR yes.

Comment on lines +98 to 104
You may only specify the following as inputs for `coder_workspace_tags`:

| | Example |
| :----------------- | :-------------------------------------------- |
| Static values | `"developers"` |
| Template variables | `var.az` |
| Coder parameters | `data.coder_parameter.runtime_selector.value` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the value of the coder_parameter can itself come from any other local, resource, or data. Right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the default must be specified in the coder_parameter data source. I'll make this more explicit.

Comment on lines +67 to +68
All template variables and `coder_parameter` data sources **must** provide a
default value. Failure to do so will result in an error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be sure that the error is explicit and inform the user on how to fix it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some UI improvements to be made, but here are the main messages:

I'd rather not over-index on documenting package-level errors in documentation, but I can document these if you think it's necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed in docs but with UI enhancements but if we can parse them and show to the user that would do the work.
cc: @chrifro consider this in context of #15447.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should end up in the API response returned by the backend, so all the FE needs to do is display it to the user 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should create an issue in coder/internal to track adding terraform errors to API response.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but this might already be in the scope of #15447

Your call though!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ✅

@johnstcn johnstcn merged commit e550365 into main Nov 25, 2024
29 checks passed
@johnstcn johnstcn deleted the cj/15087-docs branch November 25, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants