Since the pipeline state is stored in ZooKeeper, there could be cases
where the change_queues key is missing in the status json. This makes
API requests fail:
2022-02-22 17:56:18,390 ERROR cherrypy.error.139989033522128: [22/Feb/2022:17:56:18] HTTP
Traceback (most recent call last):
File "/opt/zuul/lib/python3.8/site-packages/cherrypy/_cprequest.py", line 638, in respond
self._do_respond(path_info)
File "/opt/zuul/lib/python3.8/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
response.body = self.handler()
File "/opt/zuul/lib/python3.8/site-packages/cherrypy/lib/encoding.py", line 223, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/opt/zuul/lib/python3.8/site-packages/cherrypy/lib/jsontools.py", line 59, in json_handler
value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
File "/opt/zuul/lib/python3.8/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
return self.callable(*self.args, **self.kwargs)
File "/opt/zuul/lib/python3.8/site-packages/zuul/web/__init__.py", line 1050, in status_change
return result_filter.filterPayload(payload)
File "/opt/zuul/lib/python3.8/site-packages/zuul/web/__init__.py", line 193, in filterPayload
for change_queue in pipeline['change_queues']:
KeyError: 'change_queues'
Fix this by using a .get() call rather than directly accessing the
dictionary key by name.
A similar issue was already fixed in [1].
[1]: https://review.opendev.org/c/zuul/zuul/+/829018
Change-Id: I947f58f02c3da7dad35d1fc186c7026800f7cbdd
The gearman RPC methods are being removed, so this needs a change
to work with one of the web-based methods. The most simpla end
forward-looking method is zuul-client, so update it to use that.
Change-Id: If3f6ca4bae2b2beddb3bb71b36fdcba112722186
The patchset or ref, pipeline and project should be enough to trigger an
enqueue. The trigger argument is not validated or used anymore when
enqueueing via RPC.
Change-Id: I9166e6d44291070f01baca9238f04feedcee7f5b
When using zuul-changes to save pipeline states one currently needs to
have a list of all tenant/pipeline combinations in the deployment. In
large deployments this can be a hassle. Making tenant and pipeline
optional makes this quite easy to save a complete pipeline state of
the entire zuul deployment.
Change-Id: Ibfa0bf3e3d23c729e24c208699294ef143f20945
For the existing simple cases, like builds, jobs and status, having the json
suffix is a perfectly reasonable thing. However, in the next patch it starts
to get weird. When we add support for specific changes or specific jobs, we
we grow URLs like:
/openstack/status.json
/openstack/status/change/537010,2.json
Those read weird, because change/537010,2 is much more like an argument or
specialiation of status. The thing that reads weird is the status call having
.json but the change-specific call just being status/, not
the trailing .json on the change url.
Removing the json suffix gets us:
/openstack/status
/openstack/status/change/537010,2
which feels better as the status portion of the url remains consistent.
This is done first in the stack so that as we add tests for new
endpoints we can get them right the first time rather than having a big
rename patch at the end (which is what this started as)
Change-Id: I4baf33fdacaf46943fbd192743551bb27bd618de
The script prints a gerrit review command for every change in
a given zuul pipeline.
Change-Id: Ibdee87ea64c977e7589cbc3ee9567e866cb78341
Reviewed-on: https://review.openstack.org/23784
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins