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: simplify getting PR merge status #123

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Conversation

dgw
Copy link
Member

@dgw dgw commented Mar 31, 2023

merged_at is null if the PR is either open, or closed unmerged.

Not 100% certain that field is guaranteed to be populated for every PR on GitHub, regardless of age, but I think it's acceptable to get rid of the second API request in exchange for a small risk of giving slightly incorrect output in a very small number of cases.

`merged_at` is `null` if the PR is either open, or closed unmerged.

Not 100% certain that field is guaranteed to be populated for *every* PR
on GitHub, regardless of age, but I think it's acceptable to get rid of
the second API request in exchange for a small risk of giving slightly
incorrect output in a very small number of cases.
@dgw dgw added the tweak label Mar 31, 2023
@dgw dgw added this to the 0.5.0 milestone Mar 31, 2023
@dgw dgw merged commit 52584a4 into master Apr 13, 2023
@dgw dgw deleted the simplify-merge-status branch April 13, 2023 00:28
dgw added a commit that referenced this pull request Apr 17, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant