Skip to content

Support GitHub pull request merge writebacks - #125

Merged
khaliqgant merged 4 commits into
mainfrom
codex/issue-147-merge-pr
May 26, 2026
Merged

khaliqgant merged 4 commits into
mainfrom
codex/issue-147-merge-pr

Conversation

@khaliqgant

@khaliqgant khaliqgant commented May 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds GitHub pull request merge writeback support for /github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json.
  • Maps merge payloads to PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge, including merge method and optional commit title/message.
  • Documents the merge action path in the adapter mapping, discovery docs, and layout prompt.
  • Adds tests for custom/default merge payloads and 2xx responses without a JSON object body.

Part of AgentWorkforce/workforce#147.

Companion PRs

Validation

  • npm run --workspace @relayfile/adapter-github test
  • git diff --check HEAD~1..HEAD

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 38 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb107545-e126-4e6e-ba0b-e620ff8fed9f

📥 Commits

Reviewing files that changed from the base of the PR and between 40b5a87 and 05b7206.

📒 Files selected for processing (19)
  • packages/core/src/runtime/file-native-router.test.ts
  • packages/core/src/runtime/schema-adapter.ts
  • packages/core/tests/runtime/schema-adapter.test.ts
  • packages/github/discovery/github/.adapter.md
  • packages/github/discovery/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.create.example.json
  • packages/github/discovery/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.schema.json
  • packages/github/github.mapping.yaml
  • packages/github/src/layout-prompt.ts
  • packages/github/src/layout.ts
  • packages/github/src/resources.ts
  • packages/github/src/types.ts
  • packages/github/src/writeback.test.ts
  • packages/github/src/writeback.ts
  • packages/notion/discovery/notion/.adapter.md
  • scripts/generate-writeback-discovery.mjs
  • scripts/integration-contracts/github/writeback.openapi.json
  • scripts/writeback-discovery-data.mjs
  • scripts/writeback-discovery-normalizer.mjs
  • scripts/writeback-discovery-normalizer.test.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-147-merge-pr

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.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 6 files

You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/github/src/writeback.ts Outdated

@cubic-dev-ai cubic-dev-ai 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.

2 issues found across 14 files (changes from recent commits).

You’re at about 96% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/github/discovery/github/.adapter.md">

<violation number="1" location="packages/github/discovery/github/.adapter.md:18">
P2: The ID pattern `^\d+$` for merge.json is incorrect. The resource path has no `<id>` component to match — the filename is always exactly `merge.json`. This contradicts the ID Patterns section below which correctly says `exact file path`. The previous value `exact filename` was accurate.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/github/src/resources.ts Outdated
| `/github/repos/{owner}/{repo}/issues/<id>.json` | `/github/repos/{owner}/{repo}/issues/.schema.json` | `/github/repos/{owner}/{repo}/issues/.create.example.json` | `^[1-9]\d*$` | Creates a GitHub issue. |
| `/github/repos/{owner}/{repo}/issues/{issueNumber}/comments/<id>.json` | `/github/repos/{owner}/{repo}/issues/{issueNumber}/comments/.schema.json` | `/github/repos/{owner}/{repo}/issues/{issueNumber}/comments/.create.example.json` | `^\d+$` | Creates or updates a GitHub issue comment. |
| `/github/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/<id>.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/.schema.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/.create.example.json` | `^\d+$` | Submits a pull request review with optional inline comments. |
| `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.schema.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.create.example.json` | `^\d+$` | Merges a pull request. Defaults to squash when no merge method is supplied. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The ID pattern ^\d+$ for merge.json is incorrect. The resource path has no <id> component to match — the filename is always exactly merge.json. This contradicts the ID Patterns section below which correctly says exact file path. The previous value exact filename was accurate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/github/discovery/github/.adapter.md, line 18:

<comment>The ID pattern `^\d+$` for merge.json is incorrect. The resource path has no `<id>` component to match — the filename is always exactly `merge.json`. This contradicts the ID Patterns section below which correctly says `exact file path`. The previous value `exact filename` was accurate.</comment>

<file context>
@@ -15,7 +15,7 @@ Resources:
 | `/github/repos/{owner}/{repo}/issues/{issueNumber}/comments/<id>.json` | `/github/repos/{owner}/{repo}/issues/{issueNumber}/comments/.schema.json` | `/github/repos/{owner}/{repo}/issues/{issueNumber}/comments/.create.example.json` | `^\d+$` | Creates or updates a GitHub issue comment. |
 | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/<id>.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/.schema.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/.create.example.json` | `^\d+$` | Submits a pull request review with optional inline comments. |
-| `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json` | inline merge payload | n/a | exact filename | Merges a pull request. |
+| `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.schema.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.create.example.json` | `^\d+$` | Merges a pull request. Defaults to squash when no merge method is supplied. |
 
 ## Operations
</file context>
Suggested change
| `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.schema.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.create.example.json` | `^\d+$` | Merges a pull request. Defaults to squash when no merge method is supplied. |
| `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.schema.json` | `/github/repos/{owner}/{repo}/pulls/{pullNumber}/merge.json/.create.example.json` | exact file path | Merges a pull request. Defaults to squash when no merge method is supplied. |

@khaliqgant
khaliqgant merged commit a573ffd into main May 26, 2026
3 checks passed
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.

2 participants