Skip to content

ILLDEV-316 primaryAction#499

Merged
adamdickmeiss merged 5 commits intomainfrom
ILLDEV-316-primary-action
Mar 31, 2026
Merged

ILLDEV-316 primaryAction#499
adamdickmeiss merged 5 commits intomainfrom
ILLDEV-316-primary-action

Conversation

@adamdickmeiss
Copy link
Copy Markdown
Contributor

https://index-data.atlassian.net/browse/ILLDEV-316

After discussing with @skomorokh we changed to a property primaryAction speciifes exactly one action.

@adamdickmeiss adamdickmeiss requested a review from jakub-id as a code owner March 30, 2026 14:18
Copilot AI review requested due to automatic review settings March 30, 2026 14:18
Copy link
Copy Markdown
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

Adds a primaryAction field to the patron-request state model so each state can declare a single “recommended/primary” action, and enforces that the value corresponds to one of the state’s defined actions.

Changes:

  • Extend the state model schema/OpenAPI spec with primaryAction.
  • Populate primaryAction across the built-in “returnables” state model (YAML + embedded JSON).
  • Add server-side validation + unit tests to ensure primaryAction references an action defined in the same state.

Reviewed changes

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

Show a summary per file
File Description
misc/state-model.json Adds primaryAction to the JSON schema for state models.
misc/returnables.yaml Sets primaryAction for applicable states in the returnables workflow definition.
broker/patron_request/service/statemodels/returnables.json Mirrors primaryAction into the embedded built-in returnables JSON model.
broker/patron_request/service/statemodel_test.go Adds tests covering primaryAction validation behavior.
broker/patron_request/service/statemodel.go Validates that primaryAction, if set, matches one of the state’s actions.
broker/oapi/open-api.yaml Documents primaryAction in the OpenAPI schema.

@adamdickmeiss adamdickmeiss requested a review from skomorokh March 30, 2026 14:34
Copy link
Copy Markdown
Contributor

@skomorokh skomorokh left a comment

Choose a reason for hiding this comment

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

Looks good. I thought maybe we'd want to just not have a primary action for the approve/reject condition actions but actually mod-rs makes approve primary too so this is consistent.

Maybe it'd be good to add a test where a state has no primary action?

@adamdickmeiss adamdickmeiss merged commit c8731e1 into main Mar 31, 2026
5 checks passed
@adamdickmeiss adamdickmeiss deleted the ILLDEV-316-primary-action branch March 31, 2026 08:16
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.

4 participants