forked from facebook/sapling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recognize PR# at end of commit title for github_pull_request_* templates
Summary: On GitHub, commits that are squash/merged from pull requests such as facebook/dotslash@4c0563c commonly have the pull request number at the end of the first line of the commit message like so: ``` Document experimental `fetch` subcommand (facebook#24) ``` 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 complete `PullRequestId` object even if it only had the commit number in the commit message. Test Plan: Added a `FakeGitHubRepo` to `testutil.py` to make it easier to write doctests against this new logic. ``` ./tests/run-tests.py ./tests/test-doctest.py ``` 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: ``` $ sl clone https://github.com/google/generative-ai-docs $ cd generative-ai-docs $ /home/mbolin/src/sapling/eden/scm/sl log -T '{node} {github_pull_request_number}\n' --limit 10 d216731f8ab1f2e46da37b62ada121848f1be9e9 375 bc112742515b93e718d9c417203de12fd8786f6a 374 9c91576af5a7b45885ef89858fd3b904501fbb8e 370 45cac496b9a93f4c2251dbe42b0eff71b2a47bc7 360 650a2a48c12ac09a8fe03640f257da6cfac68976 363 576a808e5110dee0d3a9b4456ab8d572c29a8905 359 35e3ae486b2dec7a09952153dda62819a5f4abf2 358 71f9451edc19de37c311906b7f3a689bcacb2bc6 352 da44a67beb8a85bda0e27eb38d5bb8ecec5b26dd 342 955e2842f720fdddb0164d168bc1379470b9b8e9 340 $ /home/mbolin/src/sapling/eden/scm/sl log -T '{node} {github_pull_request_url}\n' --limit 10 d216731f8ab1f2e46da37b62ada121848f1be9e9 https://reviewstack.dev/google/generative-ai-docs/pull/375 bc112742515b93e718d9c417203de12fd8786f6a https://reviewstack.dev/google/generative-ai-docs/pull/374 9c91576af5a7b45885ef89858fd3b904501fbb8e https://reviewstack.dev/google/generative-ai-docs/pull/370 45cac496b9a93f4c2251dbe42b0eff71b2a47bc7 https://reviewstack.dev/google/generative-ai-docs/pull/360 650a2a48c12ac09a8fe03640f257da6cfac68976 https://reviewstack.dev/google/generative-ai-docs/pull/363 576a808e5110dee0d3a9b4456ab8d572c29a8905 https://reviewstack.dev/google/generative-ai-docs/pull/359 35e3ae486b2dec7a09952153dda62819a5f4abf2 https://reviewstack.dev/google/generative-ai-docs/pull/358 71f9451edc19de37c311906b7f3a689bcacb2bc6 https://reviewstack.dev/google/generative-ai-docs/pull/352 da44a67beb8a85bda0e27eb38d5bb8ecec5b26dd https://reviewstack.dev/google/generative-ai-docs/pull/342 955e2842f720fdddb0164d168bc1379470b9b8e9 https://reviewstack.dev/google/generative-ai-docs/pull/340 ```
- Loading branch information
Showing
7 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters