I want to add a "verified" label to my Gerrit project to allow Jenkins to verify that the code builds and passes its tests and so on.
I know I need to add a section to project.config as below:
[label "Verified"]
function = MaxWithBlock
value = -1 Fails
value = 0 No score
value = +1 Verified
However, how do I get to that file to edit it?
The project settings are kept in the Git repository for the project. You can edit them by cloning the project from Gerrit, making the change, committing and pushing back to Gerrit.
You can do this for any project, but if you want it to be inherited by all your projects, which you probably do, use All-Projects as the project.
mkdir gtproj
cd gtproj
git init
git remote add origin ssh://<USER>#<GERRITHOST>:29418/<PROJECT>
git fetch origin refs/meta/config:refs/remotes/origin/meta/config
git checkout meta/config
Then, make the change to the project.config file which will now be in the current directory.
Now, commit the change, and push back to the Gerrit repo:
git commit -a -m "Added label - Verified"
git push origin meta/config:meta/config
And that's it.
If you want to test it: assuming you were actually adding the Verified label, you can check it is working like this. First, make sure the refs/heads/* section of All-Projects (or whichever project you changed above) has Label-Verified -1/+1 set for the relevant groups. This allows the listed groups to verify.
Now, assuming you have a project called MyProject and a patchset reference, say 1,1, to verify:
ssh -p 29418 user#host gerrit review --project MyProject --message "'I just verified this patchset'" --verified +1 1,1
This should return more or less immediately. You should now see in the Gerrit web UI that the user you just logged in as over SSH has left a +1 verified review on that patch.
Credit: Cribbed from this blog post.
You can configure your project config in the Gerrit UI.
You should follow the following steps:
Launch your Gerrit UI.
Login as admin.
Go to projects > and
click List.
Select your project and click Edit config button.
Paste your content and click save.
Related
I created Git Hub account and clone using SSH
I went to Create Git Repositories. I chose both project folders POD and SFITNESS. Then xCode created the following:
Then I right click on SFITNESS and ADD EXISTING REMOTE which I log in to GitHub to provide the link, everything works fine.
When I went to commit, I choose the SFTNESS folder and commit and at the bottom it allows me to Push to remote which I choose the remote at step 3.
Then it will prompt me for the Username and Password and I can never get the authentication correct. The Username and password is it for Github? I can never get the authentication correct?
Now, at the commit window I have lost my SFITNESS folder, how do I commit again? Is it push now?
Need to Add SSH following this link and use SSH as authenthication.
We using gerrit code review tool for code review and verification. Gerrit internally allow to submit code on two criteria 1.Code-Review(-2,-1,0,+1,+2) and 2.Verified(-1,0,+1). I have to add other one my custom criteria to allow submit the code.So how can i achieve this thing.
The Gerrit labels (Code-Review and Verified) are defined in the project.config file of the All-Projects project. Administrators and project owners can define their own labels or customize existing labels by changing the project.config file from the All-Projects project or any other project.
See all information about customized labels on Gerrit documentation.
To change a project.config file do the following:
1) Clone the project (ex: All-Projects)
git clone https://USER#GERRIT-SERVER/a/All-Projects
2) Fetch and checkout the refs/meta/config branch
git fetch refs/meta/config
git checkout FETCH_HEAD
3) Edit the project.config file
EDITOR project.config
4) Add, commit and push to Gerrit
git add project.config
git commit
git push origin HEAD:refs/meta/config
You can also edit the project.config file using the GUI:
Projects > List > SELECT-THE-PROJECT > General > Edit Config
I have installed Gerrit Code Review. Everything is working fine but in the documentation it is unclear how to clone a repository to local directory.
Using Gerrit admin interface I created a new project. How do I know what URL to use? Does Gerrit support https access to repositories?
Go to Gerrit Web UI
Go to the "Projects > List" menu item
Find your project (use the "Filter" field if needed)
Click on the project name
Go to the "General" tab
See the "git clone" command on the top of the page
Choose if you want to clone via "http" or "ssh"
Copy the "git clone" command clicking on the right icon
Paste/execute the "git clone" command
As it turns out this issue is related to SSH/HTTP/Anonymous HTTP Clone URL not visible in Gerrit 2.12.2
I installed in batch mode without plugins. In that case git clone is not there.
Like the Title already says:
I created a Xcode Project and i accidentally disabled : "Create Git Repository"
Does someone know, if i can enable it again ?
I don't want to delete this project and start from the beginning again
This button basically does git init.
So just call git init in your Terminal in the relevant project folder. Afterwards you can add remotes and do commits and pushes. Xcode will recognize the repository automatically.
In the book Ruby on Rails Tutorial Micheal Hartl recommends using the Cloud9 https://c9.io cloud IDE. I created a Bitbucket account, set up Git on the IDE, and installed Rails on Cloud9.
git push -u origin --all and getting error message conq: Repository does not exist.
fatal: could not read from remote repository
please make sure you have the correct access rights and the repository exist.
Log into the Bitbucket website and navigate to the dashboard. On the overview tab, you should see a link like 'john_larkin / hello_app'. Click on the link and you will see the Overview page for this repository. At the top right of the page, you will see an SSH select. The name of your repository appears to the right of that select. It should look something like:
git#bitbucket.org:john_larkin/hello-app.git
In your Cloud9 terminal session for the hello app project, issue the command:
git remote add origin <repo>
replacing <repo> with your repository name from Bitbucket.
Once you do this, you should be able to successfully push your code and updates to your repository.
SSH Key
If you are still experiencing issues, make sure you have successfully loaded your SSH key from your Cloud9 IDE into Bitbucket:
Go to https://bitbucket.org/.
Click on your avatar in the upper right hand corner of the page and select 'Manage account'.
Click on the 'SSH Keys' link under Security on the left side panel.
You should see a key listed there - click on the 'edit' link (if you don't see a key, click on the 'Add key' button to add a new key).
On your Cloud9 IDE, click on your avatar at the top of the screen and select 'Dashboard'. Click on 'Show SSH key' on the right of the screen to view your Cloud9 SSH key. This key should match what appears in the Bitbucket edit view. If it does not or you are unsure, you can always delete this key and create a new key by copying your Cloud9 key into Bitbucket.
I got problem to configure C9 and Bitbucket, but after fighting, i win. So, in the first time, for myself i just delete my repo and my app, i was only on the beginning of creation. If its not your case, im not sure, but if you click (upper left) option to show hidden file and delete the .git, that can probably help.
So, i will enumerate my step that make the connection between C9 and Bitbucket working for me.
In C9
git config --global user.name "Your name"
git config --global user.email "email#exemple.com"
git init
git add -A
git commit -m "Creation of my application"
cat ~/.ssh/id_rsa.pub (take all ssh key except email)
In Bitbucket
Add SSH key in Bitbucket Settings
Create Repository
In C9 add Bitbucket code exemple
git remote add origin git#bitbucket.org:(user info)
git remote -v (to see if its correct)
git push -u origin master
At this stage, all should be pushed to Bitbucket
After to push again your code to Bitbucket
git add -A
git commit -m "Your comment here"
git push
Hope that can help some people.
Create a remote repository, in the web site, before pushing it from your local repository.
I had this issue as well. Make sure you added something to the repository with
git add -A
and then
git add -m "Your message"
Then try to push the repository upstream.