Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add coder_task data source#460

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 6 commits intomainfromcj/coder_ai_task_prompt_datasource
Nov 4, 2025

Conversation

@johnstcn
Copy link
Member

@johnstcnjohnstcn commentedNov 3, 2025
edited
Loading

Terraform will tolerate a certain amount of self-reference, but this changes when usingcount.

For example, the below is accepted

resource"coder_ai_task""task" {app_id=module.agent.task_app_id}module"agent" {source="..."prompt=coder_ai_task.task.prompt}

Whereas this outputs a cycle error:

data"coder_workspace""me" {}resource"coder_ai_task""task" {count=data.coder_workspace.me.start_countapp_id=module.agent[count.index].task_app_id}module"agent" {count=data.coder_workspace.me.start_countsource="..."prompt=coder_ai_task.task[count.index].prompt}

After some cursory searching, I didn't find much more information on this apart fromthis post.

Adding a data source is not too big a deal as the required environment variables are already present.

With this additional data source, the above example becomes:

data"coder_workspace""me" {}data"coder_task""me" {}resource"coder_ai_task""task" {count=data.coder_workspace.me.start_countapp_id=module.agent[count.index].task_app_id}module"agent" {count=data.coder_workspace.me.start_countsource="..."prompt=data.coder_task.me.prompt}

NB: I explicitly named thiscoder_task to sidestepthis check in Coder. I'm open to alternative names, but it can't becoder_ai_task.

Seecoder/coder#20416 for what this looks like in practice.

@johnstcnjohnstcn changed the titlefeat: add coder_ai_task_prompt data sourcefeat: add coder_task data sourceNov 4, 2025
Comment on lines +134 to +137
namestring
cronExprstring
expectWarningsbool
expectErrorsbool
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

drive-bygo fmt

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Small suggestions but otherwise 👍🏻

"id": {
Type:schema.TypeString,
Computed:true,
Description:"The UUID of the task, if executing in a Coder Task context. Empty in a Coder Workspace context.",
Copy link
Member

Choose a reason for hiding this comment

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

Should we set optional true, is that possible for computed?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I don't think we should according to the documentation forComputed:

If Required and Optional are both false, the attribute will be considered "read only" for the practitioner, with only the provider able to set its value.

Copy link
Member

Choose a reason for hiding this comment

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

Ah TIL, I had assumed computed already meant read-only.

@johnstcnjohnstcn merged commit5fe8d85 intomainNov 4, 2025
6 checks passed
@johnstcnjohnstcn deleted the cj/coder_ai_task_prompt_datasource branchNovember 4, 2025 10:20
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

@DanielleMaywoodDanielleMaywoodAwaiting requested review from DanielleMaywood

Assignees

@johnstcnjohnstcn

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@johnstcn@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp