Skip to content

CROSSLINK-232 modify action result#485

Open
adamdickmeiss wants to merge 9 commits intomainfrom
CROSSLINK-232-modify-action-result
Open

CROSSLINK-232 modify action result#485
adamdickmeiss wants to merge 9 commits intomainfrom
CROSSLINK-232-modify-action-result

Conversation

@adamdickmeiss
Copy link
Contributor

@adamdickmeiss adamdickmeiss commented Mar 25, 2026

@adamdickmeiss adamdickmeiss requested a review from jakub-id as a code owner March 25, 2026 15:52
Copilot AI review requested due to automatic review settings March 25, 2026 15:52
@adamdickmeiss adamdickmeiss changed the title Crosslink 232 modify action result CROSSLINK-232 modify action result Mar 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the patron-request “execute action” response to return a richer structured result (status + outcome + from/to state), wiring that data through the action service/event result and updating the OpenAPI contract and tests accordingly.

Changes:

  • Expand action task ResultData to carry outcome and toState, and populate them during action finalization.
  • Update POST /patron-requests/{id}/action to return the new ActionResult shape (including fromState/toState).
  • Adjust OpenAPI schema and update tests to unmarshal and assert the structured response.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
broker/test/patron_request/api/api-handler_test.go Updates API tests to validate the expanded ActionResult JSON response.
broker/patron_request/service/action_test.go Updates service tests to expect non-nil action result data.
broker/patron_request/service/action.go Adds outcome/toState propagation and refactors outcome handling into EventResult.
broker/patron_request/api/api-handler.go Returns expanded ActionResult fields (result/message/outcome/fromState/toState).
broker/oapi/open-api.yaml Updates the ActionResult schema (renames field, adds required fields).
broker/events/eventmodels.go Adds Outcome and ToState to shared event data/result payloads.

Comment on lines 531 to +552
ActionResult:
type: object
properties:
actionResult:
result:
type: string
description: Action result
message:
type: string
description: Action message
outcome:
type: string
description: Action outcome ("success", "failure")
fromState:
type: string
description: State before action execution
toState:
type: string
description: State after action execution
required:
- actionResult
- result
- outcome
- fromState
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming the response field from actionResult to result is a breaking API change for any existing clients. If backward compatibility is required, consider supporting both fields during a deprecation window (or bumping an API version) rather than changing the property name in-place.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamdickmeiss how is bruno test not failing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not tested

@adamdickmeiss adamdickmeiss requested a review from jakub-id March 25, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants