Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ba41ae8
add support for canceling workspace builds with expect_state param (l…
kacpersaw Jul 1, 2025
c4ee5b6
Use single transaction for canceling workspace build
kacpersaw Jul 2, 2025
c49c33e
Fix lint problem in ut
kacpersaw Jul 2, 2025
ba1dbf3
add cancel confirmation dialog for workspace builds and add expect_st…
kacpersaw Jul 2, 2025
acffda6
Fix lint
kacpersaw Jul 2, 2025
b672d76
Merge branch 'main' into kacpersaw/cancel-pending-provisioner-jobs
kacpersaw Jul 2, 2025
86a34df
Apply review suggestions
kacpersaw Jul 3, 2025
42170ab
Fix unit test
kacpersaw Jul 3, 2025
5db9d71
Apply review suggestions
kacpersaw Jul 3, 2025
1ede20c
Fix typo
kacpersaw Jul 3, 2025
2597615
Regenerate api types
kacpersaw Jul 3, 2025
6c2d0cf
Fix typo
kacpersaw Jul 3, 2025
c800494
Merge branch 'main' into kacpersaw/cancel-pending-provisioner-jobs
kacpersaw Jul 3, 2025
c5cb203
Apply a new authorization check for GetProvisionerJobByIDForUpdate
kacpersaw Jul 6, 2025
1de84cc
Apply a new authorization check for GetProvisionerJobByIDForUpdate
kacpersaw Jul 6, 2025
17fb6a3
Apply FE review suggestions
kacpersaw Jul 6, 2025
1b7b614
Apply review suggestions
kacpersaw Jul 7, 2025
634f556
Refactor cancelWorkspaceBuild parameter handling
kacpersaw Jul 7, 2025
4deace0
Fix lint
kacpersaw Jul 7, 2025
43430fa
Update coderd/workspacebuilds.go
kacpersaw Jul 7, 2025
6272d93
Extract cancel confirm dialog to a separate component
kacpersaw Jul 7, 2025
4d4a01d
Merge branch 'main' into kacpersaw/cancel-pending-provisioner-jobs
kacpersaw Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply FE review suggestions
  • Loading branch information
kacpersaw committed Jul 6, 2025
commit 17fb6a3b1a5b156adb379f1cf0eeb0f380adb411
9 changes: 3 additions & 6 deletions site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1277,14 +1277,11 @@ class ApiMethods {

cancelWorkspaceBuild = async (
workspaceBuildId: TypesGen.WorkspaceBuild["id"],
request?: TypesGen.CancelWorkspaceBuildParams,
params?: TypesGen.CancelWorkspaceBuildParams,
): Promise<TypesGen.Response> => {
const params = request?.expect_status
? new URLSearchParams({ expect_status: request.expect_status }).toString()
: "";

const queryParams = new URLSearchParams({ ...params });
const response = await this.axios.patch(
`/api/v2/workspacebuilds/${workspaceBuildId}/cancel${params ? `?${params}` : ""}`,
`/api/v2/workspacebuilds/${workspaceBuildId}/cancel${queryParams}`,
);

return response.data;
Expand Down
1 change: 0 additions & 1 deletion site/src/api/queries/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ export const startWorkspace = (
export const cancelBuild = (workspace: Workspace, queryClient: QueryClient) => {
return {
mutationFn: () => {
// If workspace status is pending, include expect_status parameter
if (workspace.latest_build.status === "pending") {
return API.cancelWorkspaceBuild(workspace.latest_build.id, {
expect_status: "pending",
Expand Down
1 change: 0 additions & 1 deletion site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ export const WorkspaceReadyPage: FC<WorkspaceReadyPageProps> = ({
}
/>

{/* Cancel confirmation dialog */}
<ConfirmDialog
open={isCancelConfirmOpen}
title="Cancel workspace build"
Expand Down
2 changes: 0 additions & 2 deletions site/src/pages/WorkspacesPage/WorkspacesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,7 @@ const WorkspaceActionsCell: FC<WorkspaceActionsCellProps> = ({
onError: onActionError,
});

// State for stop confirmation dialog
const [isStopConfirmOpen, setIsStopConfirmOpen] = useState(false);
// State for cancel confirmation dialog
const [isCancelConfirmOpen, setIsCancelConfirmOpen] = useState(false);

const isRetrying =
Expand Down
Loading