Skip to content

Tasks: Lifecycle executor uses task_auto_pause reason #1252

Closed

Description

@mafredri

Repo: coder/coder

Scope: Modify lifecycle executor to use task-specific build reason when auto-stopping task workspaces.

Changes:

  • Modify getNextTransition() in coderd/autobuild/lifecycle_executor.go
  • Check if workspace has an associated task (join already present in query)
  • Return database.BuildReasonTaskAutoPause instead of database.BuildReasonAutostop when eligible for autostop and workspace has a task
  • Similar check needed for isEligibleForFailedStop (failed task workspaces should use task_auto_pause)

Files:

  • coderd/autobuild/lifecycle_executor.go
  • coderd/autobuild/lifecycle_executor_test.go

Acceptance criteria:

  • Task workspaces stopped by lifecycle executor use task_auto_pause reason
  • Regular workspaces continue using autostop reason
  • Failed task workspaces use task_auto_pause when stopped
  • Tests verify reason selection based on task presence

Dependencies:

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions