Add Zuul's event id to Ansible inventory

With the event id in the inventory we can use it in the emit-job-header
role. This can aid in debugging, e.g. when a job is still running.

Change-Id: Id2d38bb3d121fa9cf959b9765ac8025d42001c02
This commit is contained in:
Simon Westphahl
2020-02-06 11:20:21 +01:00
parent 7e4bfb68f3
commit e00ce4ce4e
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -309,6 +309,11 @@ of item.
The name of the job being run.
.. var:: event_id
The UUID of the event that triggered this execution. This is mainly
useful for debugging purposes.
.. var:: voting
A boolean indicating whether the job is voting.
+1
View File
@@ -78,6 +78,7 @@ class TestInventoryGithub(TestInventoryBase):
self.assertIn('executor', z_vars)
self.assertIn('src_root', z_vars['executor'])
self.assertIn('job', z_vars)
self.assertIn('event_id', z_vars)
self.assertEqual(z_vars['job'], 'single-inventory')
self.assertEqual(z_vars['message'], 'QQ==')
self.assertEqual(z_vars['change_url'],
+1
View File
@@ -165,6 +165,7 @@ class ExecutorClient(object):
project=project,
tenant=tenant.name,
timeout=job.timeout,
event_id=item.event.zuul_event_id,
jobtags=sorted(job.tags),
_inheritance_path=list(job.inheritance_path))
if job.artifact_data: