CROSSLINK-307 manual terminate uses closingAction - #715
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Patron Request action workflow so that a manual terminate first attempts the state model’s configured closingAction (e.g., close-request / cannot-supply) and only falls back to a local manual close when the closing action does not succeed. This aligns manual termination behavior with the state-model-defined close semantics.
Changes:
- Refactors action execution by extracting shared logic into
executeAction, and updates terminate handling to preferGetClosingAction(pr). - Adds a local-close fallback helper (
closeLocally) and ensures fallback closures recordLastActionasterminate. - Updates/extends unit tests to verify closing-action usage and fallback behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| broker/patron_request/service/action.go | Routes terminate through the state model’s closingAction when possible; adds executeAction and a local-close fallback path. |
| broker/patron_request/service/action_test.go | Updates terminate tests and adds coverage for successful closing-action use and fallback scenarios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
broker/patron_request/service/action.go:196
- The "LMS creator not configured" fallback message can be misleading because
IsTransitionActionreturnsfalsewhen the closing action is unsupported for the current state (seeActionMapping.IsTransitionAction), so an invalid/misconfiguredclosingActionwould incorrectly be reported as an LMS configuration issue. Consider checkingIsActionSupportedfirst and emitting an accurate message without callingexecuteAction(to keep the no-log behavior).
// If the configured closing action requires LMS integration and we don't have it,
// fall back directly to local close instead of logging an error.
if !actionMapping.IsTransitionAction(pr, *closingAction) && a.lmsCreator == nil {
message := fmt.Sprintf("closing action %s could not be executed: LMS creator not configured", *closingAction)
closingActionError = &message
https://index-data.atlassian.net/browse/CROSSLINK-307