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

Default target branch not used to detect changed files or lines

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.4
    • Component/s: Branch & PR, Scanner
    • Labels:
      None
    • Edition:
      Developer
    • Production Notes:
      None

      Description

      Currently, the scanner has no notion of default target branch.
      This information wasn't needed before: if the target branch wasn't specified, it wouldn't be sent to the server and in that case the server would use the main branch as the target branch.

      Now we ask the SCM plugins, on the scanner side, to provide lists of changed files or lines between the current branch and the target branch.
      If the target branch is not provided by the user, we need to figure out what is the default target branch in the scanner so that we can pass it to the SCM plugin.
      Otherwise we won't have a precise information about which files and lines are modified in the branch.

      Implementation

      For short-lived branches (where a CI cannot possibly know the base branch) fall back to the default branch when sonar.branch.target is not specified.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              janos.gyerik Janos Gyerik
              Reporter:
              duarte.meneses Duarte Meneses
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: