Page MenuHomePhabricator

Display Zuul status of jobs for a change on Gerrit UI
Open, NormalPublic

Description

When acting on a change in Gerrit, if something is being processed in Zuul it should be reflected in the Gerrit web interface. That would save us from having to keep loading https://integration.wikimedia.org/zuul/

That status page queries https://integration.wikimedia.org/zuul/status.json, but the Zuul web apps allows to pass a change/patchset. For example: https://integration.wikimedia.org/zuul/status/change/483010,15

We should be able to add some magic js/css to Gerrit to have it reach out to the Zuul status page and then craft a nice progress report directly on the Gerrit change page.

Might be related, our Gerrit has a Zuul plugin https://gerrit.wikimedia.org/r/plugins/zuul/Documentation/index.html .

[
  {
    "failing_reasons": [],
    "items_behind": [],
    "jobs": [
      {
        "result": null,
        "pipeline": "test",
        "retry": false,
        "uuid": "3f13ecbfc11544bbaba9fb366e529dc2",
        "url": "https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-hhvm-docker/14145/",
        "worker": {
          "name": "Unknown",
          "extra": {},
          "hostname": null,
          "fqdn": null,
          "ips": [],
          "program": null,
          "version": null
        },
        "start_time": 1547747610.448321,
        "launch_time": 1547747610.301148,
        "number": 14145,
        "remaining_time": 721882,
        "node_name": null,
        "elapsed_time": 107018,
        "canceled": false,
        "report_url": "https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-hhvm-docker/14145/console",
        "end_time": null,
        "node_labels": [],
        "estimated_time": 828.9,
        "voting": true,
        "name": "wmf-quibble-vendor-mysql-hhvm-docker"
      },
      {
        "result": null,
        "pipeline": "test",
        "retry": false,
        "uuid": "c27a04762b2e4e64a4e96e167192debb",
        "url": "https://integration.wikimedia.org/ci/job/mwgate-npm-node-6-docker/71497/",
        "worker": {
          "name": "Unknown",
          "extra": {},
          "hostname": null,
          "fqdn": null,
          "ips": [],
          "program": null,
          "version": null
        },
        "start_time": 1547747610.594601,
        "launch_time": 1547747610.30344,
        "number": 71497,
        "remaining_time": 0,
        "node_name": null,
        "elapsed_time": 106871,
        "canceled": false,
        "report_url": "https://integration.wikimedia.org/ci/job/mwgate-npm-node-6-docker/71497/console",
        "end_time": null,
        "node_labels": [],
        "estimated_time": 105.8,
        "voting": true,
        "name": "mwgate-npm-node-6-docker"
      },
      {
        "result": null,
        "pipeline": "test",
        "retry": false,
        "uuid": "dc64e378ad5c4199adcf389cfcc99d0d",
        "url": "https://integration.wikimedia.org/ci/job/mwext-php70-phan-seccheck-docker/33827/",
        "worker": {
          "name": "Unknown",
          "extra": {},
          "hostname": null,
          "fqdn": null,
          "ips": [],
          "program": null,
          "version": null
        },
        "start_time": 1547747610.628503,
        "launch_time": 1547747610.305987,
        "number": 33827,
        "remaining_time": 15562,
        "node_name": null,
        "elapsed_time": 106838,
        "canceled": false,
        "report_url": "https://integration.wikimedia.org/ci/job/mwext-php70-phan-seccheck-docker/33827/console",
        "end_time": null,
        "node_labels": [],
        "estimated_time": 122.4,
        "voting": true,
        "name": "mwext-php70-phan-seccheck-docker"
      },
      {
        "result": null,
        "pipeline": "test",
        "retry": false,
        "uuid": "dc7db7aa349a4bf98320fbb023ad41b4",
        "url": "https://integration.wikimedia.org/ci/job/mwselenium-quibble-docker/6761/",
        "worker": {
          "name": "Unknown",
          "extra": {},
          "hostname": null,
          "fqdn": null,
          "ips": [],
          "program": null,
          "version": null
        },
        "start_time": 1547747610.692198,
        "launch_time": 1547747610.310417,
        "number": 6761,
        "remaining_time": 195426,
        "node_name": null,
        "elapsed_time": 106774,
        "canceled": false,
        "report_url": "https://integration.wikimedia.org/ci/job/mwselenium-quibble-docker/6761/console",
        "end_time": null,
        "node_labels": [],
        "estimated_time": 302.2,
        "voting": true,
        "name": "mwselenium-quibble-docker"
      },
      {
        "result": null,
        "pipeline": "test",
        "retry": false,
        "uuid": "f2ea32d760d247dc98bf4a0f85964fe5",
        "url": "https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-npm-run-lint-modules-docker/3437/",
        "worker": {
          "name": "Unknown",
          "extra": {},
          "hostname": null,
          "fqdn": null,
          "ips": [],
          "program": null,
          "version": null
        },
        "start_time": 1547747610.798867,
        "launch_time": 1547747610.314774,
        "number": 3437,
        "remaining_time": 6133,
        "node_name": null,
        "elapsed_time": 106667,
        "canceled": false,
        "report_url": "https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-npm-run-lint-modules-docker/3437/console",
        "end_time": null,
        "node_labels": [],
        "estimated_time": 112.8,
        "voting": true,
        "name": "mwext-MobileFrontend-npm-run-lint-modules-docker"
      }
    ],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747468865,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": true,
    "remaining_time": 721882,
    "zuul_ref": "Zb614e2a29ad241eb97de9c728b138802",
    "active": true,
    "id": "483010,15"
  },
  {
    "failing_reasons": [],
    "items_behind": [
      "483515,14"
    ],
    "jobs": [],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747469445,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": false,
    "remaining_time": 0,
    "zuul_ref": "Z71cbc83f0d7d4efaa2f00f663c3d7f03",
    "active": true,
    "id": "483010,15"
  },
  {
    "failing_reasons": [],
    "items_behind": [
      "483515,14"
    ],
    "jobs": [],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747469635,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": false,
    "remaining_time": 0,
    "zuul_ref": "Zf9bce70f9a2c438dadb19dbd7c3039ef",
    "active": true,
    "id": "483010,15"
  },
  {
    "failing_reasons": [],
    "items_behind": [
      "483515,14"
    ],
    "jobs": [],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747470134,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": false,
    "remaining_time": 0,
    "zuul_ref": "Z5e0d65cd518c4d648c463133d9b5aa47",
    "active": true,
    "id": "483010,15"
  },
  {
    "failing_reasons": [],
    "items_behind": [
      "483515,14"
    ],
    "jobs": [],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747470344,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": false,
    "remaining_time": 0,
    "zuul_ref": "Z08481c802b7b41fb9831688433f41a8e",
    "active": true,
    "id": "483010,15"
  },
  {
    "failing_reasons": [],
    "items_behind": [
      "483515,14"
    ],
    "jobs": [],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747470526,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": false,
    "remaining_time": 0,
    "zuul_ref": "Z3cdd6d541e9445738aafe70330dea726",
    "active": true,
    "id": "483010,15"
  },
  {
    "failing_reasons": [],
    "items_behind": [
      "483515,14"
    ],
    "jobs": [],
    "url": "https://gerrit.wikimedia.org/r/483010",
    "item_ahead": "482885,10",
    "enqueue_time": 1547747470714,
    "project": "mediawiki/extensions/MobileFrontend",
    "owner": {
      "username": "niedzielski",
      "name": "Niedzielski",
      "email": "sniedzielski@wikimedia.org"
    },
    "live": false,
    "remaining_time": 0,
    "zuul_ref": "Z06d0c18027144555a878e837d9c17510",
    "active": true,
    "id": "483010,15"
  }
]

Event Timeline

hashar created this task.Jan 17 2019, 6:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 17 2019, 6:03 PM

And the original JavaScript to do the magic looks like: https://github.com/openstack-infra/system-config/commit/0118d2b4b53cea2641c123a57c14bf8276237f09

Latest is https://github.com/openstack-infra/system-config/blob/master/modules/openstack_project/files/gerrit/hideci.js , see for example ci_zuul_display_status. It is probably easy to integrate on our Gerrit.

It's better if you build a polygerrit plugin then spending time on a GWTUI plugin. GWTUI has been removed upstream.

greg triaged this task as Normal priority.Jan 17 2019, 8:02 PM
Paladox added a comment.EditedJan 20 2019, 1:03 AM

We can use "change-view-integration" see https://chromium.googlesource.com/infra/gerrit-plugins/tricium/+/master/src/main/resources/static/tricium.html#16

(Requires upgrading to gerrit 2.16 though)

Paladox claimed this task.Jan 22 2019, 6:19 PM

I've built the plugin now, with a live version running on https://gerrit.git.wmflabs.org/r/

I've requested the repository at https://groups.google.com/forum/#!topic/repo-discuss/SuOU0FNUzI4 !

The repo has been created upstream and i have pushed the first initial commit https://gerrit-review.googlesource.com/c/plugins/zuul-status/+/212103

Paladox moved this task from Bugs & stuff to Local hacks on the Gerrit board.Feb 3 2019, 12:18 AM

Change 487619 had a related patch set uploaded (by Paladox; owner: Paladox):
[operations/puppet@production] gerrit: Set zuulUrl for plugin zuul-status

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

Change 487619 abandoned by Paladox:
gerrit: Set zuulUrl for plugin zuul-status

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

Change 488512 had a related patch set uploaded (by Paladox; owner: Paladox):
[All-Projects@refs/meta/config] gerrit: Set zuul-status plugin url

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

Change 488512 merged by Hashar:
[All-Projects@refs/meta/config] gerrit: Set zuul-status plugin url

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