Skip to content

Conversation

@DanielleMaywood
Copy link
Contributor

@DanielleMaywood DanielleMaywood commented Oct 29, 2025

We recently made a change to the wsbuilder to handle task related logic. Our test coverage for the lifecycle executor didn't handle this scenario and so we missed that it had insufficient permissions.

This PR adds Update and Read permissions for Tasks in the lifecycle executor, as well as an autostart/autostop test tailored to task workspaces to verify the change.


Anthropic's Claude Sonnet 4.5 Thinking was involved in writing the tests

@DanielleMaywood DanielleMaywood force-pushed the danielle/fix/lifecycle-executor branch 2 times, most recently from 4a360c9 to 4ad5bde Compare October 29, 2025 14:05
We recently made a change to the `wsbuilder` to handle task related
logic. Our test coverage for the lifecycle executor didn't handle this
scenario and so we missed the insufficient permissions.

This PR adds `Update` and `Read` permissions for `Task`s in the
lifecycle executor, as well as an autostart/autostop test tailored to
task workspaces to verify the change.
@DanielleMaywood DanielleMaywood force-pushed the danielle/fix/lifecycle-executor branch from 4ad5bde to 6cb618c Compare October 29, 2025 14:17
@DanielleMaywood DanielleMaywood marked this pull request as ready for review October 29, 2025 14:59
@DanielleMaywood DanielleMaywood added the cherry-pick/v2.28 Needs to be cherry-picked to the 2.28 release branch label Oct 29, 2025
func TestExecutorTaskWorkspace(t *testing.T) {
t.Parallel()

createTaskTemplate := func(t *testing.T, client *codersdk.Client, orgID uuid.UUID, ctx context.Context, defaultTTL time.Duration) codersdk.Template {
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 avoid duplication here? I'm fine to defer cleanup to later though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What thoughts do you have here? Is this related to how many similar test utilities we have for creating task templates?

Copy link
Member

Choose a reason for hiding this comment

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

Yup, similar test setups, but let's defer 👍🏻

@DanielleMaywood DanielleMaywood merged commit 06dbada into main Oct 29, 2025
34 checks passed
@DanielleMaywood DanielleMaywood deleted the danielle/fix/lifecycle-executor branch October 29, 2025 15:44
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cherry-pick/v2.28 Needs to be cherry-picked to the 2.28 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants