commit | 5f36047c1e3b87486a3b2c83413dd65a28469c2e | [log] [tgz] |
---|---|---|
author | Youssef Elghareeb <ghareeb@google.com> | Tue May 11 20:31:32 2021 +0200 |
committer | Youssef Elghareeb <ghareeb@google.com> | Tue May 11 20:31:32 2021 +0200 |
tree | 80e10f3e2ab496ae20967461709b59f42f65d31e | |
parent | 29b17822ec0829e0705c2df3261530d3ac542664 [diff] |
CommentJson fix: URL decode comment id before requesting comment context This issue affected a small number of changes, especially old ones, e.g. Ic60bacd528 and resulted in 500 - Internal server error when calling the comments API with comment context enabled. We request comment context as a post-step in CommentJson after computing the CommentInfo entities. When building CommentInfo entities, we URL encode the comment uuid (see [1]). We use those uuids to create the comment context keys, ending up in not being able to locate those uuids in NoteDb and failing in CommentContextCacheImpl#Loader. For example, we try to lookup a uuid="AAAFUH%2F%2F%2Fcs%3D", but the actual comment in NoteDb has uuid="AAAFUH///cs=". In this change, we URL decode these uuids before creating the comment context keys to fix this issue. We should request comment context with correct comments uuids. [1] https://gerrit.googlesource.com/gerrit/+/485fb21e09fa8ff5d32a1a4aec419b421b20b545/java/com/google/gerrit/server/restapi/change/CommentJson.java#206 Change-Id: I3b71e8289b41fe98ba1aee34c6e77002d37a64a7
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 8 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-centos8
To run a Ubuntu 20.04 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-ubuntu20
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.