Skip to content

feat(desktop): Workflow dispatch inputs & real-time action logs#75

Merged
MocA-Love merged 3 commits intomainfrom
feat/enhance-action
Apr 4, 2026
Merged

feat(desktop): Workflow dispatch inputs & real-time action logs#75
MocA-Love merged 3 commits intomainfrom
feat/enhance-action

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

@MocA-Love MocA-Love commented Apr 4, 2026

Summary

  • workflow_dispatch のinputs(choice/boolean/string/number)をYAMLパースしてUI表示・送信に対応
  • ワークフロー実行後、View logsボタンから既存ActionLogsPaneでリアルタイムログ表示
  • ActionLogsPaneのjobリストをrunIdベースでポーリング更新(途中でjob追加されるワークフローに対応)
  • Configure/Runボタンを横並びレイアウトに改善

Test plan

  • inputsありのworkflow_dispatchワークフローでchoice/booleanが正しく表示・送信されること
  • Runボタン押下後、WorkflowRunCardのView logsからActionLogsPaneが開くこと
  • jobが途中で増えるワークフローでjobリストがリアルタイム更新されること
  • inputsなしのワークフローが従来通りRunボタンのみで動作すること

Summary by CodeRabbit

リリースノート

  • 新機能
    • GitHub Actionsワークフロー実行のログビューア機能を追加
    • ワークフロー入力パラメータの設定UI(チェックボックス、セレクト、入力フィールド)を実装
    • ワークフロー実行ジョブのリアルタイムステータスポーリング機能を追加
    • ワークフロー実行からアクションログタブへの直接アクセス機能を実装

- YAMLパースでworkflow_dispatch inputsを抽出(choice/boolean/string/number対応)
- dispatch APIにinputsパラメータを送信
- WorkflowRunCardにView logsボタンを追加し既存ActionLogsPaneでログ表示
- Configure/Runボタンを横並びレイアウトに改善
ActionLogsPaneStateにrunIdを追加し、workflow dispatchから開いた場合は
getWorkflowRunJobsを3秒ポーリングしてjobリストを動的に更新する。
途中でjobが増えるワークフローでも再オープン不要になる。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 4, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 2 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 2 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8cfd83fc-5948-4ef3-84cf-66227ed22119

📥 Commits

Reviewing files that changed from the base of the PR and between 313c701 and a41f512.

📒 Files selected for processing (3)
  • apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx
📝 Walkthrough

Walkthrough

このPRは、GitHub Actionsワークフロー実行機能を拡張します。YAMLベースのワークフローディスパッチ入力解析、ワークフロー実行ジョブの監視機能、UI制御の追加により、ワークフロー入力の設定とジョブ状態追跡を実現します。

Changes

Cohort / File(s) Summary
依存関係
apps/desktop/package.json
YAMLパーサライブラリ js-yaml と型定義 @types/js-yaml を追加。
TRPC ワークフロー手続き
apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
workflowSupportsDispatch を YAML 解析ベースの parseWorkflowDispatchInfo に置き換え、ディスパッチ入力メタデータ (名前、説明、型、デフォルト値、オプション) を抽出。dispatchGitHubWorkflow ミューテーションに入力フォームデータを追加。新規クエリ getWorkflowRunJobs でワークフロー実行ジョブを取得し、ステータスをマップ。
アクションログ UI
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx
runId に基づいてワークフロー実行ジョブをポーリング。動的リフレッシュ間隔で保留中ジョブの監視を最適化。
ワークフロー実行 UI
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx
CheckboxSelect コンポーネントを導入。ワークフロー入力設定用の折り畳み可能な "Conf" ボタン。ワークフロー実行時に入力値を渡す。"View logs" アクション でログタブを開く。
タブストア
apps/desktop/src/renderer/stores/tabs/store.ts, types.ts, utils.ts および apps/desktop/src/shared/tabs-types.ts
addActionLogsTab 関数と ActionLogsPaneState に optional runId?: number パラメータを追加し、ジョブポーリングドライバとして伝播。

Sequence Diagram(s)

sequenceDiagram
    participant User as ユーザー
    participant UI as UI (RepositoryPanel)
    participant Store as タブストア
    participant TRPC as TRPC (サーバ)
    participant GHA as GitHub API

    User->>UI: ワークフロー入力を設定し実行
    UI->>TRPC: dispatchGitHubWorkflow (inputs付き)
    TRPC->>GHA: POST /dispatches (入力フォームデータ)
    GHA-->>TRPC: ワークフロー実行ID返却
    
    User->>UI: "View logs" をクリック
    UI->>TRPC: getWorkflowRunJobs (runId)
    TRPC->>GHA: GET /runs/{runId}/jobs
    GHA-->>TRPC: ジョブリスト返却
    
    TRPC-->>UI: マップ済みジョブ (status, detailsUrl)
    UI->>Store: addActionLogsTab (runId付き)
    Store-->>UI: ActionLogsPane (runId設定)
    
    UI->>TRPC: ポーリング: getWorkflowRunJobs (runId)
    TRPC->>GHA: GET /runs/{runId}/jobs
    GHA-->>TRPC: 更新ジョブ状態
    TRPC-->>UI: ジョブ状態更新
    Note over UI: すべてのジョブが終了時<br/>ポーリング停止
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

ワークフロー駆ける、ウサギの願い 🐰
YAML解きて、入力整え
ジョブを監視、ログを眺め
GitHub Actions、羽ばたく夢よ ✨
実行成功、喜びあふれ 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive 説明は日本語で要約、テスト計画、改善内容を記載しているが、テンプレートの必須セクション(Description、Related Issues、Type of Change等)を完全には満たしていない。 テンプレート形式に合わせて、Description、Type of Change(New featureにチェック)、Related Issuesなどの各セクションを英語で記載することを推奨します。
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは、ワークフロー送出入力とリアルタイムアクションログという、変更セットの主な機能改善を明確に要約しており、関連性が高い。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/enhance-action

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MocA-Love MocA-Love self-assigned this Apr 4, 2026
@MocA-Love MocA-Love marked this pull request as ready for review April 4, 2026 08:22
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx (1)

368-416: ⚠️ Potential issue | 🟠 Major

workflow run 表示では PR チェック再実行ボタンを無効化してください。

runId モードでも JobSteps 側は既存の rerunPullRequestChecks mutation をそのまま使うので、この pane で Re-run failed/all を押すと表示中の workflow run ではなく現在の PR checks を再実行してしまいます。runId がある場合はこの UI を隠すか、workflow run 用の再実行 API に切り替える必要があります。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx`
around lines 368 - 416, The pane currently shows "Re-run failed/all" even when
viewing a workflow run (runId present) which triggers rerunPullRequestChecks
against PR checks; update ActionLogsPane to hide or disable those buttons when
runId is truthy by conditioning the UI rendering on the runId variable (e.g.,
wrap the Re-run controls in a check like if (!runId) ...), and ensure JobSteps
is not passed or invoking the rerunPullRequestChecks mutation when runId exists;
alternatively, if you prefer to support workflow-run reruns, replace the PR
mutation call with the workflow-run rerun API and wire that through JobSteps
when runId is present (refer to ActionLogsPane, runId, JobSteps, and
rerunPullRequestChecks to locate the changes).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts`:
- Around line 280-337: The code currently returns noDispatch in the catch block
which hides workflows that were already detected as having workflow_dispatch;
instead preserve dispatch support on parse failures by returning {
supportsDispatch: true, inputs: [] } when hasDispatch is true. Concretely:
ensure hasDispatch is determined outside/above the try/catch (or capture it
before throwing), catch yaml.load or parsing errors and if hasDispatch return {
supportsDispatch: true, inputs: [] } otherwise return noDispatch; update the
catch handling around yaml.load/readFileSync and adjust references to
hasDispatch, yaml.load, noDispatch, supportsDispatch and inputs accordingly.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx`:
- Around line 580-598: handleRunWorkflow が空文字で初期化された未入力値(input.default ??
"")をそのまま送ってしまっているので、送信前に必須項目の検証を行い、空文字の値は payload から削除してください:
dispatchWorkflowMutation に渡す前に inputs オブジェクトを走査し、値が ""
のキーは削除、必須(required)フィールドが存在していて値が空または未設定ならユーザー向けのエラーを返す(またはセットし直す)ようにし、結果として
mutateAsync に渡す inputs は空文字を含まないものにしてください(参照箇所: handleRunWorkflow,
dispatchWorkflowMutation.mutateAsync, workflowRef)。また同様の修正を 1226-1231
の同処理にも適用してください。
- Around line 361-366: 現在の単一の workflowInputValues state を workflow ごとに分離してください:
workflowInputValues と setWorkflowInputValues を Record<workflowId,
Record<string,string>>(例: Record<number,
Record<string,string>>)に変更し、expandedWorkflowId / setExpandedWorkflowId のまま各
workflow の入力を workflowId キーで保存・取得するように修正してください。具体的には RepositoryPanel コンポーネント内の
workflowInputValues/setWorkflowInputValues の型と初期値をマップ型に変更し、Run
ボタンや入力ハンドラが参照する箇所(既存の workflowInputValues を読み書きしている箇所および expand/selected
workflow ロジック)を workflowId をキーにした読み書きに置き換えて、別 workflow の値が流用されないようにしてください。
- Around line 624-643: handleViewWorkflowLogs currently returns early when
jobs.length === 0 which prevents opening the Action Logs tab for runs that have
no jobs yet; instead, remove the early return so the function always calls
addActionLogsTab(workspaceId, jobs, failedIdx >= 0 ? failedIdx : undefined,
runId) even when jobs is an empty array, and optionally replace the toast.error
with a non-blocking info toast (or no toast) so the tab opens and the existing
runId polling can populate jobs as they appear; ensure addActionLogsTab and any
downstream consumers correctly accept an empty jobs array and undefined failed
index.

---

Outside diff comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx`:
- Around line 368-416: The pane currently shows "Re-run failed/all" even when
viewing a workflow run (runId present) which triggers rerunPullRequestChecks
against PR checks; update ActionLogsPane to hide or disable those buttons when
runId is truthy by conditioning the UI rendering on the runId variable (e.g.,
wrap the Re-run controls in a check like if (!runId) ...), and ensure JobSteps
is not passed or invoking the rerunPullRequestChecks mutation when runId exists;
alternatively, if you prefer to support workflow-run reruns, replace the PR
mutation call with the workflow-run rerun API and wire that through JobSteps
when runId is present (refer to ActionLogsPane, runId, JobSteps, and
rerunPullRequestChecks to locate the changes).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ed18b8e-e79f-407a-a349-6f8a4be2482b

📥 Commits

Reviewing files that changed from the base of the PR and between feb35ce and 313c701.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • apps/desktop/package.json
  • apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/renderer/stores/tabs/types.ts
  • apps/desktop/src/renderer/stores/tabs/utils.ts
  • apps/desktop/src/shared/tabs-types.ts

Comment thread apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts Outdated
- YAMLパース失敗時もsupportsDispatch: trueを返すよう修正
- workflowInputValuesをworkflow IDごとに分離し値の混在を防止
- 必須入力の検証と空文字値の除去を追加
- jobs空配列でもActionLogsタブを開きポーリングに委ねる
- runIdモード時にRe-runボタンを非表示にする
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