- Notifications
You must be signed in to change notification settings - Fork1.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
0b429f9 to2021127Compare| 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 theparameters: { queries: { flow. SeeLongDisplayName 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
Uh oh!
There was an error while loading.Please reload this page.
| props, | ||
| )=>{ | ||
| exportconstWorkspaceOutdatedTooltip:FC< | ||
| PropsWithChildren<WorkspaceOutdatedTooltipProps> |
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.
don't usePropsWithChildren like this pls, prefer just adding achildren?: ReactNode; property to the props type.
it keeps all of the props in one place. if someone doesn't notice this extra type in the middle here then it could be confusing.
Uh oh!
There was an error while loading.Please reload this page.
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.