commit | 2794dd53c0346bf102b5146c5446e8201e5879a5 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Tue Jun 08 23:06:20 2021 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Fri Jun 11 09:01:15 2021 +0000 |
tree | 294a0b178343fff55358e6352d9daaf436e4c1b9 | |
parent | 8c741b0c81d2f8e80d4e874390e87b6d69ede802 [diff] |
LocalUsernamesToLowerCase: manage duplication automatically When having two external-ids that are different just in their case, the LocalUsernamesToLowerCase should automatically remove one of them and only keep the lowercase version. Example for the same account id: gerrit:MyUsername gerrit:MyUSERNAME The above two external-ids would have caused a DuplicateExternalIdKeyException which is not helpful as both identities are the same and associated with the same account id and have the same associated property values: - email - password Automatically remove one of the two (or more) identities in conflict and display a warning message explaining what has just happened and how the situation has been managed transparently. NOTE: The duplicates that are getting removed are identical once they are converted to lowercase. The ones that are getting deleted are not relevant: the only thing that is important is that only one of them is kept, as all the others are identical. To test this change: Positive use-case: -- Before the LocalUsernamesToLowerCase execution: [externalId "gerrit:johndoe"] accountId = 1000000 email = john@doe.org [externalId "gerrit:JohnDoe"] accountId = 1000000 email = JOHN@doe.org After the LocalUsernamesToLowerCase execution, there is a single entry: [externalId "gerrit:johndoe"] accountId = 1000000 email = john@doe.org OR [externalId "gerrit:johndoe"] accountId = 1000000 email = JOHN@doe.org Negative use-cases: [externalId "gerrit:johndoe"] accountId = 1000000 [externalId "gerrit:JohnDoe"] accountId = 1000000 email = JOHN@doe.org The LocalUsernamesToLowerCase execution fails with a duplicated ids exception and no changes are made on the external ids. [externalId "gerrit:johndoe"] accountId = 1000000 [externalId "gerrit:JohnDoe"] accountId = 1000001 The LocalUsernamesToLowerCase execution fails with a duplicated ids exception and no changes are made on the external ids. Bug: Issue 14645 Change-Id: I9832fbf0c8df947aab5494325169b9c726e40019
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recurse-submodules https://gerrit.googlesource.com/gerrit cd gerrit && bazel build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 7 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-centos7[:version]
To run a Ubuntu 15.04 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-ubuntu15.04[:version]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.