Allow to define artg_change_list variable in zuul jobs

Previously, artg_change_list in role build-test-packages would default
to an empty list if not defined. Now, artg_change_list will default to
job.artg_change_list which itself defaults to empty list. This allows
us to specify variable artg_change_list in Zuul jobs. If role
build-test-packages is executed locally, then a locally defined
artg_change_list still has higher precedence, as expected.

Previously, if a change had e.g. a 'Depends-On:' statement in its
commit message, the artg_change_list variable would be overwritten
with patches defined in the 'Depends-On:' statements. Now, patches
listed in 'Depends-On:' will be added to the artg_change_list
variable instead of overwriting its contents.

Both functionality is required in our TripleO jobs in the Ansible
OpenStack collection. There we want to build the RPM of
openstacksdk from its upstream master branch instead of using the
pinned version provided by RDO [1].

[1] f482a6ecc4/tags/zed-uc.yml (L467)

Change-Id: If44fe00bda10faa61df1dff9dc6da2ea26aa6b59
This commit is contained in:
Jakob Meng 2022-07-15 09:08:28 +02:00
parent 9f54c3129e
commit ff64ea937c
1 changed files with 2 additions and 2 deletions

View File

@ -165,7 +165,7 @@
set_fact:
gerrit_host: "{{ lookup('env', 'GERRIT_HOST') }}"
zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES') }}"
artg_change_list: "{{ artg_change_list|default([]) }}"
artg_change_list: "{{ artg_change_list|default(job.artg_change_list|default([])) }}"
cacheable: true
- name: Parse Jenkins changes
@ -206,7 +206,7 @@
- name: Cache artg_change_list if change list is prepared
set_fact:
artg_change_list: "{{ artg_change_list_prep }}"
artg_change_list: "{{ artg_change_list|union(artg_change_list_prep) }}"
cacheable: true
when: artg_change_list_prep is defined