Skip to content

CROSSLINK-307 manual terminate uses closingAction - #715

Merged
adamdickmeiss merged 5 commits into
mainfrom
CROSSLINK-307-use-closing-action
Aug 19, 2026
Merged

CROSSLINK-307 manual terminate uses closingAction#715
adamdickmeiss merged 5 commits into
mainfrom
CROSSLINK-307-use-closing-action

Conversation

@adamdickmeiss

Copy link
Copy Markdown
Contributor

Copilot AI lite review requested due to automatic review settings August 17, 2026 11:14
@adamdickmeiss
adamdickmeiss marked this pull request as draft August 17, 2026 11:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 prefer GetClosingAction(pr).
  • Adds a local-close fallback helper (closeLocally) and ensures fallback closures record LastAction as terminate.
  • 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.

Comment thread broker/patron_request/service/action.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 IsTransitionAction returns false when the closing action is unsupported for the current state (see ActionMapping.IsTransitionAction), so an invalid/misconfigured closingAction would incorrectly be reported as an LMS configuration issue. Consider checking IsActionSupported first and emitting an accurate message without calling executeAction (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

@adamdickmeiss
adamdickmeiss marked this pull request as ready for review August 17, 2026 13:27
Comment thread broker/patron_request/service/action.go
Comment thread broker/patron_request/service/action.go
@adamdickmeiss
adamdickmeiss requested a review from jakub-id August 18, 2026 08:29
@adamdickmeiss
adamdickmeiss merged commit 6837833 into main Aug 19, 2026
6 of 7 checks passed
@adamdickmeiss
adamdickmeiss deleted the CROSSLINK-307-use-closing-action branch August 19, 2026 09:54
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