Skip to content

Conversation

@mafredri
Copy link
Member

@mafredri mafredri commented Oct 9, 2025

This change adds workspace build/agent/app linking to tasks and wires it
into wsbuilder and provisionerdserver.

Closes coder/internal#948
Closes #20212
Closes #19773

Copy link
Member Author

mafredri commented Oct 9, 2025

@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split branch from 8b065ed to 293764d Compare October 9, 2025 10:40
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch from 5adbc9d to 30464da Compare October 9, 2025 10:40
@mafredri mafredri marked this pull request as ready for review October 9, 2025 10:43
@mafredri mafredri requested review from dannykopping and johnstcn and removed request for johnstcn October 9, 2025 10:43
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch from 30464da to d3fd9eb Compare October 9, 2025 10:52
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split branch from 293764d to 83a00fb Compare October 9, 2025 10:52
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch 2 times, most recently from acd5dcf to 336477c Compare October 9, 2025 10:58
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split branch from 83a00fb to 281cf6e Compare October 9, 2025 10:58
// the agent to a task. As per previous behavior, this is OK
// because we always overwrite the given protoAgent.Id.
agentID := uuid.New()
protoAgent.Id = makeStaticID(agentID)
Copy link
Member Author

@mafredri mafredri Oct 9, 2025

Choose a reason for hiding this comment

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

Review: This was unfortunately the most compatible way I could think of since InsertWorkspaceResource is called from all over the place, and tests across the code-base. So I wanted to avoid churn by changing the function call. We also needed a way to opt-out of using the provided ID here since many tests start erroring out on duplicate IDs.

Functional options would've been one choice, but for this tiny change it seemed overkill.

Frankly it's a bit weird we have this field but discard it nonetheless.

Copy link
Member

Choose a reason for hiding this comment

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

My worry here is that a future change will use makeStaticID without covering all the possible code paths with staticID(). It should be fairly apparent in tests since a failure to remove the prefix will cause an invalid UUID error. The only other solution I could imagine would involve changing types which would involve more churn. Can you create a follow-up PR for refactoring this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you create a follow-up PR for refactoring this?

What's your proposal for how it would be refactored?

I can also name it makeStaticAgentID if that helps make it clear that it (currently) only has one intended use-case.

Copy link
Member Author

@mafredri mafredri Oct 9, 2025

Choose a reason for hiding this comment

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

Replaced with functional options, see a7e1d10

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM :shipit:

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM :shipit:

Copy link
Member

Choose a reason for hiding this comment

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

I like this much better! Thank you @mafredri !

}
}

if task, err := db.GetTaskByWorkspaceID(ctx, workspace.ID); err == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Review: Previous sidebar app behavior is retained for the time being, we're just improving the task data model in parallel.

Copy link
Contributor

@DanielleMaywood DanielleMaywood left a comment

Choose a reason for hiding this comment

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

I've got no objections (other than what Cian has already raised with makeStaticID), although I'm not familiar enough with either components to feel confident to give the green light

@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split branch from 281cf6e to fff8343 Compare October 9, 2025 12:58
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch from 336477c to f7e0c43 Compare October 9, 2025 12:58
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch from a7e1d10 to e8773e7 Compare October 13, 2025 08:47
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split branch 2 times, most recently from 360fc06 to c790418 Compare October 13, 2025 09:04
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch from e8773e7 to 77ba7ea Compare October 13, 2025 09:04
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split branch 2 times, most recently from ed3b6f4 to df42f86 Compare October 13, 2025 09:26
@mafredri mafredri changed the base branch from mafredri/feat-coderd-tasks-data-model-split4_split_split to graphite-base/20237 October 13, 2025 09:42
This change adds workspace build/agent/app linking to tasks and wires it
into `wsbuilder` and `provisionerdserver`.

Closes coder/internal#948
Closes #20212
Closes #19773
@mafredri mafredri force-pushed the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch from 77ba7ea to 64c8d86 Compare October 13, 2025 09:43
@mafredri mafredri force-pushed the graphite-base/20237 branch from df42f86 to 5dc57da Compare October 13, 2025 09:43
@graphite-app graphite-app bot changed the base branch from graphite-base/20237 to main October 13, 2025 09:43
@graphite-app
Copy link

graphite-app bot commented Oct 13, 2025

Merge activity

  • Oct 13, 9:43 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Oct 13, 9:57 AM UTC: @mafredri merged this pull request with Graphite.

@mafredri mafredri merged commit a8f87c2 into main Oct 13, 2025
31 of 49 checks passed
@mafredri mafredri deleted the mafredri/feat-coderd-tasks-data-model-split4_split_split_split branch October 13, 2025 09:57
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 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.

Tasks API: Design and implement tasks data model in database

4 participants