stable

Clone or download

Read-only

fix: User should be able to abandon broken pull-requests

Implements request #35133 User should be able to abandon broken pull-requests How to test: Without applying this patch, do the following: - Pick up a pull-request, and note its id (can be found in the url) - In the `plugin_pullrequest_git_reference_tab` set `status=2` for the chosen pull-request. At this step, your pull-request should be considered broken - Go to the pull-requests hompage --> You should get a "Pull-request is not accesible anymore" modal - Try to open your pull-request --> You get a "Pull-request is not accessible anymore" modal, the pul-request informations do not load. - Apply the patch, and run `make post-checkout` - Go to the pull-requests hompage --> You are not greeted with an error modal anymore --> There is a notification bubble in the tab's label --> Your pull-request has an [Error] badge - Access your pull-request --> The pull-request informations are loaded --> There is an empty state in the left pane saying "Oops! It seems that your pull-request is broken" --> It contains an [Abandon] button if you have the permission to abandon pull-requests --> The right pane displays an error saying that the git ref is broken --> It only contains a [Abandon] button (if you have the permission) --> There is no [Commits] and [Changes] tabs [0] --> If you try to access these tabs by forging their urls, you get redirected to the overview tab - Abandon the pull-request --> It should succeed --> There is no [reopen] button Change-Id: I41c2c06d8ac986f1ebf2fe43bfe01eb5a008bdee

Modified Files

Name
M plugins/git/include/Git/Repository/View/RepositoryHeaderPresenterBuilder.php +4 −2 Go to diff View file
M plugins/git/include/Git/Repository/View/TabPresenter.php +12 −33 Go to diff View file
M plugins/git/scripts/repository/themes/repository/_repository.scss +5 −0 Go to diff View file
M plugins/git/templates/repository/tabs.mustache +6 −1 Go to diff View file
M plugins/pullrequest/include/PullRequest/Dao.php +18 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/Factory.php +5 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/GitReference/BypassBrokenGitReferenceCheck.php +46 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/NavigationTab/NavigationTabPresenterBuilder.php +4 −2 Go to diff View file
A plugins/pullrequest/include/PullRequest/REST/v1/BrokenGitReferenceCheck.php +45 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestMinimalRepresentation.php +11 −6 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestRepresentation.php +1 −1 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestWithGitReferenceRetriever.php +14 −6 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestsResource.php +40 −15 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/RepositoryResource.php +11 −2 Go to diff View file
M plugins/pullrequest/scripts/lib/rest-api-types/src/pull-request.ts +1 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/po/fr_FR.po +13 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/PullRequestChangeStateActions.test.ts +5 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/PullRequestChangeStateActions.vue +8 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/abandon/PullRequestAbandonButton.test.ts +24 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/abandon/PullRequestAbandonButton.vue +4 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/abandon/PullRequestAbandonedState.vue +5 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/merge-status-helper.test.ts +31 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/merge-status-helper.ts +4 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/merge/PullRequestMergeButton.test.ts +15 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/merge/PullRequestMergeButton.vue +5 −1 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Errors/PullRequestBrokenGitRefErrorEmptyState.vue +66 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Labels/PullRequestLabels.test.ts +21 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Labels/PullRequestLabels.vue +5 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/OverviewPane.vue +12 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/OverviewTabs.test.ts +42 −12 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/OverviewTabs.vue +24 −6 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Reviewers/PullRequestReviewerList.test.ts +11 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Reviewers/PullRequestReviewerList.vue +3 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Title/PullRequestEditTitleModal.test.ts +9 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Title/PullRequestEditTitleModal.vue +5 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/po/fr_FR.po +3 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/dashboard/pull-request-summary/PullRequestLabelsList.test.ts +1 −22 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/dashboard/pull-request-summary/PullRequestLabelsList.ts +4 −4 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/dashboard/pull-request-summary/pull-request-summary-controller.js +1 −6 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/dashboard/pull-request-summary/pull-request-summary-controller.test.js +2 −28 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/dashboard/pull-request-summary/pull-request-summary.tpl.html +6 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/pull-request/pull-request-controller.js +7 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/pull-request/pull-request-controller.test.js +42 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/pull-request/pull-request-service.js +5 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/window-helper.ts +4 −0 Go to diff View file
M plugins/pullrequest/site-content/fr_FR/LC_MESSAGES/tuleap-pullrequest.po +3 −0 Go to diff View file
M plugins/pullrequest/site-content/pt_BR/LC_MESSAGES/tuleap-pullrequest.po +3 −0 Go to diff View file
A plugins/pullrequest/tests/unit/GitReference/BypassBrokenGitReferenceCheckTest.php +38 −0 Go to diff View file
A plugins/pullrequest/tests/unit/REST/v1/BrokenGitReferenceCheckTest.php +117 −0 Go to diff View file
M plugins/pullrequest/tests/unit/REST/v1/PullRequestWithGitReferenceRetrieverTest.php +31 −8 Go to diff View file