jenkinsci / violation-comments-to-gitlab-plugin

Comments GitLab merge requests with static code analyzer findings.
https://plugins.jenkins.io/violation-comments-to-gitlab
MIT License
20 stars 4 forks source link

Can't add API key #15

Closed teameh closed 6 years ago

teameh commented 6 years ago

Hi,

I'm trying to set up this plugin but I can't add any credentials. The dropdown stays empty.

image

Even after clicking the 'add' button and adding all kids of keys nothing shows up in the list.

The weird thing is that the general git plugin does recognise the credentials and works fine:

image

tomasbjerre commented 6 years ago

What version of Jenkins och what version of the plugin?

teameh commented 6 years ago

Jenkins: 2.89.4 GitLab Plugin: 1.5.5 Violation Comments to GitLab Plugin: 2.0

tomasbjerre commented 6 years ago

Are you selecting Kind as secret text when adding the credential?

teameh commented 6 years ago

Check. That was the only one that I didn't try yet. Thanks that worked.

However it's not clear to me what to put in the other fields:

image

There's no project Id defined in gitlab plugin's https://github.com/jenkinsci/gitlab-plugin#defined-variables

If I just put in the project number (270) and {gitlabMergeRequestIid} as Merge Request Iid i get:

Will comment PR https://xxxxx.xxxxx/ 270 {gitlabMergeRequestIid}
java.lang.NumberFormatException: For input string: "{gitlabMergeRequestIid}"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
tomasbjerre commented 6 years ago

Yes you can hardcode project id. As an integer or a string like: tomas.bjerre85%2Fviolations-test

Ypu are missing the dollar sign in merge request iid.

teameh commented 6 years ago

Yes you can hardcode project id. As an integer or a string like: tomas.bjerre85%2Fviolations-test

Check

Ypu are missing the dollar sign in merge request iid.

Haha yeah noticed it, thanks.

Still failed until i ticked "private token" maybe that needs some documentation.