New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 875085 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: ----


Previous locations:
gerrit:9583


Sign in to add a comment

Submitting runs submitchange events twice

Project Member Reported by ayatane@chromium.org, Aug 14

Issue description

This problem occurs on CLs like

https://chromium-review.googlesource.com/c/chromiumos/infra/lucifer/+/1162668

The UI flow for submitting this CL is:

1. Click Submit
2. Get dialog 1
3. Click Submit
4. Get dialog 2
5. Click Continue
6. Get dialog 1
7. Click Submit
8. Done

The page is using the chumpdetector plugin

https://chromium.googlesource.com/infra/gerrit-plugins/chumpdetector/+/d3e2efa82950387577d40d23baf26eb81c0e6c9f/src/main/resources/static/chumpdetector.js#530

It adds a submitchange hook to show a confirmation message:

self.on('submitchange', function() {
  // snip ---------------------
  // Change should be submitted via CQ (not directly via Gerrit).
  if (config.enforceCommitQueue) {
    setConfirmSubmitMessage(
        'The ' + config.treeName + ' project uses the commit queue (CQ). ' +
        'You should submit your change by clicking "Reply" and setting the ' +
        '"Commit-Queue" label to the appropriate value.\n' +
        'Do you want to commit the change directly, bypassing CQ (dangerous)?');
  }
  // snip ---------------------
});

This hook gets run twice, once when clicking Submit

https://gerrit.googlesource.com/gerrit/+/b84362e37ed478b7e0a80ce0545a963eba1ada99/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js#928

and once when clicking on Continue on the submit confirmation dialog that PolyGerrit shows:

https://gerrit.googlesource.com/gerrit/+/b84362e37ed478b7e0a80ce0545a963eba1ada99/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js#1054

I think one of the _canSubmitChange() calls should be removed (probably the one in _handleSubmitConfirm).  I don't see a point in running _canSubmitChange() twice, and the effect is very annoying for the end user.
 
gerrit1.jpg
25.2 KB View Download
gerrit2.jpg
9.7 KB View Download
I wrote a whole series of changes to address this [1] and it landed in late June, but I now see that it hasn't been rolled into the currently served version of the chump detector plugin [2]. How unfortunate!

It sounds like what's needed here is some kind of import/release for the plugin.

[1] https://chromium-review.googlesource.com/c/infra/gerrit-plugins/chumpdetector/+/1111237
[2] https://chromium-review.googlesource.com/plugins/chumpdetector/static/chumpdetector.js
Project: chromium
Moved issue gerrit:9583 to now be issue chromium:875085.
Components: Infra>Codereview>Gerrit
Can someone familiar with Infra>CodeReview>Gerrit update the chumpdetector plugin?
ping?  Sounds like it should be simple to uprev the plugin
Cc: wyatta@google.com
Cc: ajp@chromium.org jojwang@chromium.org
Status: Available (was: New)
We need to take a look at all the Chromium plugins as we try to change how they are bundled. When we ramp up to learn how to do that it seems like we should do this at the same time.
We just rolled out bundled versions of all the plugins last week. My hope is that it included rolling in these new changes and this is fixed, but still need to verify.
Labels: Pri-2
Setting defect without priority to Pri-2.

Sign in to add a comment