Skip to content

Handle compact GitHub issue repo paths#20

Merged
khaliqgant merged 2 commits into
mainfrom
fix/github-issue-owner-repo-paths
Jun 22, 2026
Merged

Handle compact GitHub issue repo paths#20
khaliqgant merged 2 commits into
mainfrom
fix/github-issue-owner-repo-paths

Conversation

@miyaontherelay

Copy link
Copy Markdown
Contributor

Summary

  • parse GitHub issue paths under both split owner/repo and compact owner__repo relayfile layouts
  • apply the compact layout to issue directory events and unsupported issue tree-path accounting
  • add regression coverage for compact by-id, flat JSON, nested meta/metadata, directory-event, and runOnce mirror routing to the repo label

Closes #19

Tests

  • npm test -- src/orchestrator/factory.test.ts -t "GitHub issue"
  • npm run build
  • npm test

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

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

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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.

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

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: 133bfce5-bef0-44ff-bcc0-c96955f819d1

📥 Commits

Reviewing files that changed from the base of the PR and between 11e5cdf and 786198e.

📒 Files selected for processing (2)
  • src/orchestrator/factory.test.ts
  • src/orchestrator/factory.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/github-issue-owner-repo-paths

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for compact GitHub repository path layouts (owner__repo) in addition to the standard nested structure, updating path parsing functions and adding corresponding unit tests. The review feedback highlights a potential parsing bug when repository names contain underscores, suggesting the use of non-greedy matching ([^/]+?) for the owner group in the regular expressions to ensure correct splitting.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 4081 to 4083
const match = path.match(
/^\/github\/repos\/([^/]+)\/([^/]+)\/issues\/(?:(?:by-id\/)?(\d+)\.json|(\d+)(?:__([^/]+))?\/(?:meta|metadata)\.json)$/u,
/^\/github\/repos\/(?:([^/]+)\/([^/]+)|([^/]+)__([^/]+))\/issues\/(?:(?:by-id\/)?(\d+)\.json|(\d+)(?:__([^/]+))?\/(?:meta|metadata)\.json)$/u,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

GitHub usernames and organization names are restricted to alphanumeric characters and hyphens, meaning they can never contain underscores (_). However, GitHub repository names are allowed to contain underscores.

In the compact layout owner__repo, if a repository name contains underscores (e.g., my_awesome_repo), the greedy match ([^/]+)__([^/]+) will incorrectly split the path, greedily matching up to the last __ and attributing part of the repository name to the owner.

Using a non-greedy match ([^/]+?) for the compact owner group ensures the regex correctly splits at the first __ delimiter.

Suggested change
const match = path.match(
/^\/github\/repos\/([^/]+)\/([^/]+)\/issues\/(?:(?:by-id\/)?(\d+)\.json|(\d+)(?:__([^/]+))?\/(?:meta|metadata)\.json)$/u,
/^\/github\/repos\/(?:([^/]+)\/([^/]+)|([^/]+)__([^/]+))\/issues\/(?:(?:by-id\/)?(\d+)\.json|(\d+)(?:__([^/]+))?\/(?:meta|metadata)\.json)$/u,
)
const match = path.match(
/^\/github\/repos\/(?:([^/]+)\/([^/]+)|([^/]+?)__([^/]+))\/issues\/(?:(?:by-id\/)?(\d+)\.json|(\d+)(?:__([^/]+))?\/(?:meta|metadata)\.json)$/u,
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 786198e. The compact owner segment now uses GitHub owner characters ([A-Za-z0-9-]+) so repo names can contain underscores/double underscores without shifting into the owner. Added regression coverage for /github/repos/AgentWorkforce__cloud__platform/issues/by-id/2174.json and slugged meta paths.

Comment thread src/orchestrator/factory.ts Outdated

const githubIssueDirectoryPathParts = (path: string): { owner: string; repo: string; number: number; slug?: string } | undefined => {
const match = path.match(/^\/github\/repos\/([^/]+)\/([^/]+)\/issues\/(\d+)(?:__([^/]+))?$/u)
const match = path.match(/^\/github\/repos\/(?:([^/]+)\/([^/]+)|([^/]+)__([^/]+))\/issues\/(\d+)(?:__([^/]+))?$/u)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to githubIssuePathParts, using a non-greedy match ([^/]+?) for the compact owner group prevents incorrect parsing when the repository name contains underscores.

Suggested change
const match = path.match(/^\/github\/repos\/(?:([^/]+)\/([^/]+)|([^/]+)__([^/]+))\/issues\/(\d+)(?:__([^/]+))?$/u)
const match = path.match(/^\/github\/repos\/(?:([^/]+)\/([^/]+)|([^/]+?)__([^/]+))\/issues\/(\d+)(?:__([^/]+))?$/u)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 786198e with the same compact owner restriction in githubIssueDirectoryPathParts(). The backfill dedupe test now uses a compact directory path with a repo containing double underscores, so the private directory parser is covered too.

@khaliqgant khaliqgant merged commit f439646 into main Jun 22, 2026
3 checks passed
@khaliqgant khaliqgant deleted the fix/github-issue-owner-repo-paths branch June 22, 2026 11:15
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.

GitHub issue ingestion misses owner__repo relayfile paths

2 participants