Skip to content

feat: use new dispatch API body, remove manual ID trawling - #363

Merged
Codex- merged 6 commits into
mainfrom
feat_use_returned_id
Jul 29, 2026
Merged

feat: use new dispatch API body, remove manual ID trawling#363
Codex- merged 6 commits into
mainfrom
feat_use_returned_id

Conversation

@Codex-

@Codex- Codex- commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Resolves #344

Summary by CodeRabbit

  • New Features

    • The action now returns the dispatched workflow’s run ID and URL as outputs immediately after dispatch.
    • Added validation and clearer errors when run details are unavailable or incomplete.
  • Changes

    • Removed legacy timeout, retry, and distinct identifier inputs.
    • Simplified workflow dispatch configuration and execution flow.
  • Documentation

    • Updated usage examples, token requirements, permissions, API details, and guidance for using returned run information.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Codex-, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 470509e2-cb32-405c-bf21-365a1d0ff385

📥 Commits

Reviewing files that changed from the base of the PR and between 37ba2ce and e7c6674.

⛔ Files ignored due to path filters (1)
  • dist/index.mjs is excluded by !**/dist/**
📒 Files selected for processing (5)
  • .github/workflows/release.yml
  • README.md
  • src/api.spec.ts
  • src/api.ts
  • src/main.spec.ts
📝 Walkthrough

Walkthrough

The action removes polling, timeout, retry, and distinct-ID handling. It requests run details during workflow dispatch, validates the returned ID and URL, returns them from the API layer, and sets runId and runUrl outputs.

Changes

Direct dispatch configuration

Layer / File(s) Summary
Action contract and workflow inputs
action.yml, src/action.ts, .github/workflows/*
Removes timeout, retry, and distinct_id inputs and related configuration handling.
Documentation and usage examples
README.md
Documents direct run-detail retrieval, token requirements, dispatch outputs, and simplified configuration.

Dispatch and output flow

Layer / File(s) Summary
Dispatch response parsing
src/api.ts, src/api.spec.ts, src/constants.ts
Requests return_run_details, validates returned run data, returns { id, url }, and tests success, malformed responses, unsupported responses, and logging.
Main action integration
src/main.ts, src/main.spec.ts, src/return-dispatch.ts, src/utils.ts
Replaces polling and branch/distinct-ID processing with direct dispatch, then sets runId and runUrl outputs; obsolete flow coverage and helpers are removed.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Action as main
  participant API as dispatchWorkflow
  participant GitHub as GitHub workflow dispatch API
  participant Outputs as Action outputs
  Action->>API: dispatch workflow
  API->>GitHub: create dispatch with return_run_details
  GitHub-->>API: run ID and URL
  API-->>Action: DispatchedWorkflowRun
  Action->>Outputs: set runId and runUrl
Loading

Possibly related PRs

  • Codex-/return-dispatch#296: Adds ETag-based API caching that conflicts with this PR’s removal of the ETag module and its API wiring.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: switching to the new dispatch API and removing manual ID polling.
Linked Issues check ✅ Passed The PR adopts return_run_details and returns the run ID/URL, matching issue #344.
Out of Scope Changes check ✅ Passed The changes stay focused on the dispatch API migration and related cleanup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat_use_returned_id

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.

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.31%. Comparing base (08365b6) to head (e7c6674).

Files with missing lines Patch % Lines
src/api.ts 91.30% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #363      +/-   ##
==========================================
- Coverage   91.72%   88.31%   -3.42%     
==========================================
  Files           7        3       -4     
  Lines         266       77     -189     
  Branches       66       21      -45     
==========================================
- Hits          244       68     -176     
+ Misses          3        2       -1     
+ Partials       19        7      -12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/api.spec.ts (1)

122-144: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consider also covering the rejected-request path.

This covers the empty-204 case, but the more likely legacy-server behaviour is a thrown 400 from the request itself. See the consolidated note on src/api.ts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api.spec.ts` around lines 122 - 144, Add a test in the dispatchWorkflow
test suite covering createWorkflowDispatch rejecting with a 400 error, and
assert the resulting error and logging behavior match the legacy-server handling
described for dispatchWorkflow. Keep the existing empty-204 test unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 54-60: Add a concise server-version requirement to the “APIs Used”
section near the workflow dispatch endpoint, stating that run details require
github.com or GHES 3.21 and later. Ensure the README warns GHES users that older
versions are unsupported by dispatchWorkflow.

In `@src/api.ts`:
- Around line 82-89: Update createWorkflowDispatch handling in src/api.ts around
readDispatchedRun so a 400 failure whose message mentions return_run_details is
converted to the same capability error as the existing empty-204 guard, while
preserving unrelated errors and the current fallback. Add coverage in
src/api.spec.ts for this 400 response path.

---

Nitpick comments:
In `@src/api.spec.ts`:
- Around line 122-144: Add a test in the dispatchWorkflow test suite covering
createWorkflowDispatch rejecting with a 400 error, and assert the resulting
error and logging behavior match the legacy-server handling described for
dispatchWorkflow. Keep the existing empty-204 test unchanged.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 01f44ec5-3fea-4b20-a0d3-049da9199e7f

📥 Commits

Reviewing files that changed from the base of the PR and between 08365b6 and 37ba2ce.

⛔ Files ignored due to path filters (1)
  • src/__snapshots__/return-dispatch.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (17)
  • .github/workflows/action.yml
  • .github/workflows/dispatch.yml
  • README.md
  • action.yml
  • src/action.spec.ts
  • src/action.ts
  • src/api.spec.ts
  • src/api.ts
  • src/constants.ts
  • src/etags.ts
  • src/main.spec.ts
  • src/main.ts
  • src/return-dispatch.spec.ts
  • src/return-dispatch.ts
  • src/types.ts
  • src/utils.spec.ts
  • src/utils.ts
💤 Files with no reviewable changes (12)
  • src/types.ts
  • src/utils.ts
  • src/constants.ts
  • src/return-dispatch.spec.ts
  • src/return-dispatch.ts
  • .github/workflows/dispatch.yml
  • action.yml
  • src/etags.ts
  • src/utils.spec.ts
  • .github/workflows/action.yml
  • src/action.ts
  • src/action.spec.ts

Comment thread README.md
Comment thread src/api.ts Outdated
@Codex-
Codex- force-pushed the feat_use_returned_id branch from 8a85f74 to 0bd8d47 Compare July 29, 2026 03:40
@Codex-
Codex- force-pushed the feat_use_returned_id branch from 0bd8d47 to e7c6674 Compare July 29, 2026 03:55
@Codex-
Codex- merged commit c411c4e into main Jul 29, 2026
7 checks passed
@Codex-
Codex- deleted the feat_use_returned_id branch July 29, 2026 04:25
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.

Use new dispatch api

2 participants