infer icon indicating copy to clipboard operation
infer copied to clipboard

How to intergrate Infer's analysis result into Phabricator?

Open sencho opened this issue 9 years ago • 10 comments

We uses Infer static analyze tool of Facebook and want to know which API could use to post the result to Phabricator,thank you.

sencho avatar Jun 21 '17 17:06 sencho

We don't have an open source API for that yet I'm afraid. We may work on that in the next few months. For now, you would need to start from the report.json and build the integration.

dulmarod avatar Jun 21 '17 17:06 dulmarod

Phabricator does not accept the feature PR, then how can deliver it as soon as possible ?

sencho avatar Jun 21 '17 17:06 sencho

Sorry I can't help you with that, we use a version of Phabricator that is internal to Facebook, so we haven't tried sending them PRs.

dulmarod avatar Jun 22 '17 09:06 dulmarod

Would you share your plan how to realize in this case.would provide a fork version?

sencho avatar Jun 23 '17 12:06 sencho

You can use the conduit API to talk to Phabricator, for instance to send one inline comment for each infer report on a diff.

jvillard avatar Jun 23 '17 12:06 jvillard

@jvillard ,I have seen the Phabricator API,the matter is Infer JSON format reporter fields is not match ,in this case it do not work unless reassembled the JSON data by tools jq . I guess in the Facebook workflow is not the case, the normal should be generated Infer JSON format report can be sent directly to the Phabricator API, and this API you are private, is that so? I have a suggestion, can Infer generate a public version of the API can be used directly to the JSON format?

sencho avatar Jun 23 '17 20:06 sencho

@sencho: What is the CI tool your are using? Infer will generate a JSON report in some Infer specific format and this report is not intended to be consumed directly by Phabricator (even though the idea is interesting). However, the analysis script that is running on the CI can read the Infer report and then use the Phabricator conduit API to create error messages for the code review tools.

jeremydubreil avatar Jun 24 '17 20:06 jeremydubreil

@jeremydubreil ,I’m using GItLab CI,I think a static analysis tool is best to provide a set of CI solutions, especially static analysis tools rely on the machine to complete the work, should be automatically executed by the computer, CI analysis of the results to the code review tool.

sencho avatar Jun 25 '17 02:06 sencho

@sencho: I am not sure I understand you comment. Is having the possibility for Phabricator to load the Infer reports directly what you are suggesting here?

jeremydubreil avatar Jun 26 '17 01:06 jeremydubreil

img @jeremydubreil

I recommend infer to provide an JSON data format for phabricator API, commenting on the results of the analysis. Mayber as #674 said,Infer could provide a option like --phabricator-json,output a json report ,then CI can use this json post to phabricator API.

sencho avatar Jun 26 '17 02:06 sencho