Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Plugin versioning seems all over the shop

137 views
Skip to first unread message

Dean Stalker

unread,
Apr 15, 2025, 6:37:16 AMApr 15
to Repo and Gerrit Discussion
G'day,

Is there a way to reliably target certain plugin versions on Gerrit Forge? I want to download only plugins for v3.10 while we prepare for the v3.11 upgrade.

So far, I'm seeing certain plugins adhering to the `stable-3.x` naming format and others happily committing release candidate code to master (go-import) without providing a stable version to test against (the last attempt was 3.5 for go-import).

Regards,

Dean Stalker


Daniele Sassoli

unread,
Apr 15, 2025, 2:00:44 PMApr 15
to Repo and Gerrit Discussion
Hi

yeah, plugin versioning is pretty confusing, agreed. Assuming you're not on a super ancient version of Gerrit, you should work based on the assumption that if the plugin has a a stable branch for the version of Gerrit you're planning on installing it on, then use that, otherwise master should work.

Regards,

Dean Stalker


mfick

unread,
Apr 15, 2025, 2:08:16 PMApr 15
to Repo and Gerrit Discussion
If there isn't a stable branch for the version of the plugin, look up and down the version chain. If there is a version above your version, it likely will NOT work, but the version below it likely will. The exception is master, if the version above your version is master, it may or may not work.

So, if there is no 3.10 version but there is a 3.9 version and a 3.11 version, then the 3.9 version likely covers both 3.9 and 3.10,

-Martin

 

Luca Milanesio

unread,
Apr 15, 2025, 5:28:26 PMApr 15
to Repo and Gerrit Discussion, Luca Milanesio


> On 15 Apr 2025, at 19:08, 'mfick' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
>
> On Tuesday, April 15, 2025 at 12:00:44 PM UTC-6 daniele...@gmail.com wrote:
> On Tuesday, 15 April 2025 at 11:37:16 UTC+1 dean.s...@gmail.com wrote:
> Is there a way to reliably target certain plugin versions on Gerrit Forge? I want to download only plugins for v3.10 while we prepare for the v3.11 upgrade.


Well, there are two reliable ways:
1. Download the plugins from the Gerrit-CI (see [1])
2. Install the plugins using the plugin manager inside Gerrit (see [2] from the URL of running 'docker run -ti -p 80:8080 -h localhost gerritcodereview/gerrit’)

P.S. When you start Gerrit’s docker container, you may notice at the end of the startup sequence log the following message:
"[plugin-manager-preloader] INFO com.googlesource.gerrit.plugins.manager.OnStartStop : 38 plugins successfully pre-loaded”

The above message means that:
- The plugins versions are NOT all over the place
- The plugins are getting properly built and verified on the CI
- The availability of plugins for a Gerrit version is well organised and available for you to use

HTH

Luca.

[1] https://gerrit-ci.gerritforge.com/
[2] http://localhost/plugins/plugin-manager/static/index.html


>
> So far, I'm seeing certain plugins adhering to the `stable-3.x` naming format and others happily committing release candidate code to master (go-import) without providing a stable version to test against (the last attempt was 3.5 for go-import).
> yeah, plugin versioning is pretty confusing, agreed. Assuming you're not on a super ancient version of Gerrit, you should work based on the assumption that if the plugin has a a stable branch for the version of Gerrit you're planning on installing it on, then use that, otherwise master should work.
>
> If there isn't a stable branch for the version of the plugin, look up and down the version chain. If there is a version above your version, it likely will NOT work, but the version below it likely will. The exception is master, if the version above your version is master, it may or may not work.
>
> So, if there is no 3.10 version but there is a 3.9 version and a 3.11 version, then the 3.9 version likely covers both 3.9 and 3.10,
>
> -Martin
>
>
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/75ee6788-debc-4210-b7c5-c91516f18994n%40googlegroups.com.

Dean Stalker

unread,
Apr 16, 2025, 3:29:55 AMApr 16
to repo-d...@googlegroups.com
Hi Luca,

On Wed, Apr 16, 2025 at 7:28 AM Luca Milanesio <luca.mi...@gmail.com> wrote:

Well, there are two reliable ways:
1. Download the plugins from the Gerrit-CI (see [1])

This is what prompted this message to the group out of frustration. We were ready to upgrade to 3.11, but our CI failed due to the 'go-import' plugin. It only has a `master-master` version, and no stable versions exist. After logging in to Gerrit Forge, I noticed that there weren't any prior builds to fall back to on the master branch.


Downloading and installing that plugin build results in the following error:

gerrit-1  | [2025-04-15T01:23:55.585Z] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin gitiles, version v3.11.2
gerrit-1  | [2025-04-15T01:23:55.600Z] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
gerrit-1  | java.lang.NoClassDefFoundError: com/google/gerrit/server/permissions/RefPermissionOrLabel
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
gerrit-1  | at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2727)

It turns out that class only exists in 3.12-rc*, breaking support for it in 3.11. But from what I can see in the stable channels on Gerrit CI, there is no alternative to grab the last compatible version. The repository at https://gerrit.googlesource.com/plugins/go-import/ is out of date, the master branch doesn't correlate with what I'm seeing. So if I'm painting a wide brush across the plugin developers who are doing the right thing, I apologise, for those who aren't ... can the maintainer be advised they're breaking things ?
 
2. Install the plugins using the plugin manager inside Gerrit (see [2] from the URL of running 'docker run -ti -p 80:8080 -h localhost gerritcodereview/gerrit’)

P.S. When you start Gerrit’s docker container, you may notice at the end of the startup sequence log the following message:
"[plugin-manager-preloader] INFO  com.googlesource.gerrit.plugins.manager.OnStartStop : 38 plugins successfully pre-loaded”

This is not an option, as we orchestrate Gerrit's deployment from CI/CD, and if its getting the plugins from the same place, it will still cause breakage.
 

The above message means that:
- The plugins versions are NOT all over the place
- The plugins are getting properly built and verified on the CI
- The availability of plugins for a Gerrit version is well organised and available for you to use


For the most part, these are true. However, my experience with one of the plugins is frustrating.
Regards,

Dean Stalker


Luca Milanesio

unread,
Apr 16, 2025, 3:40:01 AMApr 16
to repo-d...@googlegroups.com, Luca Milanesio
Hi Dean,

On 16 Apr 2025, at 00:26, Dean Stalker <dean.s...@gmail.com> wrote:

Hi Luca,

On Wed, Apr 16, 2025 at 7:28 AM Luca Milanesio <luca.mi...@gmail.com> wrote:

Well, there are two reliable ways:
1. Download the plugins from the Gerrit-CI (see [1])

This is what prompted this message to the group out of frustration. We were ready to upgrade to 3.11, but our CI failed due to the 'go-import' plugin. It only has a `master-master` version, and no stable versions exist. After logging in to Gerrit Forge, I noticed that there weren't any prior builds to fall back to on the master branch.


Downloading and installing that plugin build results in the following error:

gerrit-1  | [2025-04-15T01:23:55.585Z] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin gitiles, version v3.11.2
gerrit-1  | [2025-04-15T01:23:55.600Z] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
gerrit-1  | java.lang.NoClassDefFoundError: com/google/gerrit/server/permissions/RefPermissionOrLabel
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
gerrit-1  | at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2727)

If you use the Plugin Manager UI on https://gerrit-ci.gerritforge.com/plugin-manager/ select v3.11.x and look for go-import in the search box you’ll find … nothing.
That means that the plugin is not ported to Gerrit v3.11 at all.

If you wish to use it with Gerrit v3.11, you’ll need to find the latest compatible version of the code and use it.
The fact that there are no stable branches, means that nobody has committed to maintaining it.

P.S. If you look at [3] you’ll notice that the two maintainers of the plugin are not active anymore since 2021: the plugin is basically unmaintained at the moment.

It turns out that class only exists in 3.12-rc*, breaking support for it in 3.11. But from what I can see in the stable channels on Gerrit CI, there is no alternative to grab the last compatible version. The repository at https://gerrit.googlesource.com/plugins/go-import/ is out of date, the master branch doesn't correlate with what I'm seeing. So if I'm painting a wide brush across the plugin developers who are doing the right thing, I apologise, for those who aren't ... can the maintainer be advised they're breaking things ?

There are no active maintainers at the moment of that plugin. 

 
2. Install the plugins using the plugin manager inside Gerrit (see [2] from the URL of running 'docker run -ti -p 80:8080 -h localhost gerritcodereview/gerrit’)

P.S. When you start Gerrit’s docker container, you may notice at the end of the startup sequence log the following message:
"[plugin-manager-preloader] INFO  com.googlesource.gerrit.plugins.manager.OnStartStop : 38 plugins successfully pre-loaded”

This is not an option, as we orchestrate Gerrit's deployment from CI/CD, and if its getting the plugins from the same place, it will still cause breakage.

In that case, you’ll need to automate in your CI/CD the build of the plugins from source. Plugins aren’t distributed via Maven or similar, there is only a CI available for binaries download.


The above message means that:
- The plugins versions are NOT all over the place
- The plugins are getting properly built and verified on the CI
- The availability of plugins for a Gerrit version is well organised and available for you to use


For the most part, these are true. However, my experience with one of the plugins is frustrating.

I believe you have just used an example “out of context”: by using an unmaintained plugin, it is clear that you’ll run into trouble.

HTH

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Antoine Musso

unread,
Apr 16, 2025, 4:54:28 AMApr 16
to Dean Stalker, Repo and Gerrit Discussion
Le 15/04/2025 à 04:40, Dean Stalker a écrit :
Is there a way to reliably target certain plugin versions on Gerrit Forge? I want to download only plugins for v3.10 while we prepare for the v3.11 upgrade.

So far, I'm seeing certain plugins adhering to the `stable-3.x` naming format and others happily committing release candidate code to master (go-import) without providing a stable version to test against (the last attempt was 3.5 for go-import).

Hello,

The summary is: use the master branch, else a matching stable branch, else ask for such stable branch to be created.


Our setup has several additional plugins which we compile from source. Whenever upgrading Gerrit I thus lookup for each plugin whether there is an update that would match the target version. The heuristic I use if upgrading to eg v3.11.2 would be to lookup for:

  • a matching tag (eg v3.11.2)
  • a matching branch (stable-3.11)
  • an earlier branch (cause a stable-3.11 might not have been cut)
  • master

The testing of the master branch is only done against the master version of Gerrit. The master branch is only assumed to work on the supported versions but there is no guarantee.

When someone finds out the master branch fails for a version, the maintainer of the plugin would cut a branch for the affected version, either to a commit before the breaking change or to master and then add a fix for that stable branch.

I  think the Zuul CI has support to test a change to a plugin master branch against older stable versions of Gerrit, but I could not find an example so maybe I have only dreamed about it.

HEAD of go-import is from 3 years ago (it is both master and stable-3.5). It is working with 3.10 (our setup).
If the plugin breaks with 3.11 then a fix is required there which will be send to the master branch. You would then continue using the master branch.
If the fix is not compatible with 3.10, a stable-3.10 branch would need to be created pointing to the code before the fix. Users of 3.10 would point to it and users of 3.11 and others would use master.

cheers,

-- 
Antoine "hashar" Musso
Release Engineering

Antoine Musso

unread,
Apr 16, 2025, 5:11:32 AMApr 16
to Dean Stalker, repo-d...@googlegroups.com
Le 16/04/2025 à 01:26, Dean Stalker a écrit :

Downloading and installing that plugin build results in the following error:

gerrit-1  | [2025-04-15T01:23:55.585Z] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin gitiles, version v3.11.2
gerrit-1  | [2025-04-15T01:23:55.600Z] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
gerrit-1  | java.lang.NoClassDefFoundError: com/google/gerrit/server/permissions/RefPermissionOrLabel
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
gerrit-1  | at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2727)

Hello Dean,

As you found out it is broken. The reason is the Gerrit CI compiles the plugin using the master branch of Gerrit which is not back compatible with 3.11. You would need to compile the plugin yourself using the stable-3.11 version of Gerrit.

The Gerrit CI can be enhanced to create jobs that compiles against each of the currently supported versions. I have proposed https://gerrit-review.googlesource.com/c/gerrit-ci-scripts/+/468183 to add jobs that would build the go-import plugin versions 3.9, 3.10 and 3.11 of Gerrit.

Cheers,

Luca Milanesio

unread,
Apr 16, 2025, 5:20:37 AMApr 16
to repo-d...@googlegroups.com, Luca Milanesio
Approved.

Luca.

Matthias Sohn

unread,
Apr 16, 2025, 5:23:43 AMApr 16
to Antoine Musso, Dean Stalker, repo-d...@googlegroups.com
I tried to compile the go-import plugin's master branch in-tree against gerrit core master and installed it into
a gerrit site using gerrit stable-3.11 and that seems to work. On the other hand if I download the latest build of go-import plugin from gerrit-ci
I can reproduce the NoClassDefFoundError.

Not sure what's different between my local in-tree build and the build done on gerrit-ci. 

Cheers,

-- 
Antoine "hashar" Musso
Release Engineering

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Sven Selberg

unread,
Apr 16, 2025, 8:31:08 AMApr 16
to Repo and Gerrit Discussion
On Wednesday, April 16, 2025 at 11:23:43 AM UTC+2 Matthias Sohn wrote:
On Wed, Apr 16, 2025 at 11:11 AM Antoine Musso <amu...@wikimedia.org> wrote:
Le 16/04/2025 à 01:26, Dean Stalker a écrit :

Downloading and installing that plugin build results in the following error:

gerrit-1  | [2025-04-15T01:23:55.585Z] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin gitiles, version v3.11.2
gerrit-1  | [2025-04-15T01:23:55.600Z] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
gerrit-1  | java.lang.NoClassDefFoundError: com/google/gerrit/server/permissions/RefPermissionOrLabel
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
gerrit-1  | at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
gerrit-1  | at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2727)

Hello Dean,

As you found out it is broken. The reason is the Gerrit CI compiles the plugin using the master branch of Gerrit which is not back compatible with 3.11. You would need to compile the plugin yourself using the stable-3.11 version of Gerrit.

The Gerrit CI can be enhanced to create jobs that compiles against each of the currently supported versions. I have proposed https://gerrit-review.googlesource.com/c/gerrit-ci-scripts/+/468183 to add jobs that would build the go-import plugin versions 3.9, 3.10 and 3.11 of Gerrit.

I tried to compile the go-import plugin's master branch in-tree against gerrit core master and installed it into
a gerrit site using gerrit stable-3.11 and that seems to work. On the other hand if I download the latest build of go-import plugin from gerrit-ci
I can reproduce the NoClassDefFoundError.

It is more or less me, Rikard A and David Å that are maintaining go-import.
We have missed updating the CI scripts to express the compatibility between go-import:master and gerrit:3.11.

Dean Stalker

unread,
Apr 22, 2025, 7:45:30 PMApr 22
to repo-d...@googlegroups.com
Hi Sven, Rikard, David,

Thank you guys for fixing this. I can confirm the latest go-import builds on master and 3.9 are working correctly.

Kind regards,

Dean Stalker

Sven Selberg

unread,
Apr 23, 2025, 2:29:12 AMApr 23
to Repo and Gerrit Discussion
On Wednesday, April 23, 2025 at 1:45:30 AM UTC+2 Dean Stalker wrote:
Hi Sven, Rikard, David,

Thank you guys for fixing this. I can confirm the latest go-import builds on master and 3.9 are working correctly.

Hehe, I wish we could take credit for the fix but it was Antoine who fixed it.
https://gerrit-review.googlesource.com/c/gerrit-ci-scripts/+/468183

Antoine Musso

unread,
Apr 23, 2025, 3:16:57 AMApr 23
to Repo and Gerrit Discussion
Le 23/04/2025 à 08:29, Sven Selberg a écrit :
On Wednesday, April 23, 2025 at 1:45:30 AM UTC+2 Dean Stalker wrote:
Hi Sven, Rikard, David,

Thank you guys for fixing this. I can confirm the latest go-import builds on master and 3.9 are working correctly.

Hehe, I wish we could take credit for the fix but it was Antoine who fixed it.
https://gerrit-review.googlesource.com/c/gerrit-ci-scripts/+/468183

Oh it is all team work!  My patch would not have been possible without:

  • the preliminary work which makes it trivial to target multiple stable branches (the YAML diff speaks for itself).
  • Dean who took time to report the issue and follow up with an explanation of the failure (class only existed in 3.12)
  • Luca for pushing deployment buttons faster than light :]
  • And yourself Sven for maintaining go-import!

Anyway I am happy to have participated in a fix, that would surely benefit me when I am upgrade from 3.10 to 3.11 :)

cheers,

Reply all
Reply to author
Forward
0 new messages