Skip to content

Commit 6fe07ab

Browse files
remove unneeded ReportInvocationErrorResponse, just respond with 204
1 parent 668a7dc commit 6fe07ab

5 files changed

Lines changed: 10 additions & 31 deletions

File tree

client/src/api/schema/schema.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17945,14 +17945,6 @@ export interface components {
1794517945
*/
1794617946
message?: string | null;
1794717947
};
17948-
/** ReportInvocationErrorResponse */
17949-
ReportInvocationErrorResponse: {
17950-
/**
17951-
* Invocation error report response
17952-
* @description The messages returned for the state of the invocation error report.
17953-
*/
17954-
messages: string[][];
17955-
};
1795617948
/** ReportJobErrorPayload */
1795717949
ReportJobErrorPayload: {
1795817950
/**
@@ -30768,13 +30760,11 @@ export interface operations {
3076830760
};
3076930761
responses: {
3077030762
/** @description Successful Response */
30771-
200: {
30763+
204: {
3077230764
headers: {
3077330765
[name: string]: unknown;
3077430766
};
30775-
content: {
30776-
"application/json": components["schemas"]["ReportInvocationErrorResponse"];
30777-
};
30767+
content?: never;
3077830768
};
3077930769
/** @description Request Error */
3078030770
"4XX": {

client/src/components/WorkflowInvocationState/WorkflowInvocationFeedback.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const stepsWithErrors = computed(() => {
5454
});
5555
5656
async function submit(message: string): Promise<string[][] | undefined> {
57-
const { data, error } = await GalaxyApi().POST("/api/invocations/{invocation_id}/error", {
57+
const { error } = await GalaxyApi().POST("/api/invocations/{invocation_id}/error", {
5858
params: {
5959
path: { invocation_id: props.invocation.id },
6060
},
@@ -70,7 +70,7 @@ async function submit(message: string): Promise<string[][] | undefined> {
7070
return [[errorMessageAsString(error), "danger"]];
7171
}
7272
73-
return data.messages;
73+
return [["Your email has been sent successfully. Thank you for your report.", "success"]];
7474
}
7575
</script>
7676

lib/galaxy/schema/invocation.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,6 @@ class InvocationReport(Model, WithModelClass):
508508
)
509509

510510

511-
class ReportInvocationErrorResponse(Model):
512-
# messages: List[Union[Tuple[str, str], List[str]]]
513-
messages: List[List[str]] = Field(
514-
default=...,
515-
title="Invocation error report response",
516-
description="The messages returned for the state of the invocation error report.",
517-
)
518-
519-
520511
class ReportInvocationErrorPayload(Model):
521512
invocation_id: DecodedDatabaseIdField = Field(
522513
default=...,

lib/galaxy/webapps/galaxy/api/workflows.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
InvocationStepJobsResponseStepModel,
6565
InvocationUpdatePayload,
6666
ReportInvocationErrorPayload,
67-
ReportInvocationErrorResponse,
6867
WorkflowInvocationRequestModel,
6968
WorkflowInvocationResponse,
7069
)
@@ -1453,19 +1452,20 @@ def write_store(
14531452
@router.post(
14541453
"/api/invocations/{invocation_id}/error",
14551454
summary="Submits a bug report for a workflow run via the API.",
1455+
status_code=status.HTTP_204_NO_CONTENT,
14561456
)
14571457
def report_error(
14581458
self,
14591459
payload: ReportInvocationErrorPayload,
14601460
invocation_id: InvocationIDPathParam,
14611461
trans: ProvidesUserContext = DependsOnTrans,
1462-
) -> ReportInvocationErrorResponse:
1463-
rval = self.invocations_service.report_error(
1462+
):
1463+
self.invocations_service.report_error(
14641464
trans,
14651465
invocation_id,
14661466
payload,
14671467
)
1468-
return rval
1468+
return Response(status_code=status.HTTP_204_NO_CONTENT)
14691469

14701470
@router.get("/api/invocations/{invocation_id}", summary="Get detailed description of a workflow invocation.")
14711471
def show_invocation(

lib/galaxy/webapps/galaxy/services/invocations.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
InvocationSerializationView,
4545
InvocationStep,
4646
ReportInvocationErrorPayload,
47-
ReportInvocationErrorResponse,
4847
WorkflowInvocationRequestModel,
4948
WorkflowInvocationResponse,
5049
)
@@ -256,22 +255,21 @@ def write_store(
256255

257256
def report_error(
258257
self, trans: ProvidesUserContext, invocation_id: DecodedDatabaseIdField, payload: ReportInvocationErrorPayload
259-
) -> ReportInvocationErrorResponse:
258+
):
260259
workflow_invocation = self._workflows_manager.get_invocation(
261260
trans, invocation_id, eager=True, check_ownership=False, check_accessible=True
262261
)
263262
email = payload.email
264263
if not email and not trans.anonymous:
265264
email = trans.user.email
266-
messages = trans.app.error_reports.default_error_plugin.submit_invocation_report(
265+
trans.app.error_reports.default_error_plugin.submit_invocation_report(
267266
invocation=workflow_invocation,
268267
user_submission=True,
269268
user=trans.user,
270269
email=email,
271270
message=payload.message,
272271
trans=trans,
273272
)
274-
return ReportInvocationErrorResponse(messages=messages)
275273

276274
def serialize_workflow_invocation(
277275
self,

0 commit comments

Comments
 (0)