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

Fail analysis when leak period is invalid

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.4
    • Component/s: None
    • Labels:
    • Edition:
      Community

      Description

      Currently, you can set your leak period to a random string, and it will be interpreted as a version, whether or not that version actually exists in your project. A subsequent analysis against that bad leak value results in no leak period.

      Instead, we should fail fast if the leak setting is not one of

      • valid, in-the-past date
      • positive integer (number of days)
      • previous_version
      • an existing project version

      The analysis error should be:

      Invalid new code period. "[leak string]" is not one of: positive integer, date in the past, "previous_version", or version string that exists in the project.

      Because it's currently possible to have projects with empty new code period values, we'll do a DB migration to reset such projects to use previous_version.

        Issue Links

          Activity

          Hide
          ann.campbell.2 Ann Campbell added a comment -

          And I tested the first ticket! #SMH
          Thanks for digging those up Nicolas Bontoux

          Sebastien Lesaint I've updated the description to remove previous_version

          Show
          ann.campbell.2 Ann Campbell added a comment - And I tested the first ticket! #SMH Thanks for digging those up Nicolas Bontoux Sebastien Lesaint I've updated the description to remove previous_version
          Show
          sebastien.lesaint Sebastien Lesaint added a comment - see https://github.com/SonarSource/sonar-enterprise/pull/647
          Hide
          julien.lancelot Julien Lancelot added a comment -

          Reviewed

          Show
          julien.lancelot Julien Lancelot added a comment - Reviewed

            People

            • Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              ann.campbell.2 Ann Campbell
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: