Response: 400 Duplicate annotation id from atlassian/checkstyle-report:0.3.2

Chris Hill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 10, 2022

When submitting an annotation report using atlassian/checkstyle-report:0.3.2 the API returns a Response:400 Bad Request with the message "Duplicate annotation id found in list" (note I set the pipe's DEBUG variable to 'true' to view this output).

Inspecting the request body, there are indeed several duplicate

"external_id" values for the annotation JSON objects being sent.
It would seem this is because the Id calculation does not take into account the column property from the checkstyle-result.xml - e.g. for both of these errors:
<error line="152" column="17" severity="error" message="Missing newline before &quot;)&quot;" source="indent" />

<error line="152" column="18" severity="error" message="Missing newline before &quot;)&quot;" source="indent" />

the same "external_id" value of is calculated. 

Updating the calculation looks like a simple fix:
https://bitbucket.org/atlassian/checkstyle-report/src/9b9fc122542cf8bcbd40c4db9275978497e6185a/src/main/java/com/atlassian/bitbucket/pipelines/checkstyle/report/Main.java#lines-240

 

1 answer

1 accepted

0 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 17, 2022

@Christopher Hill  hi. Thanks for your feedback.

It's a good idea to contribute with your custom pull request with your suggested solution for this pipe.

 

Regards, Igor

Chris Hill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 26, 2022

Thank you @Igor Stoyanov . PR submitted.

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 9, 2022

@Christopher Hill  hi. We released new version 0.4.0 of the checkstyle-report pipe including changes according to your PR.

Regards, Igor.

Like Chris Hill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events