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

New code detection when using reference branch and rebasing doesn't detect some commits on branch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.2
    • Fix Version/s: 9.3
    • Component/s: None
    • Labels:
    • Edition:
      Community
    • Production Notes:
      None

      Description

      Consider following git log from branch-1 :

      lukasz.jarocki@DESKTOP-SI99C5G MINGW64 /c/git/discuss9211 (branch-1)
      $ git log -n 3
      commit b5e0737b9aada9a78cb013c39bdb0e5cc38324bf (HEAD -> branch-1)
      Author: Lukasz Jarocki <lukasz.jarocki@sonarsource.com>
      Date:   Thu Nov 25 12:03:21 2021 +0100
      
          bug on branch-1
      
      commit 6d3cd710066984b8c80a7e6090046b06e0148f97 (master)
      Author: Lukasz Jarocki <lukasz.jarocki@sonarsource.com>
      Date:   Thu Nov 25 12:04:45 2021 +0100
      
          Readme
      
      commit d23321fed9798154c6831ce268b76bccea23d779
      Author: Lukasz Jarocki <lukasz.jarocki@sonarsource.com>
      Date:   Thu Nov 25 11:47:06 2021 +0100
      
          init commit
      
      

      The commit Readme has been created after the latest commit on branch-1. And in org.sonar.scanner.repository.ForkDateSupplier#get we detect of a fork point date between master and branch-1
      Thu Nov 25 12:04:45 2021 +0100 . We will use this date later to find all the issues that were introduced on branch-1. But some of the issues were already introduced on this branch before this date (commit bug on branch-1). These issues will not be included in the New Code but they should have been - they are in the end introduced in branch-1 and they are not merged yet to master branch.

      This only applies when we use reference branch New Code policy.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              belen.pruvost Belén Pruvost
              Reporter:
              lukasz.jarocki Łukasz Jarocki
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: