title: “Gerrit 3.6.0” permalink: 3.6.html hide_sidebar: true hide_navtoggle: true toc: true

Download: 3.6.3 | 3.6.2 | 3.6.1 | 3.6.0

Documentation: 3.6.3 | 3.6.2 | 3.6.1 | 3.6.0

Release highlights

Gerrit 3.6 is fully compatible with Java 17 LTS.

Submit Requirements

Gerrit deprecates the use of Prolog for definition of custom logic in the submit rules. From this version onwards the rules can be expressed using the new concept of Submit Requirements.

Submit Requirements have several advantages, compared to the legacy Prolog rules:

  • Easier to understand, defined through simple boolean expressions using a higher-level change search predicates and common boolean operator.
  • Lower footprint: they do not require backtracking in their evaluation, consuming less CPU cycles.
  • Richer GUI: makes it easy for reviewers and change owners to identify and understand missing requirements.

Existing projects relying on Prolog will still work as expected, allowing a smoother project transition.

Submit requirements also introduce new handy functions that allow to achieve complex rules equivalent to the old Prolog rules but with an easier syntax:

  • support checking on content modifications and file diffs with the file: operator.
  • distinctvoters predicate allows gating submission on N distinct voters across more than one label.
  • authoremail operator similar to the older commit_author Prolog predicate
  • message predicate to support regular expression on the commit message as a condition.

NOTE: With the new submit requirements, submit records are no longer emitted. This means that any queries with the label formats (label:Code-Review=NEED or label:Code-Review=OK) will no longer match with changes. See more details in Change 330203.

Important notes

Schema and index changes

This release doesn't formally contain schema changes, however the NoteDb format has evolved and includes the following amendments:

NOTE: Because of the above incompatibilities, upgrade is supported only from Gerrit v3.5.2 onwards, because of the need of the extra copy-approvals tool and the backward compatibility fix on UUID suffixed labels. Failing to run the copy-approvals tool in v3.5.2 would leave the changes with a potentially stale approval score once the site is migrated to v3.6.

The changes index version has been increased to version 77. By default the index is automatically rebuilt upon the Gerrit startup after the upgrade.

Offline upgrade

Upgrade to Gerrit v3.5.2 or later and make sure that the copy-approvals site program has been run at least once.

  java -jar gerrit.war copy-approvals -d site_path

Download the Gerrit v3.6.0 war and run the init program:

  java -jar gerrit-3.6.0.war init -d site_path

Run offline reindexing of the changes:

  java -jar gerrit.war reindex --index changes -d site_path

Online upgrade with zero-downtime

Gerrit v3.6.x supports zero-downtime upgrade from Gerrit v3.5.2 or later when configured using a high-availability configuration, and the Git repositories are stored in a shared filesystem such as NFS or similar.

During the zero-downtime upgrade, Gerrit end-users would not notice any outage or service disruption. They will be able to perform any read/write Gerrit operation on the GUI or using using any API.

The zero-downtime upgrade consists of the following steps:

  1. Have Gerrit servers running v3.5.2 or later, in high-availability configuration, healthy and able to handle the incoming traffic properly.
  2. Run the copy-approvals SSH command against one of the Gerrit servers and wait for completion on all changes for all projects.
  3. Set the Gerrit server unhealthy.
  4. Shutdown the Gerrit server, update gerrit.war and plugins to v3.6.x and start Gerrit again.
  5. Verify that the Gerrit server is working properly (e.g. run automated smoke tests) and then make it healthy again.
  6. Wait for the Gerrit server to start serving traffic normally.
  7. Repeat steps 3. to 6. for all the other Gerrit servers.

Breaking changes

  • The ignore feature is completely removed from Gerrit's web app; the ignore and unignore actions and the associated is:ignored predicate are not supported anymore.

    Gerrit has the attention set feature since v3.4. If you want to ignore a change, then you can remove yourself from the attention set or the list of reviewers/ccs. That makes it also clearer to your collaborators that you don't want to participate.

    The legacy ignore feature did not have any effect on the user's dashboard or attention set but was limited to the execution of the is:ignored predicate. On Google hosted Gerrit the feature is used by about 5 users per week. 20% of ignore action clicks were accidental.

  • Change 321607: Assignee feature is completely removed from the Gerrit UI

    The Attention Set feature has been launched in Gerrit v3.3, and assignee has been turned off by default for three releases. The feature is now completely removed and cannot be enabled anymore by config.

  • Project Owners implicit delete reference permission has been removed.

    Before this release all Project Owners had implicit delete permission to all refs unless force-push was blocked for the user. Admins that are relying on previous behavior or wish to maintain it for their users can simply add the permission explicitly in All-Projects:

      [access "refs/*"]
        delete = Project Owners
    

    NOTE: If you choose to do so, blocking force-push no longer has any effect on permission to delete refs by means other than git (REST, UI).

  • Support for CentOS is dropped and the base image replaced by AlmaLinux

    RedHat anticipated the EOL of CentOS to December 2021 making hard for the Gerrit community to continue to support existing Docker setups on CentOS. The default base image now uses AlmaLinux 8 which promises to have a much longer life as open-source OS and has an easy migration tool from CentOS 8 available.

  • Apache Commons Lang v2 is removed

    Gerrit moved to Apache Commons Lang v3 replacing all legacy use of the older lang v2 from its dependencies. Existing plugins and scripts that are using Apache Commons Lang v2 must be rebuilt to use the new library or declare the older Apache Commons Lang v2 as an explicit dependency.

Other changes

Plugin changes

  • Change 331259: Deprecate the registerStyleModule() JS plugin API

  • Change 330403: Support validation options for branch creation to be used in RefOperationValidationListener implemented in plugins.

  • Change 330200: Add support for specifying validation options in rebase and cherry-pick REST endpoint and implemented in plugins.

  • Upgrade to gitiles v1.0.0

Gerrit UI changes

  • Change 324242: Add syntax highlighting for Markdown

    Reuse and enable highlight.js syntax highlighting of Markdown files.

  • Issue 15715: Fix the editing workflow in the web app

  • Change 330301: Adding tab navigation for hovercards

  • Change 330919: Show Change actions regardless if logged in or not, because the gr-change-actions correctly hides the actions that the current user cannot do.

  • Change 333299: Remove the front-end metric diffViewFullyLoaded replaced by diffViewDiplayed to represent highlighting a whole file.

  • Change 330204: Adds changes and dashboard link to account hovercard.

  • Change 330084: Status field renamed to About me and no icon is shown.

Documentation changes

End-to-End tests changes

New test properties are available in the End-to-End tests:

  • com.google.gerrit.scenarios.project_prefix
  • com.google.gerrit.scenarios.context_path
  • com.google.gerrit.scenarios.replica_hostname
  • com.google.gerrit.scenarios.username

JGit changes

  • Update jgit to v6.1.0.202203080745-r

    release notes: 6.0 6.1

    most important changes since 5.13:

    • [push] support the “matching” RefSpecs “:” and “+:”
    • IndexDiff: use tree filter also for SubmoduleWalk
    • Describe: add support for core.abbrev config option
    • PersonIdent: Add ctors that accept Instant in addition to Date
    • Cap describe abbrev option, minimum is 4, maximum is length of a full ObjectId
    • DescribeCommand: Add support for --abbrev=0
    • DescribeCommand: Support configuring the hash abbreviation
    • PushCommand: determine remote from git config if not given
    • PushCommand: consider push.default when no RefSpecs are given
    • Support for git config push.default
    • Support for “lfs.url” from “.lfsconfig”
    • Support LFS Server URL without .git suffix
    • [rebase] Enable users to have a Change-ID be generated when squashing or rewording commits.
    • RepoCommand: Add API to set extra files in the destination repository
    • RebaseCommand: better commit message rewording. Respect git config commit.cleanup for rewording.
    • CommitCommand: implement git commit --cleanup.
    • Provide git config commit.cleanup
    • sshd: support the ConnectTimeout ssh config
    • sshd: Skip unknown keys from the SSH agent
    • sshd: support the AddKeysToAgent ssh config
    • sshd: handle “IdentityAgent SSH_AUTH_SOCK” in ssh config
    • sshd: Connector for the Win32-OpenSSH SSH agent
    • sshd: handle IdentitiesOnly with an SSH agent
    • shd: support IdentityAgent config
    • Add config reader for user-defined difftools
    • Add command line support for “git difftool”
    • Transport: load all refs only if push refspecs have wildcards
    • UploadPack v2 protocol: Stop negotiation for orphan refs
    • PackBitmapIndexV1: support parallel loading of reverse index
    • RefDirectory.scanRef: Re-use file existence check done in snapshot creation
    • FileSnapshot: Lazy load file store attributes cache
    • Support commit.template git config option
    • ssh: Handle “ProxyJump none” from SSH config file
    • OpenSshConfigFile: update handling of line comments and quoted strings following changes in OpenSSH
    • OpenSshConfigFile: update token replacements. It appears that the OpenSSH documentation has changed; it now allows more flags for a number of keys.
    • [sshd agent] Introduce ConnectorDescriptor
    • sshd: add support for ssh-agent
    • Binary and CR-LF detection: conclude file is binary if it contains a lone CR like C git
    • Make the buffer size for text/binary detection configurable
    • GarbageCollectCommand: add numberOfBitmaps to statistics
    • Don't block in GC#gc until garbage collection finished
    • Let ObjectDatabase implement AutoClosable
    • Optimize RevWalk.getMergedInto() to improve performance
    • improve how git system config is found
    • Bump minimum required Java version to 11
    • [checkout] Use .gitattributes from the commit to be checked out
    • [push] Call the pre-push hook later in the push process
    • Prevent that an instance of PushCommand is reused
    • Stop initCause throwing in readAdvertisedRefs
    • Make sure to close Repository in tests
    • Fix resource leak in CancellableDigestOutputStreamTest
    • RebaseCommand: fix commit message in “fixup” case
    • BinaryHunkInputStream: accept CR-LF
    • Merge conflict messages: prefix conflict lines with a hash
    • ObjectWalk: close ObjectReader on close() if needed
    • LFS: Fix error occurring during delete branch
    • sshd: backport upstream fix for SSHD-1231
    • Use FileSnapshot without using configs for FileBasedConfig
    • TreeRevFilter: fix wrong stop when the given path disappears
    • storage: file: De-duplicate File.exists()+File.isFile()
    • Fix checkout of files with mixed line endings on text=auto eol=crlf
    • Fix missing peel-part in lsRefsV2 for loose annotated tags
    • Fix RevWalk.getMergedInto() ignoring annotated tags
    • Reftable: close old Db in FileRepository#convertToPackedRefs
    • Reftable: Reload the stack before trying to delete the files. This ensures we don't trip over our own open file handles when deleting compacted tables.
    • Reftable: drop code for truncated reads
    • Reftable: pass on invalid object ID in conversion

Other dependency changes

  • Update sshd to 2.8.0

    The highlights of SSHD update from Gerrit's perspective are:

    • SSHD-1216: Server-side implementation of the RFC 8332 server-sig-algs extension: the server announces that it prefers the SHA-2 signatures for RSA keys.

    • SSHD-1197: A race condition in key exchange fixed.

    • SSHD-1163: DH group exchange got a fix relating to RSA SHA-2 signatures.

    Additionally, sshd 2.8.0 now supports (and prefers) the chacha20-poly1305@openssh.com cipher SSHD-1017, and supports the curve25519 and curve448 KEX algorithms SSHD-704.

  • Update codemirror-minified to 5.65.0

  • Update highlight.js to 11.5.0

  • Update rules_nodejs version to 5.1.0

  • Update rules_go version to 0.30

  • Update protobuf version to 3.19.4

Other core changes

  • Change 334747: Fixed missing return type in e2e-tests

  • Change 334557: Make the computing of the diff cache thread-safe.

    The computation previously failed with a zlib exception that was logged as if the packfile was corrupt even though it wasn't.

  • Change 333706: Added support for ‘is:’ in approval copy condition queries to make arbitrary voting values sticky

  • Change 332139: Stop adding project-owners to To: of the emails for new changes.

Bugfix releases

3.6.3

  • New features

    • Issue 16322: Limit the number of changes that can be submitted together

      When chaining changes together, the sequence of commits to navigate was previously unbound, causing the potential operations explosion. The explosion could have also been accidental and caused by the push of a change with a non-existent branch, which would have resulted in the full scan of the repository for changes. Introduce a new Gerrit configuration change.maxSubmittableAtOnce with a safe default of 1024, which would allow any use case that would have also worked before this change.

    • Change 347496: Enable project_list cache warmer when cache.project_list.maxAge is set

    • Change 341454: GitwebServlet: Retrieve git path from FileRepository so that it can be used with multi-site and cached-refdb modules

  • Native packaging

    • GerritForge RPM repository updated for arm64 architecture

      GerritForge RPM v1.4 has been released, including the native packages for arm64 architecutre.

    • DockerHub images for arm64 architecture

      DockerHub Gerrit images include images for arm64 architecture.

  • Performance Fixes

    • Change 350577 copy-approvals: use multiple threads for copy-approvals, improve performance

      Split the work into slices of changes and then utilize one thread per slice. Also skip unnecessary reindexing. On a large Gerrit site with 1.3 million changes, this reduced the time for copy-approvals from 5 hours to 15-20 minutes.

    • Change 350236 Optimized change visibilty checking when the project is hidden

      Looping over every change when the whole project isn‘t readable is a waste of CPU. It’s a bigger waste to fetch all the change data in the first place.

    • Issue 16379: Remove key locking for disabled caches

      This change also makes the memoryLimit behaviour consistent with the diskLimit set to zero means disabling the implementation of the cache.

    • Change 349895: Add AndCardinalPredicate and OrCardinalPredicate

      Before this change, IndexSource derived cardinality from predicate which implement HasCardinality. Since AndPredicate and OrPredicate does not return cardinality, IndexSource defaults to 10 when query comprises more than one predicate. Due to this behavior, AndSource chooses IndexSource almost always when query contains more than one index predicate. This helps AndSource to choose the right source more often.

    • Change 347956: Introduce possibility to define the cardinality so that AndSource predicate can work more efficiently

      Before this change, cardinality of the IndexSource was always set to 10. This makes AndSource to choose IndexSource over other sources most of the time. Add a HasCardinality interface which can be used by all the predicates which implement IndexPredicate to set a cardinality. This helps AndSource to choose the right datasource.

    • Change 349355: Cache repository locations in LocalDiskRepositoryManager

      Obtaining the actual location of a repository using base-path and project name can be slow as it involves some guessing to locate the repository. Cache the locations once they are obtained to avoid repeated work, thereby improving performance when opening repositories.

    • Change 347955: Consider cardinality while choosing the data source for AndSource predicate

      Before this change, AndSource considered cost to choose a datasource. Ideally cost should be used to determine which predicate to run #match() against first, so that queries are faster. Cardinality should be used to determine which datasource to be picked so that there are fewer changes to process. Consider cardinality of the datasource to choose the source and use cost when cardinality is same.

  • Bug Fixes

    • Change 350576 copy-approvals: continue when there are corrupt meta-refs in a project

      If there was a corrupt meta-ref in a project, the copy-approvals failed for all changes in that project. Mitigates [Issue 16326].

    • Change 350575 copy-approvals: don't stop when it fails on one project

      When copying of approvals failed in one project it skipped copying of approvals for other projects where it would potentially finish successfully.

    • Change 350414 Fix index rewriter to rewrite all Or/AndPredicates. AndSource chooses right source more often

    • Change 349314 Fix reindex with label copyCondition containing group.

    • Change 77495: Fix for IllegalStateException during the Gerrit start when cache.projects.refreshAfterWrite is set to true and prolog rules are used

    • Change 350014: Do not set cherryPickOf on RevertSubmission

      The RevertSubmission internally uses CherryPickChange operation. It creates the ‘normal’ revert for the first change in the relation chain, for each subsequent change it creates a revert commit that is then cherry-picked. This cherry-pick is not a cherry-pick of the reverted change. This is a cherry-pick of the revert commit of the original change. This change fixes the bug in the logic that sets cherryPickOf to the original (reverted) change, using the CherryPickChange operation.

    • Change 349894: Don't always rewrite And/OrPredicate to And/OrSource

      Before this change OrPredicate was always rewritten to OrSource. This is not the right thing to do as OrSource#read() will eventually fail when there is at least one non-datasource child. Since Change 347955, AndSource picks a source which has the lowest cardinality which makes the OrSource#read() failures more visible. Rewrite OrPredicate to OrSource only when all the children in the predicate are DataSources.

    • Change 348715; Clarify that a restart is needed before changes to email templates take effect

    • Issue 16182: Reintroduce the Change-Id footer in change screen

      This change reintroduce the Change-Id footer below the commit message on the Gerrit UI.

    • Issue 10168: Fix HTTP 404 when browsing tags on Gitweb

      The Gitweb links to tags have been broken in v2.14.10 onwards. Gitweb supports the ‘a=tags’ rendering action for annotated tags only, returning 404 for all lightweight tags. Use the generic ‘a=shortlog’ for Gitweb links to tags which would work for both annotated and lightweight ones.

    • Change 347495: Fix for IllegalStateException during the Gerrit start when cache.projects.refreshAfterWrite is set to true and prolog rules are used

    • Issue 15997: Make DelegateRepository#delegate() method public to allow plugins/modules to access it

3.6.2

  • Security Fixes

    • Issue 16054: Fix confidentiality leak by users with create ref permission using the create branch REST-API

      Any user with create ref permission was able to gain access to any SHA1 or refs, including the ones that they would not have permission to see.

  • Breaking changes

    • Issue 15941: Fix SSH queries to not show commit-message unless --commit-message is provided

      This issue has existed for several years and should be considered breaking as users might expect commit message to be included by default in SSH query results. Obtaining the commit message is a costly operation as the commit data has to be loaded. So, showing it even when --commit-message is not provided degrades the performance of SSH queries.

    • Change 344300: Add missing return values in MetricMaker's newCallbackMetric and newConstantMetric

      When new callback and constant metrics were created the RegistrationHandle was not returned, making impossible to de-register them. The method signature is now aligned, however, all plugins, including the core ones, that were registering callback or constant metrics would need to be rebuilt from source or downloaded from the latest build on Gerrit-CI.

  • New features

    • Change 343096: Introduce index.paginationType=SEARCH_AFTER configuration for speeding up query pagination

    • Change 343798: Introduce index.pageSizeMultiplier configuration to paginate index queries with increasing size

    • Change 344334: Implement no-limit queries with multiple pages, make them usable with Elasticsearch

    • Change 345017: Add public EventTypes.getRegisteredEvents() for accessing all stream event types from plugins

    • Change 340714: Introduce metrics configuration for different data reservoirs

    • Change 347496: New configuration option to periodically warm the project_list cache

      Reduce the likelihood of the project_list cache being evicted by providing an option to periodically warm it up. When this warmer is enabled, change detail page loads are consistently faster.

  • Performance Fixes

    • Change 338154: Lazy load change notes when submit by push Improves performance of change submit via push

    • Change 338614 Optimize SSH queries to avoid loading individual accounts This improves performance of SSH queries.

    • Change 338474: Allow async receive-commits to have a thread-local cache Improve caching when merging changes through git push

    • Change 338574: Cache ProjectControl instances in SSH queries A PerThreadCache is used to cache ProjectControl instances to improve SSH query performance.

    • Change 338834: Avoid creating an IdentifiedUser multiple times in a SSH query This improves performance of SSH queries.

  • Bug Fixes

    • Issue 16306: Fix Bazel build on Apple M2 ARM64 chip

    • Issue 16284: Fix performance issues with git-upload-pack on repositories with a large number of changes

    • Issue 16043: Fix reindexing for changes with a commit message longer than 32766 bytes

    • Change 347474: Fix DefaultMemoryCacheFactory to correctly set refreshAfterWrite Setting refreshAfterWrite in gerrit.config now works and does not mistakenly set expireAfterAccess

    • Change 340635: Fix CSS of the Contributor Agreement screen which was preventing to sign CLAs

    • Issue 15997: Make delegate() method public git-repo-metrics plugin now works with multi-site setup

    • Issue 16018 Don't try to mark files as reviewed when not logged in Fix marking of reviewed flag when not logged in. “Log in is required to perform that action” popup is no longer seen when viewing file diffs unauthenticated.

    • Issue 16038: Fix “internal error” when pushing to refs/users/xx/xxxx Push over HTTP to refs/users/* branch now works and doesn't fail with “error: internal error” / Not Signed In

    • Issue 16001: AsciiDoctor: skip attribute when looking for title Fix documentation search showing :linkattrs: instead of the document title

    • Issue 15134: Apply the match operator to filter projects Next-arrow is now not hidden when searching for repositories in the Repository section

    • Change 337474: Use sane value for QueryProcessor's effective limit on “--no-limit” Fix errors seen when --no-limit query option is used with ES index backend

    • Change 339754: Fix gerrit review command with branch option

      The gerrit review command was not able to find the commit with branch option; ensure “refs/heads/” prefix is present for branch option.

    • Issue 16106: Fix label operator to work with external groups, which never worked before since its addition in v2.10.

    • Change 331762: Cache permission filtering for All-Projects, allowing a faster ACL evaluation to any refs.

    • Change 343694: Improve performance of queries that check the visibility of changes wrt a non-current user

    • Change 346254: Fix change queries evaluation of AND terms to run match on predicate whose cost is least

      Sort the change queries predicates in AND based on cost and cardinality, which was broken since Change 79391.

      WARNING: queries containing predicates with poorly defined costs or cardinalities could perform worse now.

  • Dependency Updates

    • Update JGit to d01376106af8800017ac3c08d7c7ac1fd5ccc9ee, including the following fixes and improvements:

      • 011c26ff3 - Fix connection leak for smart http connections
      • d67ac798f - Remove stray files (probes or lock files) created by background threads
      • 035e0e23f - UploadPack: don't prematurely terminate timer in case of error
      • 66ace4b9a - UploadPack: do not check reachability of visible SHA1s
      • 8984e1f66 - HTTP Smart: set correct HTTP status on error
  • Documentation fixes

    • Change 340534 Fix link to change.mergeabilityComputationBehavior in user-search.txt

    • Change 339235 Add copy-approvals SSH command link to the index page

    • Change 338949 Fix auto-generated documentation header for plugins

    • Change 337835 rest-api-projects: Fix documentation for #inherited-boolean-info

    • Change 340114 sshd config: Reference implementation sections upstream

    • Change 339819 Supplement key exchange supported by Apache MINA

    • Change 339818 Supplement ‘encrypt-then-MAC’ supported by Apache MINA

    • Change 339815 Supplement cipher algorithms in sshd.cipher section

  • Other Fixes

    • Change 337835: rest-api-projects: Fix documentation for #inherited-boolean-info

    • Change 340245 Propagate auto flush value to external index module

    • Change 340534: Fix link to change.mergeabilityComputationBehavior in user-search.txt

3.6.1

  • Bug Fixes

    • Issue 15957: Fix loading ssh and gpg keys in Gerrit UI and make the text areas have a white background

      The Gerrit UI did not display the list of the user‘s SSH and GPG keys, even if they were present in the user’s profile and working as expected.

  • Other Fixes

    • Change 337014: Plugins named with hyphens can now define query operators