How to block +2 Label Code-Review for commit Uploader in Gerrit - gerrit

Recently I've blocked +2 Label Code-Review permissions for change owner in my project repository. It's quite straight forward, since there is a predefined global group in Gerrit for change owner, so the access rule looks like this:
label-Code-Review = block -2..+2 group Change Owner
However, if developer uploads new patch set to someone's else commit, the owner remains unchanged (which is right), and the one who uploaded patch set becomes "Uploader", and as a side effect he gets +2 rights, since they are blocked only for "Change Owner"
Is there a way in Gerrit to block +2 rights for "Uploader"?
Thanks in advance.
UPD: I'm using Gerrit 2.14

Related

How to promote a Gerrit draft submission to a regular code-review submission

A colleague sent me a Gerrrit code review "draft" (I suppose via "refs/drafts/master" instead of "refs/for/master") and then left on holiday. Without downloading the patch and submitting it myself, how can I promote his draft to a full regular code-review so I can approve it & submit it for merging?
I think this is a similar question, but it's for git-review, not Gerrit. Also I'm interested in doing it from the Gerrit web GUI if at all possible. And I don't see a "Publish" button on my Gerrit web GUI for that draft. (And currently it doesn't say anything about merge conflicts, as long as I hurry....)
If I click on the "Patch Sets" link in the top right of the GUI, this is what I see:
In the top left it says "Change 58358 - Draft", and in the middle of the window it shows this:
Only the change owner can publish a draft patch set. Using the UI's cherry-pick option as described in other answers won't work because the cherry-pick implementation preserves the draft status on the new change or patch set.
As far as I know the only way to force the change into NEW state is to manually download the commit and push a new patch set using refs/for/master instead of refs/drafts/master.
Note that if you're not rebasing the change onto a new parent at the same time, you might need to slightly edit the commit message to make gerrit accept it. Otherwise it'll reject with no new changes.
If your colleague add you as reviewer, you can. You can cherry-pick this commit.
Click on download link at the right-top corner, and there are aliases for commands above.
But as you updated your question, you don't want to check out and manually push or cherry pick to master branch. You can use cherry-pick\merge button on ui, if you are confident in this mr, and it should be on master branch. Also you can publish this commit for other reviewers.
p.s. updated (you can cherry-pick, merge, publish via UI)
Do the following procedure:
1) Go to the draft change page
2) Click on Cherry Pick button
3) Write "master" in the Cherry Pick to Branch field
4) Adjust the Cherry Pick Commit Message if needed
5) Click on Cherry Pick Change button
It'll be created a NEW CHANGE cherry-picked from the draft change. Go to the new change page and follow the regular Gerrit process (review, approve, submit). The original draft change can be abandoned or deleted.

Upload patch set preserving existing reviews

We use Jenkins to verify patch sets. Sometimes Jenkins needs do some changes on the patch set. So it commit --amend the changes and then uploads the new patch set.
It work nicely besides the fact, that all manual reviews made to the original patch set get erased.
How can I push a new patch set (from Jenkins) without loosing all existing reviews/votes?
Be aware that, in the situation you have described, you have a new patchset and, excluding in special situations, you don't want votes of the old patchset copied forward to the new patchset. For example: if someone have approved the patchset1 and Jenkins pushes the patchset2, probably he/she doesn't want to have his/her vote automatically copied to patchset2.
Said that: you can control how votes will/won't be copied forward to new patchset setting the label.LABEL-NAME.copyXXXXX options of the project. See more info in Gerrit documentation here.

In TFS Online, How do I share a code branch with our customer

We have an enterprise customer that we have delivered a system for. It is part of the agreement for us to supply them with the source code of the latest release. We are using TFVC on TFS online, and we thought it would be easiest to give them access to our Main branch. But I have difficulties with only allowing them to access the code and nothing else. The user I am testing with, can see too much: I.e. things like dashboard, current team members etc.
Is it possible for me to only expose code from the Main branch and nothing else to an external user?
Giving access to TFS Main Branch out of Organization (AD) is not advisable considering security.. Instead consider giving source code into zip format there are lot of large file sending (FTP sites) are available..
Still for your request of restricting access to user have a look over this
https://www.visualstudio.com/en-us/docs/setup-admin/restrict-access-tfs
you can consider replicating your part of source code into separate stream and give reader read only access to that stream.
Hope this helps... :)
Refer to these steps to set the permission:
Add user to your VSTS (Basic)
Remove this user from all group if you added
Go to admin page of a team project Version Control (Setting > Version Control)
Select a folder/branch
Click Add > Add User to add that user
Select the user that you added
Set Read permission to Allow
Go to Security page (click Security)
Click Create group to create a new group
Set View project-level information to Allow and deny other permissions for this group
Click Members of that new group
Click Add to add that user to this group
After that, this user can access the code (Just the folder/branch the user has the read permission) on web access (Code > Files).

Leave a repository on bitbucket

Last year, I was working with some other people on a computer science project. So, I created a bitbucket repository and invited everybody. As we know each other very well, everybody is an administrator of the repository and I'm the owner.
Today, I would like to clean up my bitbucket repository list. But, I can't find how to leave a repository. When I go in the settings menu, the only thing that I can do is "deleting a repository". It's not what I want to do because I want to leave the repository for the other people.
For some repository (when I'm not the owner), I can revoke myself, but for the other, I can't. Do you know how can I do that? I would like to find a solution without needing to make a ownership transfer as it involves making a transfer request and then, waiting some time to get the answer.
Thank you
Go to 'Your profile and Settings' left bottom corner & Tap 'All work spaces'
Tap 'Leave'
I would like to find a solution without needing to make a ownership transfer as it involves making a transfer request and then, waiting some time to get the answer.
Somebody must own the repository, and you can't leave a repository that you own.
You could create a team and transfer the repository there, then invite the other users to the team. Transferring your repo to a team you create should be instantaneous.
Or you can transfer the repository to an existing user and wait for them to respond, as you have suggested.
Workaround:
Disable "New source browser experience" in here: https://bitbucket.org/account/user//features/
Then click "revoke" in here: https://bitbucket.org///overview

Rename a job in jenkins

How to go about renaming a job in jenkins?
Is there another way than to create a new job and destroying the old one?
In Jenkins v2, in your dashboard or job overview, click right button on the job and select rename:
In the version we're running (1.480) it is simply a matter of changing the Project name in the Configure menu and hitting Save afterwards.
Cheers,
In New Jenkins, Click Rename link present in the left navigation pane, Update the job name and click save.
Simply change the name in the Pipeline/Project name and hit save.
Note that if your browser window isn't wide enough the "popup" below will be offscreen so make sure you scroll down or your jobs may mysteriously not rename.
"Are you sure about renaming old-job to new-job?"
Use the "Configure" option to the left:
Example showing Configure option
(Sorry, first few posts so I'm not able to post images in directly yet!)
If you can't see this then make sure you have access rights - in other words, you may need to be logged in, and you will need privileges that allow you to administer that job/pipeline.

Resources