forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jobs: add button to request execution details
This is the last of the three PRs to add support for requesting, viewing and downloading execution details from the job details page. This change wires up the logic needed to request the execution details for a given job. The request is powered by the crdb_internal.request_job_execution_details builtin that triggers the collection of execution details. Fixes: cockroachdb#105076 Release note: None
- Loading branch information
1 parent
566f3cb
commit f23c468
Showing
10 changed files
with
180 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2023 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import { Action } from "redux"; | ||
import { PayloadAction } from "src/interfaces/action"; | ||
import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; | ||
|
||
export const COLLECT_EXECUTION_DETAILS = | ||
"cockroachui/jobs/COLLECT_EXECUTION_DETAILS"; | ||
export const COLLECT_EXECUTION_DETAILS_COMPLETE = | ||
"cockroachui/jobs/COLLECT_EXECUTION_DETAILS_COMPLETE"; | ||
export const COLLECT_EXECUTION_DETAILS_FAILED = | ||
"cockroachui/jobs/COLLECT_EXECUTION_DETAILS_FAILED"; | ||
|
||
export function collectExecutionDetailsAction( | ||
collectExecutionDetailsRequest: clusterUiApi.CollectExecutionDetailsRequest, | ||
): PayloadAction<clusterUiApi.CollectExecutionDetailsRequest> { | ||
return { | ||
type: COLLECT_EXECUTION_DETAILS, | ||
payload: collectExecutionDetailsRequest, | ||
}; | ||
} | ||
|
||
export function collectExecutionDetailsCompleteAction(): Action { | ||
return { | ||
type: COLLECT_EXECUTION_DETAILS_COMPLETE, | ||
}; | ||
} | ||
|
||
export function collectExecutionDetailsFailedAction(): Action { | ||
return { | ||
type: COLLECT_EXECUTION_DETAILS_FAILED, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2023 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import { PayloadAction } from "@reduxjs/toolkit"; | ||
import { refreshListExecutionDetailFiles } from "oss/src/redux/apiReducers"; | ||
import { all, call, put, takeEvery } from "redux-saga/effects"; | ||
import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; | ||
import { | ||
COLLECT_EXECUTION_DETAILS, | ||
collectExecutionDetailsCompleteAction, | ||
collectExecutionDetailsFailedAction, | ||
} from "./jobsActions"; | ||
|
||
export function* collectExecutionDetailsSaga( | ||
action: PayloadAction<clusterUiApi.CollectExecutionDetailsRequest>, | ||
) { | ||
try { | ||
yield call(clusterUiApi.collectExecutionDetails, action.payload); | ||
yield put(collectExecutionDetailsCompleteAction()); | ||
yield put(refreshListExecutionDetailFiles() as any); | ||
} catch (e) { | ||
yield put(collectExecutionDetailsFailedAction()); | ||
} | ||
} | ||
|
||
export function* jobsSaga() { | ||
yield all([ | ||
takeEvery(COLLECT_EXECUTION_DETAILS, collectExecutionDetailsSaga), | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters