Skip to content

Commit df1f099

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 df1f099

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
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-19
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,16 @@
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
121121
- "'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'
122+
- ("'github.com' in _change.host") or ("'opendev' in _change.host")
123+
ansible.builtin.file:
124+
src: '{{ ansible_user_dir }}/{{ _change.src_dir }}'
125+
path: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
126+
state: link
140127

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

0 commit comments

Comments
 (0)