Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

CheckStyle Pipe not seeing any issues present in xml file Edited

Sample input (fake-php-cs.xml):

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="3.5.8">
<file name="app/Services/NewRelic.php">
<error line="2" column="1" severity="error" message="Missing file doc comment" source="PEAR.Commenting.FileComment.Missing"/>
</file>
</checkstyle>

 

Pipeline:

after-script:
- pipe: atlassian/checkstyle-report:0.2.1
variables:
CHECKSTYLE_RESULT_PATTERN: 'fake-php-cs.xml'
DEBUG: 'true' # please document this flag

 

Pipeline Log Output:

<docker run flags, image pulling, etc>
Submitted report. Response:200 OK
Request URI:http://api.bitbucket.org/2.0/repositories/my/repo/commit/myhash/reports/checkstyle-1
Request Body -------
{"title":"Checkstyle","details":"Checkstyle report","external_id":"checkstyle-1","report_type":"BUG","result":"PASSED","data":[{"title":"Violations","type":"NUMBER","value":0},{"title":"Low Severity","type":"NUMBER","value":0},{"title":"Medium Severity","type":"NUMBER","value":0},{"title":"High Severity","type":"NUMBER","value":0}]}
--------------------
Response Body ------
{"result": "PASSED", "uuid": "{my_uuid}", "title": "Checkstyle", "remote_link_enabled": false, "type": "report", "created_on": "2021-01-19T22:50:47.580890Z", "details": "Checkstyle report", "report_type": "BUG", "updated_on": "2021-01-19T22:50:47.580890Z", "data": [{"title": "Violations", "type": "NUMBER", "value": 0}, {"title": "Low Severity", "type": "NUMBER", "value": 0}, {"title": "Medium Severity", "type": "NUMBER", "value": 0}, {"title": "High Severity", "type": "NUMBER", "value": 0}], "external_id": "checkstyle-1"}
--------------------

 

Report Output:

Screen Shot 2021-01-19 at 2.37.10 PM.png

 

I have tried all variations of relative and absolute path references that I could imagine might work, all resulting in the same empty report.

Please let me know if I missed something. Thanks!

1 answer

1 accepted

0 votes
Answer accepted

Ok, I found the issue.

CHECKSTYLE_RESULT_PATTERN must be in regex form, like so:

CHECKSTYLE_RESULT_PATTERN: '.*/fake-php-cs.xml$'

 A simple path reference will not work.

 

Thank you for making this pipe!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

75 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you