Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues are falsely reported with SonarQube 10.4 #155

Open
SR4ven opened this issue Apr 15, 2024 · 1 comment
Open

Fixed issues are falsely reported with SonarQube 10.4 #155

SR4ven opened this issue Apr 15, 2024 · 1 comment
Labels

Comments

@SR4ven
Copy link

SR4ven commented Apr 15, 2024

Jenkins and plugins versions report

Environment
Jenkinss Version: 2.440.2
Sonar Gerrit Version: 385.v890738eeff15
SonarQube 10.4.1 Enterprise

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows on controller and Linux agent

Reproduction steps

  1. Make changes to code with SonarQube issues. The issues will be reported and commented by the plugin in Gerrit.
  2. Fix the issue. The issue will be marked as "Closed (Removed)" in the new SonarQube PR view.
  3. The issue will still be commented in the patchset by the sonar-gerrit plugin.

Expected Results

No more report/comment in the patchset for the fixed issue.

Actual Results

Closed issue is still being falsely reported and commented.

Anything else?

Calling api/issues/search?componentKeys=test-project&pullRequest=1234 returns something like this:

{
  "total": 8,
  "p": 1,
  "ps": 100,
  "paging": {
    "pageIndex": 1,
    "pageSize": 100,
    "total": 8
  },
  "effortTotal": 30,
  "issues": [
    {
      "key": "3cdd3192-fbaa-404f-9248-f003d42c3b56",
      "rule": "cpp:S5359",
      "severity": "MAJOR",
      "component": "test-project:src/TestFile.cpp",
      "project": "test-project",
      "hash": "1061db2910c7b4f3ea27e7902c6c52ff",
      "textRange": {
        "startLine": 105,
        "endLine": 105,
        "startOffset": 8,
        "endOffset": 29
      },
      "flows": [
        {
          "locations": [
            {
              "component": "test-project:src/TestFile.cpp",
              "textRange": {
                "startLine": 105,
                "endLine": 105,
                "startOffset": 8,
                "endOffset": 14
              },
              "msg": "Left operand should have type \u0027bool\u0027.",
              "msgFormattings": []
            }
          ]
        },
        {
          "locations": [
            {
              "component": "test-project:src/TestFile.cpp",
              "textRange": {
                "startLine": 105,
                "endLine": 105,
                "startOffset": 18,
                "endOffset": 29
              },
              "msg": "Right operand should have type \u0027bool\u0027.",
              "msgFormattings": []
            }
          ]
        }
      ],
      "resolution": "REMOVED",
      "status": "CLOSED",
      "message": "\"||\" left and right operands should have type \u0027bool\u0027.",
      "effort": "10min",
      "debt": "10min",
      "assignee": "someperson",
      "author": "somemail",
      "tags": [
        "misra-c++2008"
      ],
      "creationDate": "2024-03-28T10:31:23+0000",
      "updateDate": "2024-04-02T16:45:52+0000",
      "closeDate": "2024-04-02T16:45:52+0000",
      "type": "BUG",
      "pullRequest": "84224",
      "scope": "MAIN",
      "quickFixAvailable": false,
      "messageFormattings": [],
      "codeVariants": [],
      "cleanCodeAttribute": "CLEAR",
      "cleanCodeAttributeCategory": "INTENTIONAL",
      "impacts": [
        {
          "softwareQuality": "RELIABILITY",
          "severity": "MEDIUM"
        }
      ],
      "issueStatus": "FIXED"
    },
    ...
  ],
  "facets": []
}

My guess is that the status and issueStatus fields are not checked.

Are you interested in contributing a fix?

No response

@SR4ven SR4ven added the bug label Apr 15, 2024
@SR4ven
Copy link
Author

SR4ven commented May 17, 2024

@reda-alaoui do you have a clue as to where the missing checks should be implemented? Then maybe I can contribute a fix myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant