Skip to content

Conversation

@johnstcn
Copy link
Member

@johnstcn johnstcn commented Dec 18, 2025

Relates to #20925

This PR modifies TaskPage to update an outdated workspace instead of starting it. Before, starting an outdated workspace where the template required the active version would fail with the error "cannot use non-active version: rbac: forbidden".

For the case of a dormant workspace, I deemed it safe enough to simply unset dormancy on an attempted start (ref: #21306). However, automatically updating a workspace is a more risky option, so I instead elected to give the user the option of updating their workspace using the existing tooltip.

Screenshot 2025-12-18 at 13 52 15 Screenshot 2025-12-18 at 13 52 29

Note: I made a change to the WorkspaceOutdatedTooltip components to allow it to have children so that the tooltip could trigger over a wider element instead of just the info icon.

<🤖 AI Disclaimer>I got some help from Gemini 3 Flash in "Ask" mode.</🤖 AI Disclaimer>

@johnstcn johnstcn self-assigned this Dec 18, 2025
@johnstcn johnstcn changed the title fix(site): TaskPage: allow updating workspace in TaskPage fix(site): TaskPage: allow updating workspace Dec 18, 2025
@johnstcn johnstcn changed the title fix(site): TaskPage: allow updating workspace fix(site): allow updating workspace in TaskPage Dec 18, 2025
Comment on lines 410 to 420
spyOn(API, "getTask").mockResolvedValue(MockTask);
spyOn(API, "getWorkspaceByOwnerAndName").mockResolvedValue({
...MockStoppedWorkspace,
outdated: true,
});
spyOn(API, "getTemplate").mockResolvedValue({
...MockTemplate,
active_version_id: "some-other-version-id",
});
spyOn(API, "getTemplateVersionRichParameters").mockResolvedValue([]);
spyOn(API, "getWorkspaceBuildParameters").mockResolvedValue([]);
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be replaced with the parameters: { queries: { flow. See LongDisplayName for reference

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. This has the slightly annoying side-effect of queries happening after 5 seconds though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think we need to schedule some time with the front end folk to address that

@johnstcn johnstcn merged commit 1de952b into main Dec 19, 2025
31 checks passed
@johnstcn johnstcn deleted the cj/gh20925/task-start-latest-version branch December 19, 2025 11:33
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 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.

4 participants