Skip to content

M5: Workflow runs (list + re-run/cancel/trigger)#292

Draft
michaeljolley wants to merge 1 commit into
mjolley/m4-create-flowsfrom
mjolley/m5-workflow-runs
Draft

M5: Workflow runs (list + re-run/cancel/trigger)#292
michaeljolley wants to merge 1 commit into
mjolley/m4-create-flowsfrom
mjolley/m5-workflow-runs

Conversation

@michaeljolley

Copy link
Copy Markdown

Part of the CmdPal GitHub extension parity roadmap (stacked on M4, PR #291).

Summary

Adds GitHub Actions workflow-run support: a repository-scoped runs list plus re-run, cancel, and trigger actions.

Data layer

  • \IWorkflowRun\ / \WorkflowRun\ data type.
  • \IWorkflowRunsDataManager\ / \WorkflowRunsDataManager\ over the Octokit Actions API: list recent runs, re-run, cancel, and \workflow_dispatch\ trigger. Reuses \GitHubCreateManager.ParseOwnerRepo\ so both \owner/repo\ and full URLs work.

Command surface

  • Workflow Runs top-level command opens a \DynamicListPage; the user types \owner/repo\ in the search box and the page lists the most recent runs. Each run offers: re-run (non-destructive), cancel (destructive, confirmed + critical, only shown for in-progress/queued runs), open in browser, and copy URL.
  • Trigger Workflow top-level command: a \FormContent\ form (repository, workflow file, ref) that fires a \workflow_dispatch\ event.

Infrastructure reuse

  • \WorkflowRunsMediator\ + \WorkflowRunActionCommand\ mirror the notifications/mutation event-driven refresh pattern. Cancel wraps the action in the existing \ConfirmedCommand.
  • Added a URL-based \LinkCommand\ overload, a Workflows icon, and the \TriggerWorkflow\ template case.

Design note

Workflow runs are inherently repository-scoped, so the page takes the repository from the search box rather than trying to aggregate runs across all repositories. This keeps a single, predictable API call per view.

Tests

  • \WorkflowRunsTests: Trigger Workflow form renders valid adaptive-card JSON; page shows a prompt when empty, a none-message when a repo has no runs, renders run items, and shows the cancel command only for in-progress runs.
  • Full suite: 192/192 passing. Build clean (x64 Debug).

Localization

Added top-level command names/subtitles, page prompts, run action titles, confirmation dialog text, success/error toasts, and the Trigger Workflow form strings to \Resources.resw.

Add a repository-scoped Workflow Runs page (DynamicListPage keyed on an
owner/repo query) that lists recent GitHub Actions runs, with per-run re-run
(non-destructive), cancel (destructive, confirmed), open-in-browser, and copy
URL actions. Add a top-level Trigger Workflow form (workflow_dispatch) built on
the existing FormContent infrastructure.

- IWorkflowRun / WorkflowRun data type; IWorkflowRunsDataManager /
  WorkflowRunsDataManager (Octokit Actions API: list, rerun, cancel, dispatch),
  reusing GitHubCreateManager.ParseOwnerRepo for owner/repo parsing.
- WorkflowRunsMediator + WorkflowRunActionCommand mirror the notifications/
  mutation event-driven refresh pattern; cancel is wrapped in ConfirmedCommand
  and marked critical.
- Top-level Workflow Runs and Trigger Workflow commands; TriggerWorkflowForm +
  template; LinkCommand URL overload; Workflows icon; ResW strings.
- Tests: WorkflowRunsTests (form JSON, prompt/none/list rendering, cancel
  visibility by run status). 192/192 tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant