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

Analysis of a short-living branch fails due to New Code Period version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 7.6
    • Fix Version/s: 7.7
    • Component/s: Branch & PR
    • Labels:
      None
    • Edition:
      Developer
    • Production Notes:
      None

      Description

      Case 1:

      Steps to reproduce:

      • Run SonarQube with DEBUG logs enabled
      • Run first analysis of a project
      • Create a long-living branch, analyze it twice, and assign versions to the analyses, for example long_1, long_2
      • Analyze the main branch twice, assign versions to the analyses, for example prod_1 and prod_2
      • Set New Code Period on the main branch to prod_1 (the older)
      • Set New Code Period on the long branch to long_1 (the older)
      • Analyze a short branch based targeting the long one => OK
      • Run the same analysis again=> FAILS

      SonarQube UI will show a message like "Invalid new code period. 'prod_1' is not one of ..." and the CE logs will show something like:

      DEBUG ce[AWcRggiX8ji-HOUzwHCX][o.s.c.t.p.s.LoadPeriodsStep] Resolving new code period by version: prod_1
      DEBUG ce[AWcRggiX8ji-HOUzwHCX][o.s.c.t.p.s.LoadPeriodsStep] Invalid code period 'prod_1': version is none of the existing ones: [long_2]
      INFO ce[AWcRggiX8ji-HOUzwHCX][o.s.c.t.s.ComputationStepExecutor] Load new code period | status=FAILED | time=5ms
      

      Do note the "Resolving new code period by version: prod_1", which seems non-sense in the context of analyzing a short-living branch.

       

      Case 2:

      Steps to reproduce:

      • Analyze master with version prod_1
      • Analyze master with version prod_2
      • Set New Code Period on master to prod_1 version (the older)
      • Analyze a short lived branch targeting the master => OK
      • Run the same analysis again => FAILS

        Attachments

          Activity

            People

            Assignee:
            janos.gyerik Janos Gyerik
            Reporter:
            janos.gyerik Janos Gyerik
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: