diff --git a/pkg/cmd/pr/view/view.go b/pkg/cmd/pr/view/view.go index 91087d74b..a37568741 100644 --- a/pkg/cmd/pr/view/view.go +++ b/pkg/cmd/pr/view/view.go @@ -170,7 +170,7 @@ func printHumanPrPreview(opts *ViewOptions, pr *api.PullRequest) error { cs := opts.IO.ColorScheme() // Header (Title and State) - fmt.Fprintln(out, cs.Bold(pr.Title)) + fmt.Fprintf(out, "%s #%d", cs.Bold(pr.Title), pr.Number) fmt.Fprintf(out, "%s • %s wants to merge %s into %s from %s • %s %s \n", shared.StateTitleWithColor(cs, *pr), diff --git a/pkg/cmd/pr/view/view_test.go b/pkg/cmd/pr/view/view_test.go index 78d588f1e..82a4a4e95 100644 --- a/pkg/cmd/pr/view/view_test.go +++ b/pkg/cmd/pr/view/view_test.go @@ -350,7 +350,7 @@ func TestPRView_Preview(t *testing.T) { "PullRequestByNumber": "./fixtures/prViewPreview.json", }, expectedOutputs: []string{ - `Blueberries are from a fork`, + `Blueberries are from a fork #12`, `Open.*nobody wants to merge 12 commits into master from blueberries.+100.-10`, `blueberries taste good`, `View this pull request on GitHub: https://github.com/OWNER/REPO/pull/12`, @@ -363,7 +363,7 @@ func TestPRView_Preview(t *testing.T) { "PullRequestByNumber": "./fixtures/prViewPreviewWithMetadataByNumber.json", }, expectedOutputs: []string{ - `Blueberries are from a fork`, + `Blueberries are from a fork #12`, `Open.*nobody wants to merge 12 commits into master from blueberries.+100.-10`, `Reviewers:.*1 \(.*Requested.*\)\n`, `Assignees:.*marseilles, monaco\n`, @@ -382,7 +382,7 @@ func TestPRView_Preview(t *testing.T) { "ReviewsForPullRequest": "./fixtures/prViewPreviewManyReviews.json", }, expectedOutputs: []string{ - `Blueberries are from a fork`, + `Blueberries are from a fork #12`, `Reviewers:.*DEF \(.*Commented.*\), def \(.*Changes requested.*\), ghost \(.*Approved.*\), hubot \(Commented\), xyz \(.*Approved.*\), 123 \(.*Requested.*\), Team 1 \(.*Requested.*\), abc \(.*Requested.*\)\n`, `blueberries taste good`, `View this pull request on GitHub: https://github.com/OWNER/REPO/pull/12`, @@ -395,7 +395,7 @@ func TestPRView_Preview(t *testing.T) { "PullRequestByNumber": "./fixtures/prViewPreviewClosedState.json", }, expectedOutputs: []string{ - `Blueberries are from a fork`, + `Blueberries are from a fork #12`, `Closed.*nobody wants to merge 12 commits into master from blueberries.+100.-10`, `blueberries taste good`, `View this pull request on GitHub: https://github.com/OWNER/REPO/pull/12`, @@ -408,7 +408,7 @@ func TestPRView_Preview(t *testing.T) { "PullRequestByNumber": "./fixtures/prViewPreviewMergedState.json", }, expectedOutputs: []string{ - `Blueberries are from a fork`, + `Blueberries are from a fork #12`, `Merged.*nobody wants to merge 12 commits into master from blueberries.+100.-10`, `blueberries taste good`, `View this pull request on GitHub: https://github.com/OWNER/REPO/pull/12`, @@ -421,7 +421,7 @@ func TestPRView_Preview(t *testing.T) { "PullRequestByNumber": "./fixtures/prViewPreviewDraftState.json", }, expectedOutputs: []string{ - `Blueberries are from a fork`, + `Blueberries are from a fork #12`, `Draft.*nobody wants to merge 12 commits into master from blueberries.+100.-10`, `blueberries taste good`, `View this pull request on GitHub: https://github.com/OWNER/REPO/pull/12`, @@ -501,7 +501,7 @@ func TestPRView_tty_Comments(t *testing.T) { "ReviewsForPullRequest": "./fixtures/prViewPreviewReviews.json", }, expectedOutputs: []string{ - `some title`, + `some title #12`, `1 \x{1f615} • 2 \x{1f440} • 3 \x{2764}\x{fe0f}`, `some body`, `———————— Not showing 9 comments ————————`, @@ -521,7 +521,7 @@ func TestPRView_tty_Comments(t *testing.T) { "CommentsForPullRequest": "./fixtures/prViewPreviewFullComments.json", }, expectedOutputs: []string{ - `some title`, + `some title #12`, `some body`, `monalisa • Jan 1, 2020 • Edited`, `1 \x{1f615} • 2 \x{1f440} • 3 \x{2764}\x{fe0f} • 4 \x{1f389} • 5 \x{1f604} • 6 \x{1f680} • 7 \x{1f44e} • 8 \x{1f44d}`,