Page MenuHomePhabricator

Gerrit 3.7.8: CI has completed checks. Reload the change view? RELOAD button doesn't work
Closed, ResolvedPublic

Description

After CI has completed testing a change, Gerrit will present a notification to the user:
"CI has completed checks. Reload the change view?" with RELOAD and DISMISS buttons:

gerrtit1.png (777×1 px, 148 KB)

Previously when clicking RELOAD the page would actually reload and show updated information. Now it does nothing other than close the notification.

Browser: Chrome

Event Timeline

@dancy yeah my bad I should have filed it. I talked about it with Paladox immediately after upgrading to 3.7 and the API my code relies on got broken. Namely that is the reload event in the frontend:

showAlertToReloadChange() {
  document.dispatchEvent( new CustomEvent('show-alert', {
    detail: {
      message: 'CI has completed checks. Reload the change view?',
      dismissOnNavigation: true,
      showDismiss: true,
      action: 'Reload',
      callback: () => document.querySelector('gr-app')
        .shadowRoot.querySelector('gr-app-element')
        .shadowRoot.querySelector('gr-change-view')
        .dispatchEvent(new Event('reload')),    // <<<-----------------------
    },
  }));

There is some other code path in Gerrit 3.7 which offers a person to reload the code, and that one works. Thus maybe I use the wrong event or some other data/option gotta be passed. I think, it is still broken in 3.8 but is supposedly fixed in 3.9, @Paladox would know more :)

This is fixed in gerrit 3.9. This is to do with the migration to lit that to get it working needed to use the change model. The changes couldn't be back-ported because they are big and would require a lot being backported.

From what I remember it's https://github.com/GerritCodeReview/gerrit/blob/stable-3.7/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts#L629. I last took a dive years ago so I'm a little fuzzy. But I do remember it was within there.

I have tried with Gerrit 3.8.5 and it still does not work. The debug console has:

show-alert: {"text":"CI has completed checks. Reload the change view?"}
button-click: {"path":"html.lightTheme>body>gr-alert>div.content-wrapper>gr-button.action>paper-button"}

But there are other Reload actions that do work such as:

  • commenting on a change while another patchset has been sent would show a link to reload the patch
  • I had a change notifying me about myself having sent a new patchset (iirc)

So clearly there is a way to reload, and maybe the way I have implemented is slightly broken. We will see in 3.9.

As a side note, when a new patchset has been uploaded, after some minutes a popup shows "A newer patchset has been uploaded RELOAD DISMISS" and the console has:

show-alert: {"text":"A newer patch set has been uploaded"}

Clicking on it does a full reload and the console has:

button-click: {"path":"html.lightTheme>body>gr-alert>div.content-wrapper>gr-button.action>paper-button"}
Page: handleChangeRoute
ChangeReloaded: 845
ChangeFullyLoaded: 3075

So at least that code path does reload the change! :)

hashar closed this task as Resolved.EditedJun 10 2024, 1:57 PM
hashar claimed this task.

I think that one is fixed now that we have upgraded to Gerrit 3.9.5 and RELOAD does reload the change view!

I think that one is fixed now that we have upgraded to Gerrit 3.9.5 and RELOAD does reload the change view!

Hi @hashar. I wasn't able to confirm this for myself. I'm testing with https://gerrit.wikimedia.org/r/c/operations/puppet/+/1041230. I get the "CI has completed checks. Reload the change view? RELOAD/DISMISS" notice, I click RELOAD, and nothing happens.

I think that one is fixed now that we have upgraded to Gerrit 3.9.5 and RELOAD does reload the change view!

Hi @hashar. I wasn't able to confirm this for myself. I'm testing with https://gerrit.wikimedia.org/r/c/operations/puppet/+/1041230. I get the "CI has completed checks. Reload the change view? RELOAD/DISMISS" notice, I click RELOAD, and nothing happens.

More info! While I was typing this complaint I eventually (like 3-5 minutes later) got a new notice for the same change (this is after previously clicking RELOAD and having nothing happen): "There are new messages on this change from jenkins-bot RELOAD/DISMISS". When I clicked RELOAD this time, the page DID reload.

More info! While I was typing this complaint I eventually (like 3-5 minutes later) got a new notice for the same change (this is after previously clicking RELOAD and having nothing happen): "There are new messages on this change from jenkins-bot RELOAD/DISMISS". When I clicked RELOAD this time, the page DID reload.

Ah that is it! I had a left over tab in my browser, it prompted me to RELOAD, I clicked it and surely the page reloaded which led me to mark this resolved. Thanks!

Change #1041243 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/software/gerrit@deploy/wmf/stable-3.9] wm-zuul-status: fix reload button

https://gerrit.wikimedia.org/r/1041243

Change #1041243 merged by jenkins-bot:

[operations/software/gerrit@deploy/wmf/stable-3.9] wm-zuul-status: fix reload button

https://gerrit.wikimedia.org/r/1041243

Mentioned in SAL (#wikimedia-operations) [2024-06-12T06:38:44Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@69984f7]: wm-zuul-status: fix reload button - T360550

Mentioned in SAL (#wikimedia-operations) [2024-06-12T06:38:51Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@69984f7]: wm-zuul-status: fix reload button - T360550 (duration: 00m 07s)

I have tried it live (waiting for the result of a postmerge to complete) and clicking RELOAD fixed it. Additionally the new code is slightly easier/nicer since it does not rely on crawling the DOM to trigger the event from the ChangeView, but instead triggers it directly from document.

I am leaving the task open pending confirmation by another party 🎉

I have tried it live (waiting for the result of a postmerge to complete) and clicking RELOAD fixed it. Additionally the new code is slightly easier/nicer since it does not rely on crawling the DOM to trigger the event from the ChangeView, but instead triggers it directly from document.

I am leaving the task open pending confirmation by another party 🎉

Confirmed. Thanks @hashar!