How to analyze a project via web api?

hey folks
I am using sonarqube community edition and I want to analyze a project with web api when a pull request has created on gitea
I think I should use
POST api/project_analyses/create_event
but I dont know how to get Analysis key ?
Is this method right?


Welcome to the community!

Sorry, but Community Edition doesn’t support pull request analysis. That starts in Developer Edition($).


1 Like

Hey ann
thanks for your response
Currently I am using gitea as git server
I have another question too, if I buy Datacenter edition, Is it possible to analyze project by pull request in gitea too?


First, Community Edition to Data Center edition is an enormous jump. You can analyze pull requests in supported DevOps platforms from Developer Edition, which is probably a better starting place for using commercial editions.

But regarding Gitea, we don’t have any specific integrations for it - in any edition. So I guess PR decoration is probably off the table for you.


Thanks again
So you mean even if I use any other edition, I can not analyze project with pull request as long as I am using GITEA?

I have another question too, when I want to get back analyze answer in jenkins pipeline
I use these two commands but I can not get a proper answer

curl -GET “http://sonar.server/api/qualitygates/project_status?projectKey=my-project” | json_pp
curl -u -GET “http://sonar.server/api/issues/search?pretty/pageSize=500&componentKeys=my-project=10&p=1” | json_pp

First command doesnt show quality gate state properly and it says just ok or some error, and the second one is bunch of unnecessary items

is there any right way to see project analyze brief and status on jenkins pipeline?


You can certainly analyze pull requests. But you won’t get the fancy in-app PR decoration that’s available with other platforms, e.g. GitHub &etc.

For Quality Gate status, take a look at webhooks.