Skip to content

implement worklfow rn state api migration - #42

Merged
raylrui merged 2 commits into
mainfrom
feat/implement-worklfowrun-api-migration
Aug 13, 2026
Merged

raylrui merged 2 commits into
mainfrom
feat/implement-worklfowrun-api-migration

Conversation

@raylrui

@raylrui raylrui commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Update workflow-run state transitions to use the new permission-specific API endpoints.

Changes

  • Move validation-map requests to the global endpoint:
    • GET /api/v1/workflowrun/state/get_states_transition_validation_map/
  • Replace the removed generic and batch state-transition endpoints with:
    • POST /api/v1/workflowrun/state/cancel/
    • POST /api/v1/workflowrun/state/deprecate/
    • POST /api/v1/workflowrun/state/resolve/
  • Support both single-run and batch transitions using workflowrunOrcabusIds.
  • Centralize transition validation, state normalization, endpoint dispatch, and response feedback.
  • Only show transitions valid for every selected workflow run.
  • Handle partial batch success with warning feedback and cache refreshes.
  • Disable rerun deprecation when it is not valid for the current workflow state.
  • Require a nonblank comment when creating workflow-run states.
  • Preserve existing state-history listing and state-comment editing behavior.

Testing

Added regression tests for:

  • Validation-map rule formats
  • Supported-state filtering
  • Null current-state handling
  • State-to-endpoint dispatch
  • Unsupported transitions
  • Full and partial response feedback
  • Required transition comments
  • Rerun deprecation availability

@raylrui
raylrui requested a balanced review from Copilot August 11, 2026 05:41
@raylrui raylrui self-assigned this Aug 11, 2026
@raylrui raylrui added the enhancement New feature or request label Aug 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates workflow-run transitions to permission-specific APIs and centralizes validation, dispatch, and feedback.

Changes:

  • Adds shared transition utilities and regression tests.
  • Updates single, batch, and rerun transition flows.
  • Requires comments for new workflow-run states.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
workflowRunStateTransitions.ts Adds transition utilities.
workflowRunStateTransitions.test.ts Tests transition behavior.
WorkflowRunDetailsContext.tsx Uses global validation endpoint.
WorkflowRunsBatchStateTransitionModal.tsx Migrates batch transitions.
WorkflowRunRerunModal.tsx Disables invalid deprecation.
WorkflowRunRerunModal.test.tsx Tests deprecation availability.
WorkflowRunDetailsTimeline.tsx Migrates timeline transitions.
WorkflowRunDetailsPageHeader.tsx Migrates rerun deprecation.
workflows.api.ts Defines new API hooks.
CustomStateDialog.tsx Supports required comments.
CustomStateDialog.test.tsx Tests required comment markup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +100 to +103
() =>
new Set<string>(
getAvailableWorkflowRunStateTransitions(validationMap, []).map(({ value }) => value)
),
@raylrui
raylrui merged commit 792ce2a into main Aug 13, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants