Skip to content

Allow overriding the pull request number#359

Open
maleadt wants to merge 1 commit into
benchmark-action:masterfrom
maleadt:pull_request_number
Open

Allow overriding the pull request number#359
maleadt wants to merge 1 commit into
benchmark-action:masterfrom
maleadt:pull_request_number

Conversation

@maleadt

@maleadt maleadt commented Jul 16, 2026

Copy link
Copy Markdown

Repository dispatch events carry caller data under client_payload and do not expose a top-level pull_request. Allow callers to provide the pull request number explicitly so benchmark comments use the existing create-or-update PR path instead of falling back to commit comments.

Summary by CodeRabbit

  • New Features

    • Added an optional pull-request-number input to target comments on a specific pull request.
    • Supports pull-request comments for events where the standard pull request details are unavailable.
    • Validates that the provided pull request number is a positive integer.
  • Documentation

    • Updated usage documentation with details about the new input.

Repository dispatch events carry caller data under client_payload and do not expose a top-level pull_request. Allow callers to provide the pull request number explicitly so benchmark comments use the existing create-or-update PR path instead of falling back to commit comments.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b9cc137c-6dda-489b-93f5-c14ff14142b5

📥 Commits

Reviewing files that changed from the base of the PR and between 86d8bcf and e8cfc5c.

📒 Files selected for processing (7)
  • README.md
  • action.yml
  • src/config.ts
  • src/write.ts
  • test/config.spec.ts
  • test/fakedOctokit.ts
  • test/write.spec.ts

📝 Walkthrough

Walkthrough

The action adds an optional pull request number input, validates and exposes it through configuration, and uses it to route summary and alert comments to pull request reviews when provided. Documentation and tests cover configuration parsing and comment behavior.

Changes

Pull request comment targeting

Layer / File(s) Summary
Pull request number input and validation
action.yml, src/config.ts, README.md, test/config.spec.ts
Adds the optional input, validates positive unsigned integers, exposes pullRequestNumber in Config, documents usage, and tests default, invalid, and valid values.
Comment API routing
src/write.ts
Uses the configured pull request number for summary and alert comments, falling back to the event payload when absent.
Pull request review test coverage
test/fakedOctokit.ts, test/write.spec.ts
Adds fake pull request review tracking and verifies explicit pull request routing and review creation.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ActionInput
  participant Config
  participant CommentHandler
  participant GitHub
  ActionInput->>Config: Read pull-request-number
  Config->>CommentHandler: Provide pullRequestNumber
  CommentHandler->>GitHub: Create pull request review for summary or alert
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding an override for the pull request number used by the action.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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