From a39c96d490f3443cd53022f85c7860937859b1fc Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 09 2017 10:37:17 +0000 Subject: Document what to do in case of inaccessible pull-requests With this commit we create a new section in the documentation about troubleshootings in general. Our first item is what to do when a pull-request becomes inaccessible because the target branch no longer exists. --- diff --git a/doc/usage.rst b/doc/usage.rst index 134c4ec..023648e 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -44,3 +44,4 @@ Contents: usage/upgrade_db usage/pagure_ci usage/quick_replies + usage/troubleshooting diff --git a/doc/usage/trouble/_static/inaccessible_pr.png b/doc/usage/trouble/_static/inaccessible_pr.png new file mode 100644 index 0000000..ea5bbde Binary files /dev/null and b/doc/usage/trouble/_static/inaccessible_pr.png differ diff --git a/doc/usage/trouble/inaccessible_pr.rst b/doc/usage/trouble/inaccessible_pr.rst new file mode 100644 index 0000000..bb92229 --- /dev/null +++ b/doc/usage/trouble/inaccessible_pr.rst @@ -0,0 +1,46 @@ +Inaccessible pull-requests +========================== + + +The symptoms +------------ + +When trying to open a pull-request, if you run into this error: + +:: + + The branch into which this pull-request was to be merged: XXX seems to + no longer be present in this repo + +(Where ``XXX`` is a branch name). + +.. image:: _static/inaccessible_pr.png + :target: _static/inaccessible_pr.png + +(Here ``XXX`` is ``m2``). + +This means that the pull-request was opened against a branch on your repo and +that this branch no longer exists. +Pagure is therefore unable to compute the diff between of the pull-request. + +The pull-request is thus inaccessible but remains in the list of open +pull-requests. + + +The solution +------------ + +The easiest solution to solve this problem is to re-create the target branch +in your repo. + +This can be done using git simply by doing: + +:: + + git checkout -b + git push + +It will create the branch named ```` in pagure, allowing the +diff to be computed for that pull-request and thus allowing it to be +displayed. It is then up to you to see if this pull-request is still relevant +and should be merged or closed. diff --git a/doc/usage/troubleshooting.rst b/doc/usage/troubleshooting.rst new file mode 100644 index 0000000..2b662fc --- /dev/null +++ b/doc/usage/troubleshooting.rst @@ -0,0 +1,12 @@ +Troubleshooting +=============== + +This page lists some of the potential issues one may have in pagure as well +as their solution(s). + +Contents: + +.. toctree:: + :maxdepth: 1 + + trouble/inaccessible_pr diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 8a47677..6068563 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1284,8 +1284,8 @@ def diff_pull_request( if request.branch not in orig_repo.listall_branches(): raise pagure.exceptions.PagureException( - 'The branch into which this pull-request was to be merged : %s ' - 'seems to no longer present in this repo' % request.branch) + 'The branch into which this pull-request was to be merged: %s ' + 'seems to no longer be present in this repo' % request.branch) if not repo_obj.is_empty and not orig_repo.is_empty: # Pull-request open