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

Data inconsitency on table projects

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.12
    • Fix Version/s: 3.0
    • Component/s: Database
    • Labels:
      None

      Description

      Hi,
      By navigating to the time machine of a project one of our sonar users ran into a problem when he wanted to browse the data for an old event.
      By selecting the old event in the dropdown of the timemachine he received the well known "We're sorry, but something went wrong." website.

      After some analysis this timemachine problem seems to be caused by a data inconsistency on Sonar project level.

      Let's assume a maven reactor with the root pom com.test:root:0.0.1.
      That pom references a module com.test:parent:0.0.1 and this parent references two modules.

      Here the structure:
      ----------------------------------------
      com.test:root:0.0.1
      -->com.test:parent:0.0.1
      ------>com.test:Module1:0.0.1
      ------>com.test:Module2:0.0.1

      If that reactor is reported to sonar, a new project "root" is created and visible in the sonar project overview.

      Among others, this is reflected in the project table of sonar.

      project name id root_id scope qualifier
      com.test:parent 1481 1490 PRJ BRC
      com.test:root 1490 NULL PRJ TRK

      Now the Decision is done to get rid of the pom com.test:root:0.0.1 but just use the pom com.test:parent:0.0.1 as parent

      Here the structure:
      ----------------------------------------
      com.test:parent:0.0.1
      -->com.test:Module1:0.0.1
      -->com.test:Module2:0.0.1

      If that reactor is reported to sonar, a new project "parent" is created and visible in the sonar project overview.
      But the before reported project "root" is also still visible in the sonar project overview.
      If a user accesses now the timemachine of that old project "root" he is receives data from the project "parent" which don't fit anymore.

      The project table in sonar is changed now to the following:

      project name id root_id scope qualifier
      com.test:parent 1481 1490 PRJ TRK
      com.test:root 1490 NULL PRJ TRK

      Here the issue is now that "com.test:parent" and "com.test:root" are both marked as root projects by the qualifier TRK. But "com.test.root" has still a root_id which points to the project "com.test:root".

      This seems to be a data inconsistency. But maybe I'm wrong because I'm not a Sonar DB Schema expert.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fabemn OLD - Fabrice Bellingard
              Reporter:
              matthias.vach Matthias Vach
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: