Skip to content

Commit 74441a3

Browse files
committed
Use zuul clonned repos for upstream in build_openstack_packages role
In build_openstack_packages role for building rpms from gerrit and github, we are clonning the repo and checking out specific change. With these tasks, we are not able to build dlrn rpms if we have multiple prs/crs from same project. But we want to build rpms from all changes. In order to fix, Zuul knows how to checkout proper repos with changes under test and from Depends-on. DLRN always looks for clonned repos in DLRN data directory. In order to use zuul clonned sources with DLRN, We are creating symlink to dlrn data project directory and let's dlrn do the job for upstream repos only. Note: we reverted the similar pr[1] here as original change was lacking proper condition[2] leading to breaking downstream build openstack packages role. By adding proper conditional for upstream, it fixes the issue. Links: [1]. openstack-k8s-operators#2818 [2]. openstack-k8s-operators@f79ca6f#diff-fedeaff036de20345e170c4f65374926975f17139c058369f2e909565054e1adR118-L134 Signed-off-by: Chandan Kumar (raukadah) <[email protected]>
1 parent 93b065d commit 74441a3

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

roles/build_openstack_packages/tasks/parse_and_build_pkgs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'project': item.project.name,
2020
'branch': item.branch,
2121
'change': item.change,
22+
'src_dir': item.project.src_dir,
2223
'refspec': '/'.join(['refs', 'changes',
2324
item.change[-2:],
2425
item.change,

roles/build_openstack_packages/tasks/run_dlrn.yml

+6-20
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,15 @@
114114
dest: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
115115
version: '{{ _change.branch }}'
116116

117-
- name: "Clone {{ project_name_mapped.stdout }} from Github" # noqa: name[template]
117+
- name: "Symlink {{ project_name_mapped.stdout }} from Zuul clonned repos for upstream" # noqa: name[template]
118118
when:
119119
- cifmw_bop_openstack_project_path | length == 0
120120
- not repo_status.stat.exists
121-
- "'host' in _change"
122-
- "'github.com' in _change.host"
123-
ansible.builtin.git:
124-
repo: '{{ _change.host }}/{{ _change.project }}'
125-
dest: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
126-
refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
127-
version: 'origin/pr/{{ _change.change }}/head'
128-
129-
- name: "Clone Openstack {{ project_name_mapped.stdout }}" # noqa: name[template]
130-
when:
131-
- cifmw_bop_openstack_project_path | length == 0
132-
- not repo_status.stat.exists
133-
- "'host' in _change"
134-
- "'opendev' in _change.host"
135-
ansible.builtin.git:
136-
repo: '{{ _change.host }}/{{ _change.project }}'
137-
dest: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
138-
refspec: "{{ _change.refspec }}"
139-
version: 'FETCH_HEAD'
121+
- cifmw_bop_osp_release is not defined
122+
ansible.builtin.file:
123+
src: '{{ ansible_user_dir }}/{{ _change.src_dir }}'
124+
path: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
125+
state: link
140126

141127
- name: "Update packages.yml to use zuul repo for {{ project_name_mapped.stdout }}" # noqa: name[template], command-instead-of-module
142128
vars:

0 commit comments

Comments
 (0)