Download: 3.7.0

Documentation: 3.7.0

Release highlights

UI mostly migrated to Lit

Gerrit UI is mostly migrated to Lit, with a few exceptions for certain modules.

Mention @user support

Users can be mentioned in comments using the @<user> notation and select the matching accounts. Mentioning users automatically add them in CC and send e-mail notification to get their attention.

This feature can be enabled in gerrit.config by adding this configuration:

[experiments]
    enabled = UiFeature__mention_users

Full markdown support in comments

Comments and checks accept and render the full markdown syntax, allowing richer interaction and communication between authors and reviewers. This follows the CommonMark spec, except inline images and direct HTML are not rendered and kept as plaintext. No markdown rendering is done in the commit message.

This feature can be enabled in gerrit.config by adding this configuration:

[experiments]
    enabled = UiFeature__render_markdown

Bulk actions on search results and dashboard

Apply a change action to an entire group of changes all at once right from the search page or your dashboard. Simply select all the changes, click your action, and fill out the details on the dialog. Currently supported actions are:

  • Add Reviewer or CC
  • Add Topic
  • Add Hashtag
  • Vote (excluding Code-Review)

Auto theme mode

The theme is automatically changed to light/dark based on your OS preference. You can change the theme in users preferences.

The copy links are in the dropdown next to the change number with keyboard shortcuts or a button to quickly copy the format that you prefer to link change.

Import Projects’ Changes from other Gerrit servers

Gerrit can read and render Changes coming from Projects copied from other servers having different server-ids and account-ids. This allows the Gerrit administrators to move projects and changes across servers with a compatible NoteDb structure and having the change meta-data parsed and reindexed in Gerrit.

NOTE: Only the changes can be imported and reindexed in Gerrit, following the account reverse lookup association using the new imported external-ids. Groups, ACLs and project hierarchy and Prolog rules (aka refs/meta/config) may not be imported out of the box and still require the Gerrit administrator to copy and adapt them manually.

At high-level, the process consists of:

  1. Configure the gerrit.importedServerId with the values of the gerrit.serverId of the Gerrit servers from the project changes to be imported originate from.

  2. Identify the accounts involved in the project changes to import and create the corresponding imported external-ids in the All-Users.git repository.

    Example of how to add the external-id imported:1000002@59a4964e-6376-4ed9-beef-123bd9217df8 to the account-id 1000001:

    $ EXT_ID=imported:1000002@59a4964e-6376-4ed9-beef-123bd9217df8
    $ EXT_ID_NOTE=$(echo -n $EXT_ID | shasum | awk '{print $1}')
    $ git clone $GERRIT_SITE/git/All-Users.git && cd All-Users
    $ git fetch origin refs/meta/external-ids && git checkout FETCH_HEAD
    $ echo -e '[externalId "'$EXT_ID'"]\n\taccountId = 1000001' > $EXT_ID_NOTE
    $ git commit -am "Added $EXT_ID"
    $ git push origin HEAD:refs/meta/external-ids
    
  3. Create the destination project of the import in Gerrit

  4. Push the changes under refs/changes/* from the source Gerrit into the newly created destination project.

  5. Reindex all imported changes, either online with gerrit index changes or offline with the java -jar gerrit.war reindex commands.

The overall process has been described in detail and live demoed during the Gerrit User Summit 2022.

New command to check project access for other users

Gerrit admins can verify the ACLs of projects for individual users using the new gerrit check-project-access SSH command.

Important notes

Schema and index changes

This release contain changes to the schema which is upgraded to version 185; also all indexes have been upgraded.

Offline upgrade

Download the gerrit.war and run the init and then reindex program:

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

Online upgrade with zero-downtime

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

NOTE: Gerrit versions older than v3.6.0 would require an offline upgrade.

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.6.3 or later, in high-availability configuration, healthy and able to handle the incoming traffic properly.
  2. Set gerrit.experimentalRollingUpgrade to true in gerrit.config on both Gerrit masters.
  3. Set the Gerrit server unhealthy.
  4. Shutdown the Gerrit server, update gerrit.war and plugins to v3.7.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.
  8. Remove gerrit.experimentalRollingUpgrade from gerrit.config on both Gerrit masters.

Downgrade

Downgrade to Gerrit v3.6.x release is possible, but requires the following manual steps:

  1. Shutdown a migrated Gerrit v3.7.x server
  2. Downgrade the All-Projects.git version (refname: refs/meta/version) to 184:
    git update-ref refs/meta/version $(echo -n 184|git hash-object -w --stdin)
    

    See git hash-object and git update-ref.

    NOTE: The migration of the label config to copy-condition performed in v3.7.x init step is idempotent and can be run many times. Also v3.6.x supports the copy-condition and therefore the migration does not need to be downgraded.

  3. Run Gerrit v3.6.x init, downgrading all plugins, and run the off-line reindex

      java -jar gerrit-3.6.x.war init -d site_path
      java -jar gerrit-3.6.x.war reindex -d site_path
    
  4. Start Gerrit v3.6.x server

Native packaging

Breaking changes

  • Change 343774: Delete ignored state of changes and ‘star:’ queries

    The query predicates star:ignored, is:ignored and star:star are not supported anymore. The latter is identical to ‘is:starred’ or ‘has:star’.

  • Change 334467: Removed support for deprecated approval config fields in label configs

    The boolean flags in label configurations to control approval copying, as well as the copyValue settings, was previously deprecated and now completely removed in flavor of the new copyCondition setting that allows to express the copy conditions as a query.

  • Change 337456: Ban new modifications to label functions in favour of submit requirements

  • Issue 15784: New project head updated event in the stream events

  • Issue 11686: Discontinue support for legacy numeric types in Lucene

    In Lucene the implementation switched from integer id to string id and now all the old code is removed. Three different index implementations are affected:

    • changes
    • account
    • groups
  • Change 334325: Migrated label definitions to use copy conditions instead of deprecated fields

    The boolean flags in label configurations to control approval copying, as well as the copyValue settings, have been deprecated in favor of the new copyCondition setting that allows to express the copy conditions as a query. The newly added schema version migrates the deprecated fields to copy conditions.

    NOTE: Because of this breaking change, downgrading to Gerrit v3.6.x is not possible out of the box.

  • 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 336297: Recognize lower case operators in search

    Previously, we only recognized AND, OR and NOT as boolean operators. This seems overly strict as users might unintentionally use the lower case variants.

Indexing improvements

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

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

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

  • Change 349694: Improve performance of parentof operator by two orders of magnitude

  • Change 345634: Paginate internal change index queries, as index backends such as Lucene and Elasticsearch are known to degrade with a high limit

Performance fixes

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

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

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

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

  • Change 339795: Improve performance of the create branch REST API when the repository contains over one million refs

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

Other changes

  • Change 346979: Add ability to specify prefix, suffix and text fields for commentLinks of type link

  • Change 346854: Update change.maxPatchSets value from 1500 to 1000

  • Change 345229: Support bulk actions on dashboard and search pages

  • Change 337434: New REST API for previewing fix from the request body to a patch set

    The newly added API fix:preview previewes fix(es) provided as part of a POST request body. ApplyProvidedFixInput holds the fix(es). This flow is suitable when a frontend plugin shows fix(es) that it is suggesting on the UI and that the user can accept.

  • Change 339788: Allow testing submit requirements using a pending change to the refs/meta/config branch

    Admins can then test their SRs using the following workflow:

    1. Upload a pending change to the refs/meta/config branch.
    2. Test it immediately on any change using: curl -X POST https://<gerrit-url>/changes/<change_to_test>/check.submit_requirement?sr-name=Foo&refs-config-change-id=$id
  • Change 336715: Disallow index updates that both add and remove fields

    A new version may only add or remove fields, but not both. The type of existing fields may not be changed.

  • Change 341454: Allow using GitWeb with multi-site and cached-refdb

  • Change 307349: Add change REST endpoints to create and retrieve submit requirements.

  • Change 307352: Add a REST endpoint to delete submit requirements

  • Change 307351: Add a REST endpoint to list submit requirements in a project.

  • Change : New REST API for applying a fix from the request body to a patch set

  • Change 339555: The commit-msg hook ignores fixup and squash commits now.

    Fixup and squash commits will inherit the Change-id of the commit they are squashed into.

  • Issue 10168: Fix broken links to Gitweb lightweight tags

  • Issue 12546: In commit-msg hook, the Change-Id is now inserted before any Signed-off-by

  • Issue 13930: Support ssh kex server-sig-algs for modern clients, like OpenSSH 8.8

  • Issue 15194: Define new event containing all refs updated in a single operation

  • Issue 15664: Disallow truncating the Change-Id across patch-sets

  • Issue 15997: Make DelegateRepository#delegate() method public

  • Issue 16182: Display the change’s Change-Id underneath the commit message when not present in the commit message

  • Issue 16263: Disallow js in comment links

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

  • Issue 16354: Fix change screen errors when trying to load an invalid project with an exixting change number

  • Change 338680: Included copied/outdated votes in change message on patch set creation

    Include copied and outdated approvals into the change message that is posted on patch set creation. This allows users to find the copied/outdated approvals for each patch set in the change log.

  • Change 337968: Copy approvals that are applied on outdated patch sets to follow-up patch sets if copyable

    Copying approvals that are applied on outdated patch sets to follow-up patch sets make the life easier for CIs, e.g.:

    1. CI is triggered on PS X
    2. While the CI is running, PS X+1 which only modified the commit message is uploaded
    3. CI finishes on votes Verified+1 on the outdated PS X
  • Change 336712: Included outdated approvals in push output when pushing a new patch set

  • Change 336414: Included unsatisfied SRs into new patch set email when change becomes unsubmittable

    When a change becomes unsubmittable users want to know which submit requirements are no longer satisfied.

  • Change : Support deletion of missing changes from the index

    If a change is not found, and the “delete_missing” option is set to “true”, then try to delete it from the index.

  • Change 336134: gerrit.sh: add –debug option, start JVM in debug mode

  • Change 335754: Approver is added to the attention set when their approval is not copied

    If a user applied an approval on a change and this approval gets outdated and removed when a new patch set is uploaded (i.e. the approval is not copied to the new patch set) then this user is added to the attention set now. This is to signal that this user should re-review the change and renew their approval.

  • Change 330407: Added the value “NOT_EVALUATED” to the SubmitRequirementExpressionInfo in the Change API and in NoteDb.

  • Change 349314: Fixed change reindex with label copyCondition containing group

Plugin changes

Gerrit UI changes

  • Change 346077: Added “Your > All Visible Changes” default query

    Add a new entry to the “Your” menu which queries “is:visible” which, is the query for viewing all changes.

  • Change 345136: Remove redundant/unhelpful ARIA labels from diff tables

  • Change 344914: Fix freezing in Safari when adding comments

  • Change : New user setting for theme. New default - Auto - shows dark or light theme based on OS theme preference. User can change new default in settings

    Switching theme is now reactive - listening to OS theme preference changes or on user changing user preferences.

  • Change 337421: Introduce Auto Dark/Light Theme based on OS preference

    Introducing a new default mode - Auto. This will dynamically change theme based on OS preferences. Mac OS has Auto mode, that switch to dark mode in evening. With this change Gerrit can have dark theme in evening and light them during day.

  • Change 343605: Make the file list easier to understand at a glance

    Folders that match the previous file are colored gray, folders that do not match are black, and the file name it self is blue.

  • Change 340970: Start using material icons

  • Issue 14526: Allow to rebase changes with conflicts in the UI

Documentation changes

  • Change 337097: Contribution Documentation updated for grammar

    A few updates to the contribution documentation for developers:

    • Minor grammatical errors and restructuring sentences.
    • Removing a duplicated paragraph regarding incomplete features.
    • Changes in verb tense (‘has’ to ‘is’ where appropriate)

End-to-End tests changes

  • Change 335394: Added property authenticated to e2e-tests

    This property let you use authenticated HTTP clones with the e2e-tests.

JGit changes

  • Update jgit to 2021ce342, improves UploadPack and git blame performance for large merge commits, also correctly report errors for UploadPack.

Other dependency changes

  • Update Lucene version to 7.7.3

Other core changes