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

Detection of inactive projects should take into account branches and PRs

    XMLWordPrintable

    Details

    • Edition:
      Developer
    • Production Notes:
      None

      Description

      Assume a user that wants to make sure that old projects are not bloating his SonarQube instance, so he wants to clean up everything where the latest analysis is older than three months. But he has some projects where short-lived branches are being actively analysed, but the master (which holds the release) isn’t analysed for a period longer than three months.

      Quite reasonably, he wants his cleanup mechanism to leave these projects alone since they’re actually active.

      But,

      • the project management page doesn't take into account analyses on branches
      • the analyzedBefore parameter to api/projects/search and api/projects/bulk_delete isn’t branch-aware: it only looks at the analysis date of the main branch.

       

      So the following changes are done with this ticket:

      • The analyzedBefore parameter for api/projects/search and api/projects/bulk_delete applies to all branches and PRs, meaning that all analysis in all branches/PRs of the projects returned were done before the date.
      • The field lastAnalysisDate in the projects returned is the last analysis date across all branches and PRs of the project
      • The field revision is unchanged. It's the revision of the last analysis of the main branch

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duarte.meneses Duarte Meneses
              Reporter:
              ann.campbell.2 Ann Campbell
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: