Better check if we're in CI during collection bootstrap

Current behaviour may treat git+file combination as one being Zuul-treated
as when zuul_src_path is an empty string, path is still be located
and added as `zuul_item` while deployer might want it to be as local git
repo.

This patch adds another verification to ensure zuul_src_path
is defined and we're in CI before doing adjustments

Change-Id: I0acd3a14faf57d6c1bd64af9f36105df8b27b714
This commit is contained in:
Dmitriy Rabotyagov 2024-04-22 15:32:09 +02:00 committed by Dmitriy Rabotyagov
parent 506d3bae49
commit 8a5b27f9c2
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixes user-collection-requirements bootstrap process, when defied by
deployer collection uses "git+file" as a source scheme. Previously
an unexpected version of collection could get installed when using
"git+file" scheme.

View File

@ -63,7 +63,7 @@
source: "{{ zuul_src_path }}/{{ item.item.source.split('/')[2:] | join('/') | replace('#', '') }}"
type: "dir"
set_fact:
galaxy_collections_list_ci: "{{ galaxy_collections_list_ci | default([]) + [ (item.stat.exists | ternary(zuul_item, item.item)) ] }}"
galaxy_collections_list_ci: "{{ galaxy_collections_list_ci | default([]) + [(zuul_src_path and item.stat.exists) | ternary(zuul_item, item.item)] }}"
with_items: "{{ zuul_collections.results }}"
- name: Create temporary file for galaxy collection requirements