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

Change WS /batch/project to stop referring to modules

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.6
    • Component/s: Scanner, Web API
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      The WS /batch/project currently returns file hashes per modules. For migrated projects that doesn't contain modules, it doesn't make sense.
      For non migrated projects, we should make the WS "emulate" files project relative path, in order to simplify scanner side (no need to keep computing module relative path). Not possible, since module path stored in DB is unreliable.

      For project containing modules, the WS response should stay the same as today.

      For project not containing modules (either migrated, or non modular projects), we should introduce a new attribute to replace the old one:

      Example:

      Before migration:

      /batch/project?key=org.sonarsource.sonarlint.core%3Asonarlint-core-parent

      {
        "timestamp": 0,
        "fileDataByModuleAndPath": {
          "org.sonarsource.sonarlint.core:sonarlint-client-api": {
            "src/main/java/org/sonarsource/sonarlint/core/client/api/exceptions/StorageException.java": {
              "hash": "9e88b54728242f727715b3642d1b5925",
              "revision": "4ceaf5ba89d85f81319df96fc099a325fa572505"
            },
           [...]
          },
          "org.sonarsource.sonarlint.core:sonarlint-slf4j-sonar-log": {
            "src/main/java/org/slf4j/LoggerFactory.java": {
              "hash": "57783a0ea36a92030eed709d32020e9a",
              "revision": "e0e1fd0d1a01167ce96b594332ee2343ad15eea7"
            },
            [...]
          }
        },
        "lastAnalysisDate": 1542719867503
      }
      

      After migration:

      /batch/project?key=org.sonarsource.sonarlint.core%3Asonarlint-core-parent

      {
        "timestamp": 0,
        "fileDataByPath": {
          "client-api/src/main/java/org/sonarsource/sonarlint/core/client/api/exceptions/StorageException.java": {
            "hash": "9e88b54728242f727715b3642d1b5925",
            "revision": "4ceaf5ba89d85f81319df96fc099a325fa572505"
          },
           [...]
          "slf4j-sonar-log/src/main/java/org/slf4j/LoggerFactory.java": {
            "hash": "57783a0ea36a92030eed709d32020e9a",
            "revision": "e0e1fd0d1a01167ce96b594332ee2343ad15eea7"
          },
          [...]
        },
        "lastAnalysisDate": 1542719867503
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michal.duda Michal Duda
                Reporter:
                julien.henry Julien Henry
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: