Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70498

Native Analysis Model Format specifies "lineRanges" but does not use them.

      The documentation of the native format specifies an example here: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/steps/issues.json

      When you actually feed the example into Jenkins, all entries below "lineRanges" are ignored and not used.

      ...
      "fileName": "test-file.txt",            
      "lineRanges": [                
        {                    
          "start": 110,                    
          "end": 111                
        },                
        {
          "start": 120,                    
          "end": 121                
        }            
      ],
      ...


      "lineStart" and "lineEnd" are accepted.

      ...
      "fileName": "test.xml",            
      "severity": "ERROR",            
      "lineStart": 110,            
      "lineEnd": 111,            
      "columnStart": 210,            
      "columnEnd": 220,            
      "message": "some message",            
      "description": "some description" 
      ...

       

          [JENKINS-70498] Native Analysis Model Format specifies "lineRanges" but does not use them.

          HSM created issue -
          Ulli Hafner made changes -
          Component/s New: analysis-model [ 23523 ]
          Component/s Original: warnings-ng-plugin [ 24526 ]
          Assignee Original: Ulli Hafner [ drulli ]
          Labels New: help-wanted newbie-friendly
          Shreya made changes -
          Assignee New: Shreya [ yashre_bh ]
          Shreya made changes -
          Comment [ [~bedlad] 
          Hi, I faced this error too after opening up the analysis-model repo in IntelliJ: 

          {{import edu.hm.hafner.analysis.assertions.SoftAssertions;          // I don't see this package anywhere in the directory}}
          {{{}import static edu.hm.hafner.analysis.assertions.Assertions.*;    // I don't see this package anywhere in the directory

          {}}}This issue got resolved after I setup the entire dev environment, though I'm still stuck on the last step of executing jenkins.sh scipt.

          Also, I'm working on this issue already :), please give me some time as I'm new to it and also have classes throughout the day

            ]
          Shreya made changes -
          Comment [ [~drulli] 
          I'm a bit confused (apologies, I'm new to writing Unit tests).

          ```
          softly.assertThat(report.get(0))
          .hasFileName("test-file.txt")
          .hasOnlyLineRanges(new LineRange(110, 111), new LineRange(120, 121))
          .hasCategory("category")
          .hasDescription("description")
          .hasType("type")
          .hasSeverity(Severity.WARNING_LOW)
          .hasMessage("message")
          .hasPackageName("packageName")
          .hasModuleName("moduleName")
          .hasOrigin("origin")
          .hasFingerprint("9CED6585900DD3CFB97B914A3CEB0E79")
          .hasAdditionalProperties("additionalProperties")
          .hasId(UUID.fromString("e7011244-2dab-4a54-a27b-2d0697f8f813"));
          ```



          We know, as the issue descibes, JSONParser does not use multpile line ranges and ignores them, then this test case should already fail right?
          Why is it that we have to fix the test case first?

          One way I think of it is, the test case uses `.hasOnlyLineRanges()`, while as I understand it, it should use `.hasLineRanges()` since multiple line ranges have been specified ]
          Shreya made changes -
          Comment [ do let me know if I'm in the right direction

            ]
          Shreya made changes -
          Comment [ also, what are the steps to reproduce this error on jenkins itself?

            ]
          Shreya made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Shreya made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Ulli Hafner made changes -
          Remote Link New: This issue links to "#884 (Web Link)" [ 28656 ]
          Ulli Hafner made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

            yashre_bh Shreya
            hsm_ci HSM
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: