commit | ad9efd470ea1867b1a47bac4c82bbdf4756f9dbc | [log] [tgz] |
---|---|---|
author | Patrick Hiesel <hiesel@google.com> | Thu Jan 18 15:16:20 2024 +0100 |
committer | Patrick Hiesel <hiesel@google.com> | Tue Feb 06 08:45:31 2024 +0100 |
tree | c66880c3872ca6507898c7e03d80e4d40b23cee0 | |
parent | abb449f1d433696a8351abb42572340a07fb3300 [diff] |
Move fix-suggestions from RobotComment to Comment With this change, we allow storing fix suggestions with all comment types, not just robot comments. We have deprecated robot comments a while ago. The frontend checks framework allows checkers to provide fix suggestions on demand with check results. This has obsoleted the backend integration. In this change, we mark robot comments as deprecated in Java code. Gerrit already allowed humans to provide fix suggestions by using markdown codeblocks in their comments. This has some limitations, mainly the fact that you can only provide a single suggestion per comment and that suggestion has to be a 1:1 replacement for the range that the comment is tied to. This vastly limits the complexity of the edit that can be represented. A real-world example is that a user could not suggest to call a new util class, as that would mean importing that class (in Java). The robot comment storage for fixes is more elaborate and has good test coverage as well as excellent input validation. RobotComment and HumanComment inherit from the supertype comment. Hence, we uplift the fixSuggestions from RobotComment to Comment. Consequently, they can now be used with draft comments, human comments and robot comments. The main diff of this change come from added test code. We decided to copy some of the robot comments test code instead of trying to generalize it to run on all types of comments beacause otherwise, we'd have to untangle that generalization when we delete the robot comments code. This change adds a new field (fix suggestions) to comments. Comments are serialized as JSON in NoteDb and we ignore unknown fields. So this change should be safe in terms of staged rollout failures. However, to be extra safe, we are creating a follow up change that gates writing the new field by an experiment parameter. The changes will be submitted together. Forward-Compatible: checked Release-Notes: Allow fix-suggestions with human comments Change-Id: I0248d7842f3d742742b983c7b353585ea7dc7056
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.