GitHub Pull Request Decoration: Doesn't work if 'provider' or token as command line 'properties'?

github
scanner
pull-request

(Alix Lourme) #1

Hello,

I’m trying to configure the GitHub pull request analysis & decoration on SonarCloud.

The pull request analysis works fine (I have the result in SonarCloud), but the decoration doesn’t start, some properties seems required:

[DEBUG] 12:05:04.997 'GitHub Pull Request Issue Publisher' skipped because one of the required properties is missing

My command line is:

mvn sonar:sonar \
    -Dsonar.host.url=https://sonarcloud.io \
    -Dsonar.organization=axel3rd-github \
    -Dsonar.login=******* \
    -Dsonar.pullrequest.provider=github \
    -Dsonar.pullrequest.github.endpoint=https://api.github.com \
    -Dsonar.pullrequest.github.token.secured=******* \
    -Dsonar.pullrequest.github.repository=yandex-qatools/teamcity-openstack-plugin \
    -Dsonar.pullrequest.branch=pull/30 \
    -Dsonar.pullrequest.key=30

I have tried GitHub as provider (in some internet sample) or add sonar.pullrequest.base=master optional property … but no change :frowning: .

All my properties are inline (and not filled in SonarCloud UI), could be the root cause of problem ?

Could the exhaustive list of required properties for GitHub pull request decoration shared ? (here or code link) ?

Many thanks for help or tips.
Besty regards


(Alix Lourme) #2

The DEBUG line refers to “previous” GitHub Plugin (sonar.github.pullRequest property required in this case, cf. PullRequestIssuePostJob & GitHubPlugin) … so title of thread should be updated.


(Janos Gyerik) #3

What do you mean by “but the decoration doesn’t start” ? What are you expecting exactly? Do you have a link to the pull request in SonarCloud?

The parameters you specified look correct to me, except some redundant ones that shouldn’t have any effect and can be safely removed: sonar.pullrequest.github.token.secured and sonar.pullrequest.github.endpoint

PS: I didn’t understand your second message. If you want to change the first message text, you can edit it yourself. I suggest to do that if needed and delete the second message.


(Alix Lourme) #4

Hello janos,

Thanks for your reply.

PS: I didn’t understand your second message. If you want to change the first message text, you can edit it yourself. I suggest to do that if needed and delete the second message.

My first analysis was perhaps confused with GitHub plugin usage, so I have update title.

What do you mean by “but the decoration doesn’t start” ? What are you expecting exactly? Do you have a link to the pull request in SonarCloud?

As I understand the Pull Request Analysis, it has two feature:

  1. Analyse the pull request (cf. TeamCity build) to provide the result in SonarCloud. This point works fine (see result)
  2. Decorate the GitHub pull request (as the GitHub plugin), to add a check into GitHub pull request (with details of issues if there are some), and refuse the merge if some issues.

The [2] doesn’t work. I have not any SonarCloud comment/check/… in GitHub pull request #30.

But perhaps I’m disturbed with documentation, and I should use GitHub plugin if I want something into GitHub pull request.

Best regards


(Alix Lourme) #5

After some tests, the properties for Pull Request Decoration (the ones available in SonarCloud UI project settings : sonar.pullrequest.provider, sonar.pullrequest.github.token.secured, …) can’t be in command line properties, they should be filled in SonarCloud UI.

It would be logic, because SonarCloud interacts with the pull request after the analysis, for sample when you update the status of issue …


(Alix Lourme) #6

NB: title updated, linked to the root cause


(Maxwell) #7

I am having the same issue as you, I have tried to not set the properties in the UI and use the SonarCloud github APP and i get the error:

‘GitHub Pull Request Issue Publisher’ skipped because one of the required properties is missing

Then I tried to set all the properties in the ui and I still get the same error.

Cant get the github integration working. =/


Github Pull Request decoration not working with the plugin
(Alix Lourme) #8

Hello,

Synthesis of properties used in my project:

These one should be on build (command line properties, …):

sonar.host.url
sonar.organization
sonar.login=[theToken]
sonar.pullrequest.branch
sonar.pullrequest.key

These one should not be on build and filled via SonarCloud UI:

sonar.pullrequest.provider
sonar.pullrequest.github.endpoint
sonar.pullrequest.github.token.secured
sonar.pullrequest.github.repository

No other ideas about why analysis could fail …
Best regards


(Maxwell) #9

Thanks Alex, it started worked when i changed my token, I just didn;t understand why i have to provide a token if i have installed the plugin/application on github.

Anyway thanks very much.