Download: 3.1.3 | 3.1.2 | 3.1.1 | 3.1.0

Documentation: 3.1.3 | 3.1.2 | 3.1.1 | 3.1.0

Release Highlights

  • Support for git protocol v2

  • Polymer 2

  • Mandatory plugins

  • Performance logging and tracing

See the New Features section for further details.

Important Notes

Schema Changes

This release does not contain any schema changes. To upgrade:

  java -jar gerrit.war init -d site_path

Breaking Changes

The reviewdb.client package is renamed to entities

Plugins or extensions that import classes from the com.google.gerrit.reviewdb.client package must change the imports to com.google.gerrit.entities.

Changed APIs for Id and NameKey classes

Plugins and extensions that instantiate and use classes such as Account.Id, Change.Id, Project.NameKey, Branch.NameKey, etc, must adapt to the following changes.

  • The classes can no longer be instantiated with the new operator. Instead they must be created with static factory methods.

    • new Account.Id(...) –> Account.id(...)
    • new AccountGroup.Id(...) –> AccountGroup.id(...)
    • new AccountGroup.UUID(...) –> AccountGroup.uuid(...)
    • new Branch.NameKey(...) –> BranchNameKey.create(...)
    • new Project.NameKey(...) –> Project.nameKey(...)
  • ‘Getter’ methods are now generated by the auto-value library and no longer have the get prefix.

    • Account.getName() -> Account.name()
    • …etc

REST API endpoint implementations must return Response<T>

REST API endpoint implementations must now return a Response object that explicitly sets a status code. Plugins that currently only return an Object must be adapted to the new interface.

Powermock and Easymock are removed

The Powermock and Easymock libraries are no longer exported in the acceptance-framework artifact, and are replaced by Mockito. Plugins that use Powermock and/or Easymock in their tests should either add explicit dependencies, or migrate the tests to Mockito.

Polymer 2 and Shadow DOM may break JavaScript plugins

The Gerrit frontend has been migrated from Polymer 1 to Polymer 2 and to using Shadow DOM. This may break JavaScript plugins, e.g. if they use document.getElementById() to reach into the DOM. Instead, plugins will have to use dedicated plugin endpoints together with calling plugin.registerCustomComponent.

Browser Support

Internet Explorer is not supported. Major browsers are supported for the following versions and newer: Firefox 68, Chrome 76, Safari 12.1.

Legacy support for pushing to refs/drafts/ is removed

The change.allowDrafts configuration option is removed, and it is no longer possible to push new changes or patch sets to refs/drafts/<branch-name>.

Support for pushing to refs/changes/ is removed

The receive.allowPushToRefsChanges configuration option is removed, and it is no longer possible to add a new patch set to a change by pushing to refs/changes/<change number>.

JGit Configuration is no longer read from system level .gitconfig

JGit’s configuration options are now read from the $site/etc/jgit.config file rather than the system level .gitconfig.

New limit on the number of change meta updates

Many NoteDb operations require walking the entire change meta ref and loading its contents into memory, so changes with arbitrarily many updates may cause high CPU usage, memory pressure, persistent cache bloat, and other problems.

A new configuration option change.maxUpdates allows to set the maximum number of updates that are allowed.

container.slave is renamed to container.replica

The container.slave option is still recognized as an alias of container.replica but is deprecated and will be removed in a future release.

The MessageOfTheDay extension point is removed.

The MessageOfTheDay functionality was not ported to the PolyGerrit-UI and the MessageOfTheDay extension point was removed with the 3.1.3 release. However, the JS API provides the banner entrypoint for plugins to add messages to the UI. Plugins that were previously using the MessageOfTheDay extension point have to be adapted accordingly.

New Features

Git Protocol V2

Git protocol V2 is now enabled by default. A new permission-aware ref database ensures that Gerrit only ever returns refs that the calling user has access to.

Mandatory Plugins

It is possible to configure which plugins are mandatory. Gerrit will fail to start if a mandatory plugin cannot be loaded.

Disabling and restarting of a mandatory plugin is rejected, but reloading of a mandatory plugin is still possible.

Replication plugin

  • Issue 11196: Latency metric is now recorded also at a project level, only when the latency was greater than a configured threshold, configurable in replication.config

New option to limit options used when rendering internal events.

The new option event.payload.listChangeOptions allows to configure which options are used when rendering internal events. This can be used to reduce performance impact of rendering many options.

Performance logging and tracing

See the documentation for full details.

REST APIs

  • Accounts

    • The DETAILS query option on the query accounts endpoint now includes the status and state fields in the response.
  • Changes

    • New SKIP_DIFFSTAT option for the query changes endpoint.

      Computation of the insertions and deletions fields may be expensive for large trees. The new SKIP_DIFFSTAT option allows to omit it from the result.

    • New exclude-groups option on the Suggest Reviewers endpoint.

    • New optional commit-message field on the input for cherry-pick endpoints.

      If the optional message is provided, it is used, otherwise the message from the cherry-picked change is used.

    • New optional topic field on the input for the revert endpoint.

      If the optional topic is provided, it is used, otherwise the topic from the reverted change is used.

  • Config

  • Projects

    • New endpoint: Update dashboard.

      The new endpoint currently only works for the default dashboard.

Bug Fixes

  • Issue 5082: Fix internal server error when getting blame for removed/replaced file.

  • Issue 11918: Fix internal server error when deleting a ref by git push.

  • Issue 12246: Fix generation of duplicate Change-Ids when creating a new change via REST.

    The Change-Id was computed from the commit content and the timestamp, which resulted in the possibility for two changes to get the same Change-Id when two empty changes were created by REST at the same time.

    The Change-Id is now generated randomly.

Dependency Updates

  • Remove easymock, powermock and javassist from the acceptance framework

  • Remove promise-polyfill

  • Add mockito in the acceptance framework

  • Upgrade Apache sshd and mina-core to 2.3.0

  • Upgrade auto-value to 1.7

  • Upgrade bouncycastle to 1.61

  • Upgrade commons-compress to 1.18

  • Upgrade gitiles-servlet and blame-cache to 0.3-6

  • Upgrade jetty to 9.4.18.v20190429

  • Upgrade JGit to v5.5.1.201910021850-r-152-g63fc6970c

  • Upgrade polymer to 2.7.2

    • Upgrade polymerelements/iron-autogrow-textarea to 2.2.0

    • Upgrade polymerelements/iron-dropdown to 2.2.1

    • Upgrade polymerelements/iron-icon to 2.1.0

    • Upgrade polymerelements/iron-iconset-svg to 2.2.1

    • Upgrade polymerelements/iron-input to 2.1.3

    • Upgrade polymerelements/iron-overlay-behavior to 2.3.4

    • Upgrade polymerelements/iron-selector to 2.1.0

    • Upgrade polymerelements/iron-test-helpers to 2.0.1

    • Upgrade polymerelements/test-fixture to 3.0.0

    • Upgrade polymerelements/paper-button to 2.1.3

    • Upgrade polymerelements/paper-input to 2.2.3

    • Upgrade polymerelements/paper-item to 2.1.1

    • Upgrade polymerelements/paper-listbox to 2.1.1

    • Upgrade polymerelements/paper-tabs to 2.1.1

    • Upgrade polymerelements/paper-toggle-button to 2.1.1

    • Upgrade visionmedia/page.js to 1.11.4

  • Upgrade truth to 1.0

Bugfix Releases

3.1.3

  • New Features

    • Include request description in HTTP thread names.

      The HTTP worker threads had generic names like HTTP-100, HTTP-101, etc. While we could conclude from the stack trace what this thread was doing, we missed some important information like repository name, user name, etc.

      The HTTP threads now have descriptive names. For example, if there is an ongoing git-fetch operation we will see a thread named like: HTTP POST /a/myProject/git-upload-pack (johndoe from 10.87.75.169).

      This makes the naming consistent with SSHD threads, which are named like: SSH git-upload-pack /myProject (johndoe).

    • New metrics for Jetty threadpool.

      The new metrics are exposed under http/server/jetty/*.

    • Utility program to delete zombie draft comment refs.

      Deletion of draft comment refs was broken until 2.16.14, resulting in draft comment refs not getting deleted properly. Although it has been fixed, it’s still possible that zombie refs exist from previous versions. The new site program DeleteZombieCommentsRefs can be used to remove them.

    • Highlight WORKSPACE and BUILD.bazel files as Python in the PolyGerrit UI.

  • Breaking Changes

    • The MessageOfTheDay extension point is removed.

      The MessageOfTheDay functionality was not ported to the PolyGerrit-UI and the MessageOfTheDay extension point was removed with the 3.1.3 release. However, the JS API provides the banner entrypoint for plugins to add messages to the UI. Plugins that were previously using the MessageOfTheDay extension point have to be adapted accordingly.

  • Bug Fixes

    • Issue 12097: Fix migration to NoteDb when orphan changes exist.

      In the case where a change belonged to a repository that did not exist, the migration failed.

    • Issue 9296: Fix wrong diff of commit message between different patch sets of a merge commit.

    • Issue 7969: Fix internal server error when diffing MERGE_LIST between different patch sets of a merge commit.

    • Issue 10397: Don’t send notification email when publishing a change edit on a WIP change.

    • Issue 12243: Fix unexpected deactivation of service user accounts.

    • Fix editing name and email for service user accounts.

    • Fix internal server error when a change edit includes an invalid file path.

      Invalid file paths are now rejected as ‘400 Bad Request’.

    • Fix internal server error when giving an invalid merge strategy to the ‘Create Merge Patch Set’ REST endpoint.

    • Fix a resource leak in the ‘Get Patch’ REST endpoint.

    • Don’t check for conflicting refs when deleting a ref; improve performance of migration to schema 167.

      The migration to schema 167 involves deletion of refs. The performance was poor for large installations (for example 30k user refs and 20k groups) because the ref deletion implementation was doing an unnecessary check for conflicting refs.

    • Fix setting _moreChanges to the wrong value in change query REST results.

    • Upgrade highlight-js to get various fixes in source code highlighting:

      • fix(makefile) fix double relevance for assignments
      • (xml) expand and improve document type highlighting
      • fix(kotlin): fix termination of “”” string literals
      • (cpp) Add additional keywords
      • Backslash is not used to escape in strings in standard SQL
      • (javascript) fix jsx self-closing tag issues
      • enh(ini) support arrays and much cleaner grammar
      • (javascript) support jsx fragments
  • PolyGerrit UI Fixes

    • Issue 11980: Fix handling of LDAP groups containing a dot in the PolyGerrit permissions screen.

    • Issue 12197: Fix rendering of commentlinks using link.

    • Issue 11697: Fix rendering of commentlinks without leading whitespace.

    • Issue 12224: Honor the date format preference when displaying dates.

    • Issue 12184: Fix link in blame annotation to link directly to the commit.

    • Issue 12108: Add missing ‘Page …’ on pagination links in the repository list.

    • Fix the size of the commit message box.

    • Fix a parse error on the repository list.

    • Fix multiple triggers when shift-r is held.

    • Wrap filenames onto two lines in the file list if the filename is too long.

    • Add a right margin to the search bar.

      This creates some space between the search bar and the header-browse-source endpoint where you often see a ‘Repositories’ link.

    • Replace ‘Menlo’ font with ‘SF Mono’.

      ‘Menlo’ was replaced by ‘SF Mono’ from Mac OS 10.11, and ‘Menlo’ does not render symbols and characters correctly.

  • Other Changes

    • Upgrade JGit to v5.6.0.201912101111-r-31-g3d59d1b80.

    • Upgrade jackson-core dependency to 2.10.2

    • Improve logging when a metadata update fails.

    • Update external Ids documentation with information on how to find the sha1 of an external Id and how to show the corresponding change note.

3.1.2

  • New Features

    • Include thread name in the HTTPD and SSHD logs.

      Having thread name in the HTTPD and SSHD logs makes it easier to match entries from the error log. The error log entries already contain the thread name, so with the thread name included in each entry in the HTTPD and SSHD logs, we have more data to match an error to a request than just the timestamp.

  • PolyGerrit UI Fixes

  • Other Fixes

    • Issue 12070: Fix internal server error on git over HTTP calls when SSHD is enabled.

      Double cleanup of the request context caused an internal server error on push or fetch via git over HTTP.

    • Fix generation of SSH keys with empty passphrase.

      The -N option of ssh-keygen was correctly used for generation of RSA keys, but for other types -P was used.

    • Extend documentation of external Ids to include examples of how to generate the sha1 of an external Id and how to show the git note of the Id.

3.1.1

  • New Features

    • Issue 11973: Add copy-to-clipboard for generated HTTP password.

    • Add support for doctag in PolyGerrit UI syntax highlighter.

    • Add an event interface in the PolyGerrit API.

    • Add support for Elasticsearch 7.5.

    • Add documentation of how to perform backups of Gerrit.

  • PolyGerrit UI Fixes

    • Issue 12024: Fix undefined branch in create-destination-dialog.

    • Issue 11969: Fix tab index in reply dialog.

    • Issue 11993: Stop loading fonts from external resources.

    • Issue 11984: Fix top menu bar on iOS.

    • Issue 8282: Avoid browser caching for diff on edit patch.

    • Issue 9444: Fix syntax highlighting for multi-char char constants.

    • Issue 12020: Fix ‘New Contributor Agreement’ screen.

    • Fix gr-syntax-params css class.

    • Fix overflow of branch name in change list.

  • Other Fixes

    • Issue 11989: Fix internal server error when pushing over SSH with git protocol v2.

    • Issue 11962: Fix advertisement of refs/meta/config in git protocol v2 when client does not have access to it.

    • Issue 11986: Fix fetching individual ref with git protocol v2.

    • Issue 7645: Fix thread deadlock when loading accounts from the account cache.

      Replacing Guava caches with Caffeine reduces the chances of having the deadlocks and improves the cache performance.

    • Issue 11918: Fix internal server error when deleting a tag or branch by git push.

    • Issue 11650: Fix reindexing of changes after project is deleted in the delete-project plugin.

    • Disallow deleting the refs/meta/config branch via the ‘Delete Branches’ REST API.

    • Disallow deleting the HEAD ref via the ‘Delete Branches’ REST API.

    • Allow empty base revision in the ‘Create Branch’ and ‘Create Tag’ REST APIs.

    • Fix deletion of draft comment refs.

      In some situations, draft comment refs were not properly deleted but left empty. This resulted in unused draft refs persisting in the All-Users repository, polluting the namespace. Published draft comments as well as deleted draft comments were kept in the history of the draft ref, keeping them alive for GC, and causing a steady increase of repository size.

    • Use correct content type text/plain instead of plain/text in ‘Create SSH Key’ REST API.

    • Fix handling of interactive/batch users in the QoS filter.

      For the git-over-http requests this filter didn’t work properly because the basic authentication happened later in the filter chain and at the moment when the QoS filter was invoked the current user was not yet set.

    • Add project name to headers of outgoing change emails.

    • Fix and expand documentation of ref-update and commit-received hooks in the hooks plugin.

    • Upgrade JGit to v5.6.0.201912041214-rc1