How does autosubmission happen on Gerrit-3.7.0?

338 views
Skip to first unread message

Pranab Panda

unread,
Jan 26, 2023, 11:52:26 PM1/26/23
to Repo and Gerrit Discussion
Hi 

How is the commit going to be autosubmitted in Gerrit 3.7.0,
there is no autosubmitted plugin support 
Is there a suggested way how this is implemented in 3.7?
I see a "Ready to submit" banner and see submit but
would like the change to be submitted automatically like autosubmitted used to do in 
Gerrit 2.14

Please let me know
Thanks
Pranab
Screenshot 2023-01-26 at 8.48.44 PM.png

Edwin Kempin

unread,
Jan 27, 2023, 3:15:52 AM1/27/23
to Pranab Panda, Repo and Gerrit Discussion
On Fri, Jan 27, 2023 at 5:52 AM Pranab Panda <pra...@pacbell.net> wrote:
Hi 

How is the commit going to be autosubmitted in Gerrit 3.7.0,

Gerrit core doesn't support autosubmit.
 
there is no autosubmitted plugin support 

There is the autosubmitter plugin [1], but besides knowing that it exists I don't know anything about it.
So I can't tell whether this works or whether it's available for Gerrit 3.7.0.

 
Is there a suggested way how this is implemented in 3.7?

I think the usual way to implement this is to write an external bot that regularly searches for changes that are submittable and that then submits them.
 
I see a "Ready to submit" banner and see submit but
would like the change to be submitted automatically like autosubmitted used to do in 
Gerrit 2.14

If you had this working with Gerrit 2.14 why can't you use the same approach with Gerrit 3.7.0?
Did you use the autosubmitter plugin and it's no longer working? Then maybe try contributing a fix to it?
 

Please let me know
Thanks
Pranab

--
--
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 on the web visit https://groups.google.com/d/msgid/repo-discuss/0d892c26-f83e-456b-b21e-3e04d2c3aee5n%40googlegroups.com.

Björn Pedersen

unread,
Jan 27, 2023, 6:03:12 AM1/27/23
to Repo and Gerrit Discussion
eke...@google.com schrieb am Freitag, 27. Januar 2023 um 09:15:52 UTC+1:
On Fri, Jan 27, 2023 at 5:52 AM Pranab Panda <pra...@pacbell.net> wrote:
Hi 

How is the commit going to be autosubmitted in Gerrit 3.7.0,

Gerrit core doesn't support autosubmit.
 
there is no autosubmitted plugin support 

There is the autosubmitter plugin [1], but besides knowing that it exists I don't know anything about it.
So I can't tell whether this works or whether it's available for Gerrit 3.7.0.



Check 
and for the source:

If a plugin works on master and older branches, then normally only a build against master is available.

Pranab Panda

unread,
Jan 27, 2023, 11:02:22 AM1/27/23
to Repo and Gerrit Discussion
Thanks let me check it out the above
The autosubmitter plugin is what makes automation possible,   
having to manually click submit will be  BIG breaking blocking change! 
Sorry for Typo
I meant the autosubmitter plugin,    Not autosubmitted , auto correct. :( 

regards
Pranab
 

Pranab Panda

unread,
Jan 27, 2023, 1:20:08 PM1/27/23
to Repo and Gerrit Discussion
Tried the plugin jar from  
restarted gerrit and I get

[2023-01-27T09:04:39.948-08:00] [main] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 2047m

[2023-01-27T09:04:40.411-08:00] [main] WARN  com.google.gerrit.server.project.PeriodicProjectListCacheWarmer : project_list cache warmer is disabled

[2023-01-27T09:04:40.414-08:00] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_autosubmitter_230127_1704_5694505494225624988.jar

[2023-01-27T09:04:40.415-08:00] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /mnt/store/gerrit/plugins

[2023-01-27T09:04:40.499-08:00] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin admin-console, version 9d913d71a4

Please let me know

thanks

Pranab

Pranab Panda

unread,
Jan 30, 2023, 2:20:17 AM1/30/23
to Repo and Gerrit Discussion
So how can I make progress?
why is autosubmitter plugin not supported anymore?
and curious to know how others are addressing this
Does everyone clicks on Submit manually after the submit requirements are met?

This is a Huge automation blocker and breaking change/blocking issue for developers ,and automation/tools
raising questions and concerns on migration to 3.7.0

Matthias Sohn

unread,
Jan 30, 2023, 4:15:27 AM1/30/23
to Pranab Panda, Repo and Gerrit Discussion
This API change in Gerrit 3.7 broke the autosubmitter plugin
I pushed a fix for review
 
and curious to know how others are addressing this
Does everyone clicks on Submit manually after the submit requirements are met?

Apparently not many are using the autosubmitter plugin, at least not on 3.7.
 
This is a Huge automation blocker and breaking change/blocking issue for developers ,and automation/tools
raising questions and concerns on migration to 3.7.0

I checked out Gerrit stable-3.7 and cloned the autosubmitter plugin into it's plugins folder
as described in 

Running the bazel build on that yielded this compile error
$ bazelisk build release
INFO: Invocation ID: 0ea60c9d-ef37-40b0-829d-5f8d963ebeb6
INFO: Reading 'startup' options from /Users/d029788/.bazelrc: --output_user_root=/Users/d029788/.cache/bazel
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=224
INFO: Reading rc options for 'build' from /Users/d029788/src/git/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --java_language_version=11 --java_runtime_version=remotejdk_11 --tool_java_language_version=11 --tool_java_runtime_version=remotejdk_11 --incompatible_strict_action_env --announce_rc
INFO: Analyzed target //:release (1 packages loaded, 431 targets configured).
INFO: Found 1 target...
ERROR: /Users/d029788/src/git/gerrit/plugins/autosubmitter/BUILD:4:14: Building plugins/autosubmitter/libautosubmitter__plugin.jar (7 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor, AutoOneOfProcessor, AutoValueGsonAdapterFactoryProcessor) failed: (Exit 1): java failed: error executing command external/remotejdk11_macos_aarch64/bin/java -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' ... (remaining 17 arguments skipped)
plugins/autosubmitter/src/main/java/com/criteo/gerrit/plugins/automerge/AutomaticMerger.java:62: error: cannot find symbol
  @Inject MergeUtil.Factory mergeUtilFactory;
                   ^
  symbol:   class Factory
  location: class MergeUtil
Target //:release failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.139s, Critical Path: 1.66s
INFO: 5 processes: 5 internal.
FAILED: Build did NOT complete successfully

The first commit in Git log for MergeUtil revealed the API change causing this build error:

gerrit (stable-3.7 *)]$ git log -S MergeUtil
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
commit b258e98e4e1972214b03a0dffe449fc6b56de694 ┃
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Author: Patrick Hiesel <hie...@google.com>
Date:   Mon May 9 11:21:46 2022 +0200

    Use AutoFactory to reduce boiler-plate for assisted injection

    AutoFactory is part of the Auto framework that we already use
    widely. This library makes it so that we do not have to implement
    explicit factory interfaces for classes that need assisted parameters
    during injection. On the flip side, all injected parameters have to be
    annotated with @Provided (while previously, all assisted parameters
    had to be annotated with @Assisted).

    At Google, this makes importing open-source code easier: Explicit
    Factories have to be explicitly bound in factory modules. In some
    parts of our code base we don't use upstream modules 1:1 but have
    our own. Using AutoFactory makes it so that this explicit binding
    can be omitted from any module - open-source and Google-internal.

    This commit migrates MergeUtil.Factory as proof of concept.

    This commit adds a dependency on auto-commons, auto-factory and
    auto-service.

    Release-Notes: skip
    Change-Id: I3fccb05d21ec6c89b009101bad88743437bf9437


Adapting AutoMerger to fix this was straightforward.
Maybe next time you can try this yourself and propose a patch ?

-Matthias

Pranab Panda

unread,
Jan 31, 2023, 1:19:18 AM1/31/23
to Repo and Gerrit Discussion
Thanks a lot Matthias
for your detailed response and the fix,
really appreciate it.
How / when will this fix be released?
as 3.7.1 ?
Please let me know

Certainly would love to be able to contribute but I don't have Java coding knowledge,
and most release engineering teams don't.
So what may seem trivial  is a like a challenge to me and the team :(


Sincerely 
Pranab



Matthias Sohn

unread,
Jan 31, 2023, 8:12:42 AM1/31/23
to Pranab Panda, Repo and Gerrit Discussion
The autosubmitter plugin is not a core plugin, this means it's not released with Gerrit releases.
Most plugins don't create releases but you can always grab the latest build from the CI,
As soon as the fix was submitted you can download the plugin build from here.

If you want to try it earlier you can build it yourself following

-Matthias

Certainly would love to be able to contribute but I don't have Java coding knowledge,
and most release engineering teams don't.
So what may seem trivial  is a like a challenge to me and the team :(


Sincerely 
Pranab



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

Pranab Panda

unread,
Jan 31, 2023, 8:40:11 PM1/31/23
to Repo and Gerrit Discussion
Thanks again for the details Matthias
I will check these out  
regards 
Pranab

Matthias Sohn

unread,
Feb 1, 2023, 5:45:07 AM2/1/23
to Pranab Panda, Repo and Gerrit Discussion

Pranab Panda

unread,
Feb 1, 2023, 8:04:15 PM2/1/23
to Repo and Gerrit Discussion
Thanks I downloaded and it Worked! 
the change was merged Ok but
It did give a pop up error message though

An error occurred

Error 409 (Conflict): change is merged

Endpoint: /changes/*~*/revisions/current/mergeable

DISMISS

error_log has the following lines around the time of commit

[2023-02-01T16:45:50.302-08:00] [HTTP POST /changes/wifi-ci~65618/revisions/1/review (pranab_panda from 17.11.146.136)] INFO  com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.changeMergedHook resolved to /mnt/store/gerrit/hooks/change-merged [CONTEXT PLUGIN="autosubmitter" PLUGIN="gerrit" SUBMISSION_ID="65618-1675298750027-bab7d819" project="wifi-ci" request="REST /changes/*/revisions/*/review" ]

[2023-02-01T16:45:50.307-08:00] [HTTP POST /changes/wifi-ci~65618/revisions/1/review (pranab_panda from 17.11.146.136)] WARN  com.google.gerrit.server.plugincontext.PluginContext : Failure in class com.google.gerrit.server.events.EventBroker of plugin gerrit [CONTEXT PLUGIN="gerrit" project="wifi-ci" request="REST /changes/*/revisions/*/review" ]


com.google.inject.ProvisionException: Unable to provision, see the following errors:


1) [Guice/NullInjectedIntoNonNullable]: null returned by binding at PluginGuiceEnvironment$2.configure(PluginGuiceEnvironment.java:551) (installed by: PluginGuiceEnvironment$1 -> PluginGuiceEnvironment$2)

 but the 1st parameter instanceId of GitRepoUpdateListener.<init>(GitRepoUpdateListener.java:39) is not @Nullable

  at PluginGuiceEnvironment$2.configure(PluginGuiceEnvironment.java:551)

      \_ installed by: PluginGuiceEnvironment$1 -> PluginGuiceEnvironment$2

  at GitRepoUpdateListener.<init>(GitRepoUpdateListener.java:39)

      \_ for 1st parameter instanceId

  while locating GitRepoUpdateListener

  while locating EventListener annotated with @UniqueAnnotations$Internal(value=218)


Learn more:

  https://github.com/google/guice/wiki/NULL_INJECTED_INTO_NON_NULLABLE


1 error


======================

Full classname legend:

======================

EventListener:              "com.google.gerrit.server.events.EventListener"

GitRepoUpdateListener:      "com.googlesource.gerrit.plugins.gitrepometrics.GitRepoUpdateListener"

PluginGuiceEnvironment$1:   "com.google.gerrit.server.plugins.PluginGuiceEnvironment$1"

PluginGuiceEnvironment$2:   "com.google.gerrit.server.plugins.PluginGuiceEnvironment$2"

UniqueAnnotations$Internal: "com.google.inject.internal.UniqueAnnotations$Internal"

========================

End of classname legend:

========================


        at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)

        at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1103)

        at com.google.gerrit.extensions.registration.Extension.get(Extension.java:59)

        at com.google.gerrit.server.plugincontext.PluginContext.runLogExceptions(PluginContext.java:208)

        at com.google.gerrit.server.plugincontext.PluginSetContext.lambda$runEach$1(PluginSetContext.java:148)

        at java.base/java.lang.Iterable.forEach(Iterable.java:75)

        at com.google.gerrit.server.plugincontext.PluginSetContext.runEach(PluginSetContext.java:148)

        at com.google.gerrit.server.events.EventBroker.fireEventForUnrestrictedListeners(EventBroker.java:110)

        at com.google.gerrit.server.events.EventBroker.fireEvent(EventBroker.java:121)

        at com.google.gerrit.server.events.EventBroker.postEvent(EventBroker.java:90)

        at com.google.gerrit.server.events.StreamEventsApiListener.lambda$onCommentAdded$15(StreamEventsApiListener.java:404)

        at com.google.gerrit.server.plugincontext.PluginContext.runLogExceptions(PluginContext.java:214)

        at com.google.gerrit.server.plugincontext.PluginItemContext.run(PluginItemContext.java:131)

        at com.google.gerrit.server.events.StreamEventsApiListener.onCommentAdded(StreamEventsApiListener.java:404)

        at com.google.gerrit.server.extensions.events.CommentAdded.lambda$fire$0(CommentAdded.java:74)


-Pranab

Screenshot 2023-02-01 at 4.46.12 PM.png

Matthias Sohn

unread,
Feb 2, 2023, 7:33:46 AM2/2/23
to Pranab Panda, Repo and Gerrit Discussion
On Thu, Feb 2, 2023 at 2:04 AM Pranab Panda <pra...@pacbell.net> wrote:

Please avoid top posting on this list. Use interleaved posting instead.

Which version of the git-repo-metrics plugin did you deploy ?
I guess the master branch should work with 3.7.
Reply all
Reply to author
Forward
0 new messages