Skip to content

ILLDEV-312 Add terminal state flag#501

Merged
JanisSaldabols merged 3 commits intomainfrom
LLDEV-312
Mar 31, 2026
Merged

ILLDEV-312 Add terminal state flag#501
JanisSaldabols merged 3 commits intomainfrom
LLDEV-312

Conversation

@JanisSaldabols
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 31, 2026 06:30
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 persisted “terminal state” flag to patron requests, driven by the state model’s terminal marker and exposed through the API (and intended for CQL filtering).

Changes:

  • Adds terminal_state to the patron_request table (sqlc schema + DB migration) and exposes it via OpenAPI.
  • Extends state-model action mapping to recognize terminal states and sets TerminalState during state transitions.
  • Updates API/test code to include/assert the new terminalState field.

Reviewed changes

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

Show a summary per file
File Description
broker/sqlc/pr_schema.sql Adds terminal_state to sqlc schema for patron_request.
broker/sqlc/pr_query.sql Updates create/update queries to persist terminal_state.
broker/migrations/023_add_terminal_state.up.sql Adds DB column + index for terminal_state.
broker/migrations/023_add_terminal_state.down.sql Drops the terminal_state column on rollback.
broker/patron_request/service/action_mapping.go Adds terminal to state config and reads it from the state model.
broker/patron_request/service/action.go Sets TerminalState when transitioning into a terminal state via actions.
broker/patron_request/service/message-handler.go Sets TerminalState when transitioning into a terminal state via incoming message events; initializes new PRs with TerminalState: false.
broker/patron_request/db/prcql.go Adds terminal_state as a supported CQL boolean field.
broker/patron_request/api/api-handler.go Includes TerminalState in API responses and initializes new PRs with TerminalState: false.
broker/oapi/open-api.yaml Adds terminalState to the PatronRequest schema and documents terminal_state as a CQL filter field.
broker/test/patron_request/api/api-handler_test.go Asserts TerminalState is true when requests reach Completed.
broker/test/patron_request/db/prrepo_test.go Updates PR creation in tests to include TerminalState.

@JanisSaldabols JanisSaldabols requested a review from Copilot March 31, 2026 10:00
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@JanisSaldabols JanisSaldabols merged commit 926e993 into main Mar 31, 2026
9 checks passed
@JanisSaldabols JanisSaldabols deleted the LLDEV-312 branch March 31, 2026 10:52
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