Skip to content

Add status to workspace.latest_build #1718

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
presleyp opened this issue May 24, 2022 · 2 comments
Closed

Add status to workspace.latest_build #1718

presleyp opened this issue May 24, 2022 · 2 comments
Labels
api Area: HTTP API

Comments

@presleyp
Copy link
Contributor

presleyp commented May 24, 2022

As a developer, I don't want to have to duplicate code between the UI and CLI, so I want the backend to provide derived values in the API. One such derivation is from the combination of a WorkspaceBuild's transition (to be renamed "action") and its job's status into the current status of the workspace.

Here is the desired mapping from job status to workspace status:

pending: [transition]ing (starting, stopping, or deleting)
running: [transition]ing (starting, stopping, or deleting)
succeeded: [transition]ed (started, stopped, deleted)
failed: failed
canceling: canceling
canceled: canceled

This workspace status should be provided in a status field on a WorkspaceBuild so that it's accessible on workspace.latest_build.status.

The frontend will massage the workspace status a little bit further to make the terms more user-friendly (such as started -> Running, canceling -> Canceling Action), but this will keep the logic that depends on implementation details on the backend.

Note that the frontend will still use the job's status directly in the timeline when #1677 is implemented.

@BrunoQuaresma
Copy link
Collaborator

@presleyp is it done?

@presleyp
Copy link
Contributor Author

presleyp commented Sep 7, 2022

I don't think so. @f0ssel is this still desired?

@bpmct bpmct closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

No branches or pull requests

5 participants