Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: support inline references to issues/PRs in any repo #125

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

dgw
Copy link
Member

@dgw dgw commented Apr 1, 2023

This accepts user/reponame#123 in all cases.

As before, if the current channel has a default repo (set using the .gh-repo command), #123 will be treated as a reference to an issue or PR in the configured default repo. Additionally, reponame#123 will now fill in the missing "username" portion from the configured default.

Implementing this feature required switching to named capture groups in all URL patterns, because the user and reponame portions of the inline references are optional. It seemed like a maintainability win, anyway, so even if I just missed thinking of a way to do it with numbered capture groups, I'm glad to have made the change anyway.

This accepts `user/reponame#123` in all cases.

As before, if the current channel has a default repo (set using the
`.gh-repo` command), `#123` will be treated as a reference to an issue
or PR in the configured default repo. Additionally, `reponame#123` will
now fill in the missing "username" portion from the configured default.

Implementing this feature required switching to named capture groups in
all URL patterns, because the `user` and `reponame` portions of the
inline references are optional. It seemed like a maintainability win,
anyway, so even if I just missed thinking of a way to do it with
numbered capture groups, I'm glad to have made the change anyway.
@dgw dgw added the enhancement label Apr 1, 2023
@dgw dgw added this to the 0.5.0 milestone Apr 1, 2023
@dgw
Copy link
Member Author

dgw commented Apr 17, 2023

Two weeks of testing on the Sopel bot running in #sopel at Libera, no further issues noted other than parentheses breaking this feature (now fixed by 0655be3. Let's ship.

@dgw dgw merged commit de9d58b into master Apr 17, 2023
@dgw dgw deleted the arbitrary-inline-refs branch April 17, 2023 09:52
@dgw dgw linked an issue Jun 13, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support arbitrary inline issue references
1 participant