fix: Phase 3b2 and triage gh pr view fails from cron (missing --repo)#1490
fix: Phase 3b2 and triage gh pr view fails from cron (missing --repo)#1490marcusquinn merged 1 commit intomainfrom
Conversation
gh pr view without --repo infers the repo from the current directory's git remote. Cron runs from $HOME which isn't a git repo, so all PR lookups fail with 'unreachable'. This blocked Phase 3b2 from running overnight — the 5 verify_failed tasks were never reset to deployed. Fix: extract owner/repo slug from the PR URL (which already contains it) and pass --repo to gh pr view. Both Phase 3b2 and triage are fixed.
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where GitHub CLI commands, specifically Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughThe PR refactors GitHub PR URL parsing to extract repository slug alongside PR number, enabling repository-aware Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sun Feb 15 14:51:39 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where gh pr view fails when executed from a cron job because it cannot infer the repository from the current directory. The fix correctly extracts the repository slug and PR number from the PR URL and passes the --repo flag to the GitHub CLI. The changes are consistent across the pulse and triage commands. I have provided a minor suggestion to improve the robustness of the URL parsing regex to handle optional trailing slashes or query parameters, which is a common edge case in URL handling.
| pr_number="${BASH_REMATCH[1]}" | ||
| # Extract PR number and repo slug from URL | ||
| local pr_number="" pr_repo_slug="" | ||
| if [[ "$stale_pr" =~ github\.com/([^/]+/[^/]+)/pull/([0-9]+)$ ]]; then |
There was a problem hiding this comment.
The regex anchor $ is quite strict. If the PR URL contains a trailing slash or query parameters (e.g., from a browser copy-paste), this match will fail. Consider making the end of the regex more flexible to handle these common cases.
| if [[ "$stale_pr" =~ github\.com/([^/]+/[^/]+)/pull/([0-9]+)$ ]]; then | |
| if [[ "$stale_pr" =~ github\.com/([^/]+/[^/]+)/pull/([0-9]+)(/|\?|#|$) ]]; then |
| pr_num="${BASH_REMATCH[1]}" | ||
| # Extract PR number and repo slug from URL | ||
| local pr_num="" triage_repo_slug="" | ||
| if [[ "$tpr" =~ github\.com/([^/]+/[^/]+)/pull/([0-9]+)$ ]]; then |
There was a problem hiding this comment.
Similar to the change in cmd_pulse, the strict $ anchor might cause parsing failures for URLs with trailing slashes or parameters. Using a more permissive termination pattern would improve robustness.
| if [[ "$tpr" =~ github\.com/([^/]+/[^/]+)/pull/([0-9]+)$ ]]; then | |
| if [[ "$tpr" =~ github\.com/([^/]+/[^/]+)/pull/([0-9]+)(/|\?|#|$) ]]; then |



Summary
gh pr viewwithout--repoinfers the repo from the current directory's git remote$HOMEwhich isn't a git repo, so all PR lookups return empty → "unreachable"owner/reposlug from the PR URL itself and pass--repotogh pr viewSummary by CodeRabbit
Bug Fixes
Chores