Skip to content

Fix ISSUE_PATTERN to handle Slack URL formats#59

Merged
atm-snag2 merged 2 commits into
masterfrom
fix-issue-pattern-slack-url-formats
Jul 7, 2026
Merged

Fix ISSUE_PATTERN to handle Slack URL formats#59
atm-snag2 merged 2 commits into
masterfrom
fix-issue-pattern-slack-url-formats

Conversation

@atm-snag2

@atm-snag2 atm-snag2 commented Jul 7, 2026

Copy link
Copy Markdown

What

Closes #58

Why

How

Handle domain-without-protocol (github.com/owner/repo/pull/123) via an alternative pattern [^/]+\.[^/]+/ alongside the existing https?://[^/]+/.
This pattern only matches strings containing a dot (.), so it won't consume owner/ in owner/repo#123 as a domain (GitHub usernames cannot contain dots).

Non Goal

  • Handling Slack's <url|text> pipe format is out of scope — the adapter layer parses it and passes only the display text to the handler

Refs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atm-snag2 atm-snag2 self-assigned this Jul 7, 2026
@atm-snag2

Copy link
Copy Markdown
Author

Verification

$ MISE_RUBY_VERSION=3.2 mise exec ruby -- bundle exec rspec
16 examples, 0 failures

2 consecutive green runs confirmed.

ISSUE_PATTERN unit tests

Format Input repo number
owner/repo#number alice/test#123 alice/test 123
Full URL (/issues/) https://github.com/alice/test/issues/123 alice/test 123
Full URL (/pull/) https://github.com/alice/test/pull/123 alice/test 123
Protocol-stripped (Slack) github.com/alice/test/pull/123 alice/test 123
Angle-bracketed <https://github.com/alice/test/pull/123> alice/test 123

#close_issue integration tests

  • @ruboty close issue alice/test#1 — existing format ✅
  • @ruboty close https://github.com/alice/test/issues/1 — full URL ✅
  • @ruboty close github.com/alice/test/issues/1 — Slack display text ✅
  • @ruboty close <https://github.com/alice/test/issues/1> — angle brackets ✅

@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 updates the ISSUE_PATTERN regular expression in lib/ruboty/handlers/github.rb to support protocol-stripped URLs and angle-bracketed URLs, along with adding comprehensive test coverage in spec/ruboty/handlers/github_spec.rb. Feedback suggests replacing the greedy wildcard (?<repo>.+) with (?<repo>[^/]+/[^/]+) to prevent incorrect domain parsing when owner names contain dots and to avoid potential backtracking performance issues.

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 thread lib/ruboty/handlers/github.rb Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atm-snag2
atm-snag2 force-pushed the fix-issue-pattern-slack-url-formats branch from da247de to 4e6aa48 Compare July 7, 2026 05:02
@atm-snag2

Copy link
Copy Markdown
Author

@gemini-code-assist review

@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 updates the ISSUE_PATTERN regular expression in the GitHub handler to support protocol-stripped and angle-bracketed URLs, and adds corresponding unit and integration tests. The review feedback highlights that Slack automatically formats protocol-stripped URLs with a pipe and display text (e.g., <url|text>), which will cause the pattern matching to fail due to the \z anchor in commands. The reviewer suggests updating the regex to handle this Slack link format and adding corresponding test cases to verify both the pattern matching and the #close_issue action.

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 thread lib/ruboty/handlers/github.rb
Comment thread spec/ruboty/handlers/github_spec.rb
Comment thread spec/ruboty/handlers/github_spec.rb
@atm-snag2
atm-snag2 marked this pull request as ready for review July 7, 2026 05:06
@atm-snag2
atm-snag2 requested review from a team and wataru86 and removed request for a team July 7, 2026 05:10

@wataru86 wataru86 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@atm-snag2
atm-snag2 merged commit a1abd26 into master Jul 7, 2026
5 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.

Fix ISSUE_PATTERN to handle Slack app URL formats

2 participants