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

Provide a tagging mechanism for Rules

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2
    • Component/s: Rules
    • Labels:
      None

      Description

      The purpose is to help classifying rules.

      From a functional point of view, the main points:

      • There are 2 kind of tags:
        • SYSTEM tags: they are set on rules by language plugins and are immutable
        • ADMIN tags: they are set on rules by user who have the "Administer Quality Profiles" permission, and can be updated and deleted
      • In "Quality Profile > Coding Rules" page, it should be possible to:
        • see the tags on a rule
        • tag a rule (provided the user has the "Administer Quality Profiles" permission):
          • with an existing tag - found with auto-completion
          • if the auto-completion finds no tag, offer the possibility to create it
        • search for rules that have 1 or several specific tag

      From a technical point of view:

      1. Tags must be stored in the SQL DB (so that ES index can be rebuilt at each startup)
        • RULE_TAGS table with rule_id, tag and type (SYSTEM|ADMIN) columns (and rule_id+tag constraint as a being unique)
      2. An API to get/set/add/remove tags on a rule must be defined:
        • It must be available to language plugins which define rules ("set")
        • It must be available through the Java Facade for the front-end ("get", "add", "remove")
      3. At startup:
        • Rules must be updated (in DB) with their system tags (rules must not have twice the same tag)
        • Rules must be indexed in ES with their tags
          • "rule" document with "systemTags" and "adminTags"
        • Tags must be indexed in ES to provide auto-completion
          • No dedicated index for the tags (maybe later if required)
      4. In the "Quality Profile > Coding Rules" page, display the tags for each rules
      5. In the "Quality Profile > Coding Rules" page, when adding/removing a tag on a rule:
        • The rule must be reindexed
        • The list of available tags must be updated
      6. In the "Quality Profile > Coding Rules" page, add a new criteria that allows to search for tags

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              freddy.mallet Freddy Mallet (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: