Jenkins doesn't verify/review change on Gerrit - jenkins

I'm trying to configure a local installation of Jenkins to review uploaded changes on Gerrit. So far, I've gotten Jenkins to detect uploaded changes and build them (using Gerrit Trigger). However, while the build concludes successfully on Jenkins, it doesn't post any reviews on Gerrit, even though it is configured to do so. Interestingly, in Gerrit change history, I can see Jenkins having started a build:
Jenkins Patch Set 1: Build Started http://localhost:8080/job/TestProject/70/
but that's it. No results are shown after this, like successful conclusion of the build etc. Since I can see the build started result, I'm assuming I've configured the review settings correctly, but something else is causing a hold up. I've checked in the Gerrit error_log file and it doesn't show any errors. What maybe the issue?
By the way I've been able to verify/review the code as jenkins using the command line.

To make code verification possible, you have to go through the following steps:
Allow label “Verified” on Gerrit server (also see here or here);
Read this and make sure your job configured properly, because you will not build latest changesets instead;
Give access to labels Code-Review and Verified in your Gerrit project for user Jenkins;

I was able to resolve this by adding the 'Verified Label' to the Gerrit Server. The version of Gerrit I used (2.11.3) explicitly asks you to install the Verified Label, and the default option is set at No and as a result I didn't install it. I simply reinstalled my Gerrit, this time choosing Yes on Install Verified Label. If you're facing this issue, simply reinstall your Gerrit. If re-installation is not an option, read this:
http://blog.bruin.sg/2013/04/how-to-edit-the-project-config-for-all-projects-in-gerrit/

Some basic information can be found also in Jenkins plugin
Create the profile through in Gerrit web interface for your Jenkins user, and set up a SSH key for that user.
Gerrit web interface > Admin > Groups > Non-Interactive Users > Add your jenkins user.
Admin > Projects > ... > Access > Edit
Reference: refs/*
Read: ALLOW for Non-Interactive Users
Reference: refs/heads/*
Label Code-Review: -1, +1 for Non-Interactive Users
Label Verified: -1, +1 for Non-Interactive Users

Related

unable to see "ADE" option under "Source Code Management" in Jenkins

I have setup a new Jenkins instance in docker.
Now am trying to create a new job. But the problem that am facing is my Source Code is in ADE.
But under "Source Code Management" i see only 2 options: 1) None 2) Git.
I dont see "ADE" option.
Is there any Plugin for ADE in jenkins?
Please do help
I worked at Oracle for some months and I used ade. Since ADE is a propietary SCM from Oracle, it is fully integrated in Oracle products. As far as I know, ADE can´t be integrated with jenkins natively but I think you could create a transaction in your jenkins server. When you need to build in jenkins, you would need to pull the transaction on your machine to the jenkins server. If you can set an observer or listener in jenkins when something changes in your transaction then trigger the build.
I am not sure if this can help you.
I have installed Jenkins in a docker container hosted on my Linux machine. Now the problem am facing is that I am unable to login to my Jenkins instance(UI) as my Unix\Linux user.
When i navigate to "Manage Jenkins >> Security >> Configure Global Security", under "Security Realm", I see an option called "Unix user/group database". If i select that option its asks(prompts) for "Service Name". I enter "sshd" and then click on "Test" button. On doing so it gives the below error: "User ‘jenkins’ needs to belong to group shadow to read /etc/shadow".
I am not sure how to fix it as am very new to docker as well as jenkins. Finally what i want to achieve is "i want to be able to login using my Unix\Linux credentials".

After giving initial admin password in jenkins to Unlock Jenkins i am getting issue

As i am trying to install Jenkins on cloud server and i installed that but after installation when it is asking for the /var/lib/jenkins/secrets/initialAdminPassword i am providing that also but after that i should get a plugin page but i am directly coming into Jenkins home page.
I have tried the installing jenkins again but still i am getting this below error.
Jenkins root URL is empty but is required for the proper operation of many Jenkins features like email notifications, PR status update, and environment variables such as BUILD_URL.
Please provide an accurate value in Jenkins configuration.
can any one tell me why this happening.enter image description here

Not able to see Manage Jenkins option on Jenkins

I was able to see standard Jenkins dashboard (configuration dashboard). Suddenly after a couple of logins, the manage Jenkins option is gone. All that I see is \People
Build History
Credentials
I am not able to spin builds or make changes. How can I make sure that all those options come back. I have tried uninstalling and reinstalling as well. Appreciate your response.

How can i use Jenkins with Atlassian Stash?

I've just setup Jenkins and i have some Repositories in my Stash.
I installed the "Git plugin" in jenkins.
I can now enter the repository url but there is nothing to enter my credentials.
It's possible using
http://username:password#mydomain/xx/yy.git
but that is something i dont want to do.
What else can i do to authenticate?
I am the author of this stash plugin that might help you: https://github.com/palantir/stashbot
Taking selectively from the readme:
To work with Jenkins, you MUST install the following jenkins plugins first.
Jenkins GIT plugin
Post build task
Next, build and install the plugin using the plugin SDK (more details in the readme)
Next, the stash admin goes into the Stashbot Admin page and creates a jenkins server config - here you give it the URL, username/password, etc details of the jenkins server.
Next, for each repository a "Stashbot CI Admin" link shows up for repo admins. From there you can check the "enabled" checkbox and tell it what branches you want build (via a regex) and what command it should run to do the build (optionally verifies and publishes).
After this point, the remainder is completely self-service. Any repo admin can ask for their project to "have CI" by filling out that form, and the jobs will automatically be created in the jenkins server.
Hope that helps.
Set up an SSH key for the user that runs your Jenkins builds and add it to the repository's SSH keys in Stash. See the Stash docs for instructions.
Two things to add to Gareth's answer.
While I agree that using SSH keys are definitely better than hard-coding the username/password, it's worth mentioning that Stash (currently) scales better with HTTP when it comes to CI. If you have quite a few builds we generally recommend using HTTP. We are currently extending our Git cache support to support SSH so this no longer an issue.
Somewhat related, you might be interested in watching and voting for the following feature which will make it easier to create CI specific keys.
Lastly having build icons show up in Stash is surprisingly handy, and you should have a look at the following plugin if you haven't already:
https://github.com/jenkinsci/stashNotifier-plugin
Since version 2.0 of "Git Plugin" for jenkins you should be able to directly add the required credentials for both ssh and username/password (based on credentials plugin).
See changelog of Git plugin: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Changelog for details.
For further integration of git and stash regarding pull requests you additionally need the "Stash Webhook for jenkins" add-on in stash and the "Stash Notifier" plugin for jenkins to connect each other.

Gerrit trigger install for Jenkins

I'm completely stuck with Gerrit Trigger install. I installed Jenkins ver. 1.482 with the Gerrit Trigger (v2.6.0) plugin. I'm not able to configure it.
I installed a test gerrit server (v2.4.2). I have an admin user. I tried to configure Gerrit Trigger to use this access to build patches (this is a test system, I didn't want to bother to add real users).
In Gerrit Trigger options I configured gerrit access. Test connection button says conection is ok. Although I get The connection to Gerrit is not started yet. Check the Gerrit URL in the settings. warning on the top. I also tried to push restart at the bottom.
I've read documentation on both Hudson and Jenkins page of the plugin. I'm still unable to configure the plugin.
Do you have any idea what's wrong?
Probably Click the button to Save after testing, this is common mistake that you forget to save it !! I met this several times
See more explanation in https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger
Otherwise it is not clear what's your problem since this is a normal case.

Resources