Skip to content

Conversation

@DanielleMaywood
Copy link
Contributor

As discussed, we want to enable a way for consumers to know if their template is being provisioned as a task or not. We know that CODER_TASK_ID is set by the provisioner, it is being provisioned as a task, and not as a usual workspace. We use this knowledge to set a computed field enabled to reflect this.

@DanielleMaywood DanielleMaywood force-pushed the danielle/tasks/enabled-field branch 2 times, most recently from 1accf42 to 90633db Compare October 31, 2025 10:44
@DanielleMaywood DanielleMaywood marked this pull request as ready for review October 31, 2025 10:49
@DanielleMaywood DanielleMaywood marked this pull request as draft October 31, 2025 10:49
As discussed, we want to enable a way for consumers to know if their
template is being provisioned as a task or not. We know that
`CODER_TASK_ID` is set by the provisioner, it is being provisioned as
a task, and not as a usual workspace. We use this knowledge to set
a computed field `enabled` to reflect this.

fix: tests

fix: maybe fix?

does this fix it?
@DanielleMaywood DanielleMaywood force-pushed the danielle/tasks/enabled-field branch from 90633db to 9b25602 Compare October 31, 2025 10:52
@DanielleMaywood DanielleMaywood marked this pull request as ready for review October 31, 2025 11:02
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Probably fine, but I wonder if template building can be affected by this. At least when doing template build I imagine this value will always be false, and if including something is included conditionally, will that delay validation of certain things until workspace/task build?

Perhaps templates need a "build as task" mode to properly test writing them.

@DanielleMaywood DanielleMaywood merged commit 1211f28 into main Oct 31, 2025
6 checks passed
@DanielleMaywood DanielleMaywood deleted the danielle/tasks/enabled-field branch October 31, 2025 11:32
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants