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

fix: derive running ws stop time from deadline#1920

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

Conversation

greyscaled
Copy link
Contributor

Summary:

When a workspace is on, the remaining time until shutdown needs to be
derived from the deadline timestamp, not implied from the TTL. A utility is
function is added that answers the question if a workspace is on.

Impact:

This is a shared piece of logic in workspace scheduling presentations.
In particular it unblocks work in 1779, or at least allows an
implementation that shares details with the WorkspaceScheduleBanner.

Notes:

We could possibly instead return whether the workspace is "ON",
"UNKNOWN", or "OFF". Maybe a future improvement for that could be made
as the neds arrises.

Summary:A utility is function is added that answers the question if a workspaceis on.Impact:This is a shared piece of logic in workspace scheduling presentations.In particular it unblocks work in 1779, or at least allows animplementation that shares details with the WorkspaceScheduleBanner.Notes:We could possibly instead return whether the workspace is "ON","UNKNOWN", or "OFF". Maybe a future improvement for that could be madeas the neds arrises.
Summary:When a workspace is on, the remaining time until shutdown needs to bederived from the deadline timestamp, not implied from the TTL
@greyscaledgreyscaled requested a review fromjohnstcnMay 31, 2022 15:11
@greyscaledgreyscaled requested a review froma team as acode ownerMay 31, 2022 15:11
@greyscaledgreyscaled self-assigned thisMay 31, 2022
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

BE ✔️

Comment on lines +8 to +27
["delete", "canceled", false],
["delete", "canceling", false],
["delete", "failed", false],
["delete", "pending", false],
["delete", "running", false],
["delete", "succeeded", false],

["stop", "canceled", false],
["stop", "canceling", false],
["stop", "failed", false],
["stop", "pending", false],
["stop", "running", false],
["stop", "succeeded", false],

["start", "canceled", false],
["start", "canceling", false],
["start", "failed", false],
["start", "pending", false],
["start", "running", false],
["start", "succeeded", true],
Copy link
Member

Choose a reason for hiding this comment

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

💝

greyscaled reacted with heart emoji
Comment on lines +189 to +193
export const isWorkspaceOn = (workspace: Workspace): boolean => {
const transition = workspace.latest_build.transition
const status = workspace.latest_build.job.status
return transition === "start" && status === "succeeded"
}
Copy link
Member

Choose a reason for hiding this comment

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

👍 it's a narrow definition of 'on' but I think that's the correct one.

greyscaled reacted with thumbs up emoji
@greyscaledgreyscaled merged commit56ec53d intomainMay 31, 2022
@greyscaledgreyscaled deleted the vapurrmaid/gh-1779/workspace-shutdown-display branchMay 31, 2022 19:50
@greyscaled
Copy link
ContributorAuthor

This resolved#1779

kylecarbs pushed a commit that referenced this pull requestJun 10, 2022
* refactor: isWorkspaceOn utilitySummary:A utility is function is added that answers the question if a workspaceis on.Impact:This is a shared piece of logic in workspace scheduling presentations.In particular it unblocks work in 1779, or at least allows animplementation that shares details with the WorkspaceScheduleBanner.Notes:We could possibly instead return whether the workspace is "ON","UNKNOWN", or "OFF". Maybe a future improvement for that could be madeas the neds arrises.* fix: derive running ws stop time from deadlineSummary:When a workspace is on, the remaining time until shutdown needs to bederived from the deadline timestamp, not implied from the TTL
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@greyscaledgreyscaled

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@greyscaled@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp