How to find new violations for particular rule id using rest api?
Summary on what I am trying to do:
During the pull request we want to find new violations by comparing target and base builds. We have list of rules IDs checked in code in yaml file. If any new violations are from those rule IDs then we plan to fail the build. that is why we need api to get the information and not in the browser.
json that it returns have violationed id and unbranchedViolation id (which I don't understand what that means). But the problem is:
1) It gives me fixed + new violations. In that json there is not way to figure out which one is new and which one is fixed. We want to fail build for new violations only (fixed violations are good to have).
2) It just gives me violations ID and I could not figure out a way to find rule ID that it is attached to. I tried providing violations ID to resources api but still it does not give me rule ID.
3) I need to find out how to get api key to access api's. Because passwords cannot be checked in code.
Any help on above 3 mentioned points will be highly appreciated.