Migrate has:draft to read changes from All-Users repository

This is a step towards removing draft information from the index. Now
that we remove the usage of drafts stored in the index, we can remove
that information from the index as a follow-up.

Performing this migration is helpful to avoid excessive reindexing which
causes high latency for modifying draft comments. Currently, each time
a draft comment is modified we are forced to reindex the change (so that
we update the draft comments of the change in the index).

We could inject CommitsUtil to ChangePredicate but it's a large refactor
so we refrain from it in this change.

For now, we only enable this feature using a flag. By default the flag
is set to false. This is useful to enable an easier migration, and we'll
only finish this change once the blockers are finished for the upstream
community (either implementation of RefCache in JGit, or a different
solution). According to tests, upstream will have around 400ms
regression for loading the dashboard with this change.

Alternative to RefCache is something frontend oriented: Cache control in
the browser. That has some downsides:
1. We need to split the requests (Get drafts, get all other things).
2. Caching makes staleness possible.

Anyway, we are leaning towards RefCache in JGit, but this is of course
not in scope for this change, and this change is non-breaking since it
just introduces a flag.

Zombie comments is another issue here. When searching for drafts via
All-Users repository, zombie drafts can't be filtered since to check
whether a draft comment is a zombie, we need to check whether it exists
in the repository (which takes too long). We should ensure zombie drafts
are not a concern before rollout.

Change-Id: Iba2284a7586b4f2d4b05c9b40315a6d617605511
8 files changed
tree: 3ba53c116a31d6bc03b772ac46ceafd0ab21dbf6
  1. .settings/
  2. .ts-out/
  3. antlr3/
  4. contrib/
  5. Documentation/
  6. e2e-tests/
  7. java/
  8. javatests/
  9. lib/
  10. modules/
  11. plugins/
  12. polygerrit-ui/
  13. prolog/
  14. prologtests/
  15. proto/
  16. resources/
  17. tools/
  18. webapp/
  19. .bazelignore
  20. .bazelproject
  21. .bazelrc
  22. .bazelversion
  23. .editorconfig
  24. .git-blame-ignore-revs
  25. .gitignore
  26. .gitmodules
  27. .gitreview
  28. .mailmap
  29. .pydevproject
  30. .zuul.yaml
  31. BUILD
  32. COPYING
  33. INSTALL
  34. Jenkinsfile
  35. package.json
  36. README.md
  37. SUBMITTING_PATCHES
  38. version.bzl
  39. WORKSPACE
  40. yarn.lock
README.md

Gerrit Code Review

Gerrit is a code review and project management tool for Git based projects.

Build Status Maven Central

Objective

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.

Documentation

For information about how to install and use Gerrit, refer to the documentation.

Source

Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.

Reporting bugs

Please report bugs on the issue tracker.

Contribute

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.

Getting in contact

The Developer Mailing list is repo-discuss on Google Groups.

License

Gerrit is provided under the Apache License 2.0.

Build

Install Bazel and run the following:

    git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
    cd gerrit && bazel build release

Install binary packages (Deb/Rpm)

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>]

Use pre-built Gerrit images on Docker

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.