Closed bolinfest closed 5 months ago
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@zzl0 merged this pull request in facebook/sapling@58562a051801022a79db40483d26940eab48160a.
Recognize PR# at end of commit title for github_pullrequest* templates
Summary: On GitHub, commits that are squash/merged from pull requests such as https://github.com/facebook/dotslash/commit/4c0563c2939d401d67c15fdfcd1de3238adf5449 commonly have the pull request number at the end of the first line of the commit message like so:
This updates the logic for the various
github_pull_request_*
templates to match this pattern.Note this required adding
repo
as an argument to_parse_github_pull_request_url()
so that it could produce a completePullRequestId
object even if it only had the commit number in the commit message.Test Plan:
Added a
FakeGitHubRepo
totestutil.py
to make it easier to write doctests against this new logic.I also looked for a repo that doesn't use Meta's tooling (so it doesn't have the
Pull Request resolved
line in its commits) and decided to test with https://github.com/google/generative-ai-docs as follows: