Hi,

Was this ever resolved?  I am also not seeing Gerrit as an option in the 
Pipeline -> SCM list



On Thursday, March 11, 2021 at 6:56:35 AM UTC-8 Ali Raza wrote:

> Can it be the problem with the port which the gerrit trigger plugin for 
> ssh?
>
> On Wed, Mar 10, 2021 at 6:28 PM Ali Raza <[email protected]> wrote:
>
>> Yes, I am using the  “G errit Code Review” plugin v0.4.4. 
>>
>> [image: gerrit.jpg]
>>
>> On Wed, Mar 10, 2021 at 6:22 PM Luca Milanesio <[email protected]> 
>> wrote:
>>
>>>
>>>
>>> On 10 Mar 2021, at 17:19, Ali Raza <[email protected]> wrote:
>>>
>>> I am not getting gerrit option in the dropdown but surprisingly it able 
>>> to clone the code from repo and jenkins script from another repo both 
>>> hosted on gerrit. It even is able to build the docker using the jenkins 
>>> build script.
>>>
>>>
>>> That is weird: have you installed the “Gerrit Code Review” plugin v0.4.4?
>>> https://plugins.jenkins.io/gerrit-code-review/
>>>
>>> If yes, it should provide a Gerrit SCM and it should be visible in the 
>>> list of options.
>>>
>>> Luca.
>>>
>>>
>>> <gerrit.jpg>
>>>
>>>
>>>
>>> On Wednesday, 10 March 2021 at 17:23:20 UTC+1 [email protected] 
>>> wrote:
>>>
>>>>
>>>> On 10 Mar 2021, at 16:12, Ali Raza <[email protected]> wrote:
>>>>
>>>> One thing I forgot to mention is that same job is working on another 
>>>> server with the same setting. When we migrated it to a new server it start 
>>>> having the problem. So all of the environment variables and script were 
>>>> working on the previous server. We have many other jobs which are not 
>>>> using 
>>>> multibranch pipelines that is why it will be bit challenging to move them 
>>>> on multibranch pipeline. 
>>>>
>>>> I am using git/https as a SCM source(https://GERRIT_BASE_URL/a/PROJECT 
>>>> <https://gerrit_base_url/a/PROJECT>) and passing the username and 
>>>> password inside the credentials.
>>>>
>>>>
>>>> I believe the Gerrit Code Review plugin assumes the SCM source is a 
>>>> Gerrit SCM (not Git SCM) and it may fail to access the credentials there.
>>>>
>>>> Luca.
>>>>
>>>>
>>>> <gerrit.jpg> 
>>>>
>>>> On Wednesday, 10 March 2021 at 16:13:11 UTC+1 [email protected] 
>>>> wrote:
>>>>
>>>>>
>>>>> On 10 Mar 2021, at 15:02, Luca Milanesio <[email protected]> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On 10 Mar 2021, at 14:58, Ali Raza <[email protected]> wrote:
>>>>>
>>>>> Yes, it is triggering on gerrit code changes and cloning the 
>>>>> repository as well but when it is trying to execute ' gerritReview' 
>>>>> command. The code inside my pipeline script where i am having problem is 
>>>>> gerritReview labels: ['Unit-test': 1]
>>>>>
>>>>> It is a plain pipeline job not a multibranch pipeline.
>>>>>
>>>>>
>>>>> Gotcha, that isn’t really the use-case that the Gerrit Code Review 
>>>>> plugin has been designed for.
>>>>>
>>>>> There are some environment variables that the plugin expects to be set:
>>>>>
>>>>> https://github.com/jenkinsci/gerrit-code-review-plugin/blob/master/BUILD.md#using-environment-variables
>>>>>
>>>>> As you can see, the list is quite big :-(
>>>>> All of them are automatically set when you run in a multi-branch 
>>>>> pipeline, otherwise you may need to set them manually.
>>>>>
>>>>>
>>>>> One question: what type of Git SCM source URL are you using?
>>>>> Git/HTTP or Git/SSH?
>>>>>
>>>>> Can you share the settings?
>>>>>
>>>>> Luca.
>>>>>
>>>>>
>>>>> I know that the Gerrit Trigger Plugin sets some of them, but you 
>>>>> should cross-check them.
>>>>>
>>>>> HTH
>>>>>
>>>>> Luca.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Mar 10, 2021 at 3:39 PM Luca Milanesio <[email protected]> 
>>>>> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On 10 Mar 2021, at 14:35, Ali Raza <[email protected]> wrote:
>>>>>>
>>>>>> Yes, I have added SCM credentials to my pipeline settings. Inside 
>>>>>> repository URL I also have ''/a/'' prefix. 
>>>>>>
>>>>>>
>>>>>> Cool, and you confirm that the clone works as expected.
>>>>>>
>>>>>>
>>>>>> Do i need to add SSH keys which I have added to 'gerrit trigger' 
>>>>>> plugin settings somewhere inside Gerrit server?
>>>>>>
>>>>>>
>>>>>> Why do you use the Gerrit Trigger plugin? Isn’t this a multi-branch 
>>>>>> pipeline?
>>>>>>
>>>>>> Luca.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wednesday, 10 March 2021 at 15:19:15 UTC+1 [email protected] 
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>> On 10 Mar 2021, at 13:31, Ali Raza <[email protected]> wrote:
>>>>>>>
>>>>>>>   Hi
>>>>>>> I am using the Gerrit trigger plugin with Jenkins which is working 
>>>>>>> fine but along with it i am also using the Gerrit Code Review plugin. I 
>>>>>>> am 
>>>>>>> calling 'gerrit review' command inside my pipeline script but getting 
>>>>>>> an 
>>>>>>> error 'Gerrit Review requires authentication, however there are no 
>>>>>>> credentials defined or are empty'
>>>>>>>
>>>>>>>
>>>>>>> Have you defined the credentials in the Gerrit SCM connection in the 
>>>>>>> multi-branch pipeline job?
>>>>>>> Also remember to use the ‘/a/‘ prefix for the Gerrit SCM URL, 
>>>>>>> otherwise the access won’t be authenticated.
>>>>>>>
>>>>>>> Example:
>>>>>>> Https://review.mycompany.com/a/myrepo 
>>>>>>> <https://review.mycompany.com/a/myrepo>
>>>>>>>
>>>>>>> HTH
>>>>>>>
>>>>>>> Luca.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I am not sure from where the Gerrit review is getting the 
>>>>>>> credentials. On the other hand, the Gerrit trigger plugin is getting 
>>>>>>> triggered and executing the build process but when it reaches the 
>>>>>>> 'gerrit 
>>>>>>> review' command it is having an authentication error.
>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "Jenkins Users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>> send an email to [email protected].
>>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/jenkinsci-users/96f09b40-b415-4e18-969f-89d4915bec36n%40googlegroups.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/96f09b40-b415-4e18-969f-89d4915bec36n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Jenkins Users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/jenkinsci-users/92a69011-4126-43cb-b8fe-7df9dbaa7328n%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/92a69011-4126-43cb-b8fe-7df9dbaa7328n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Jenkins Users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/jenkinsci-users/E810633F-1943-4AD9-A0F7-8A089D728E46%40gmail.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/E810633F-1943-4AD9-A0F7-8A089D728E46%40gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> Regards
>>>>>
>>>>> Ali Raza Alvi
>>>>> Software Engineer
>>>>> Contact No. +46793456480 <+46%2079%20345%2064%2080>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Jenkins Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>>
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jenkinsci-users/58f41d12-ba9e-4e48-a276-3054ab763fd5n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/58f41d12-ba9e-4e48-a276-3054ab763fd5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> <gerrit.jpg>
>>>>
>>>>
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/973682c2-d161-45f8-97e6-57c87fa33106n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/973682c2-d161-45f8-97e6-57c87fa33106n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> <gerrit.jpg>
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/9E17F8D9-0B9F-43F4-ABDD-C3B362F5CD72%40gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/9E17F8D9-0B9F-43F4-ABDD-C3B362F5CD72%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Regards
>>
>> Ali Raza Alvi
>> Software Engineer
>> Contact No. +46793456480 <+46%2079%20345%2064%2080>
>>
>
>
> -- 
> Regards
>
> Ali Raza Alvi
> Software Engineer
> Contact No. +46793456480 <+46%2079%20345%2064%2080>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8ca6c6e9-37a2-433a-a86f-ecba986225f5n%40googlegroups.com.

Reply via email to