•  
      request #13741 Can't create Pull Request because same CLOSED PR exists
    Infos
    #13741
    Thibaud FAURIE (blazfhem)
    2019-08-13 14:39
    2019-08-11 23:27
    14929
    Details
    Can't create Pull Request because same CLOSED PR exists
    In PullRequest plugin, script is using Dao.php "function searchByReferences" to search for existing PR but doesn't take care about the fact if yes or not the existing PR is open or closed. That's why I can't create a new PR for already used branches in another closed PR and I can't then use a permanent branches workflow for my git repo. Could it be fixed in hotfix ASAP? Because I'm hard stuck in my work right now.
    Pull Request
    11.4
    EL7 (CentOS|RHEL)
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    New
    Empty
    Attachments
    Tuleap refusing to open the new PR
    References
    References list is empty

    Follow-ups

    User avatar

    Added in include/PullRequest/Dao.php :

    ```
    public function searchOpenByReferences($repo_src_id, $sha1_src, $repo_dest_id, $sha1_dest)
        {
            $sql = 'SELECT *
                    FROM plugin_pullrequest_review
                    WHERE repository_id = ?
                      AND sha1_src = ?
                      AND repo_dest_id = ?
                      AND sha1_dest = ?
                      AND status = ?';

            return $this->getDB()->row($sql, $repo_src_id, $sha1_src, $repo_dest_id, $sha1_dest, 'R');
        }
    ```

    Added in include/PullRequest/PullRequestCreator.php l.150:

    ```
    - $row = $this->pull_request_dao->searchByReferences($repo_src_id, $sha1_src, $repo_dest_id, $sha1_dest);
    + $row = $this->pull_request_dao->searchOpenByReferences($repo_src_id, $sha1_src, $repo_dest_id, $sha1_dest);
    ```

    Seams to be working fine. Need to be done on official releases.

    User avatar
    • Summary
      -Can't create Pull Request because same closed PR exist 
      +Can't create Pull Request because same CLOSED PR exists