-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(site): allow updating workspace in TaskPage #21316
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
Conversation
0b429f9 to
2021127
Compare
| 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([]); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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.
Note: I made a change to the
WorkspaceOutdatedTooltipcomponents to allow it to have children so that the tooltip could trigger over a wider element instead of just the info icon.