Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15312

Jenkins tutorial must guide user to correctly configure pull/merge request discovery

    XMLWordPrintable

    Details

    • Edition:
      Community
    • Production Notes:
      None

      Description

      Currently, when instructing our users to set up a branch source for a Multibranch Pipeline, after instructing how to set up the Behavior, we state:

      You can leave the other settings at the defaults.

      However, this could lead to problems with pull/merge requests, and our detection of new code.

      Tutorial

      We must update the Behavior step, as follows:

      GitHub and Bitbucket:

      • Behavior:
        • Discover branches: select "Exclude branches that are also filed as PRs".
        • Discover pull requests from origin: select “The current pull request revision”.
        • Specify ref specs:
          • By default, this behavior is not active. If you do not see it, click on Add to see the list of available behaviors, and select "Specify ref specs".
          • In order to correctly compute new code for pull requests, the scanner will need the refs of the target branch. Make sure the Ref Spec value will include any target branches (the default value should be enough). Example:
            +refs/heads/*:refs/remotes/@{remote}/*

      GitLab:

      • Behavior:
        • Discover branches: select "Only branches that are not also filed as MRs".
        • Discover merge requests from origin: select “The current merge request revision”.
        • Specify ref specs:
          • By default, this behavior is not active. If you do not see it, click on Add to see the list of available behaviors, and select "Specify ref specs".
          • In order to correctly compute new code for merge requests, the scanner will need the refs of the target branch. Make sure the Ref Spec value will include any target branches (the default value should be enough). Example:
            +refs/heads/*:refs/remotes/@{remote}/*

      Documentation

      We should remove the troubleshooting guide Detecting changed code in Pull Requests in analysis/jenkins. If the configuration, as specified above, is correct, the errors we help to troubleshoot should no longer appear.

        Attachments

          Activity

            People

            Assignee:
            wouter.admiraal Wouter Admiraal
            Reporter:
            wouter.admiraal Wouter Admiraal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: