[repo_setup] Fix git clone failure when using local filesystem path#3710
[repo_setup] Fix git clone failure when using local filesystem path#3710stuggi wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
2e39285 to
e9ab6ae
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/da6266e0c66c429e9722a885a43eb01d ❌ openstack-k8s-operators-content-provider FAILURE in 3m 54s |
e9ab6ae to
fe2df36
Compare
The git module fails when cifmw_repo_setup_src points to a local path (e.g., in Zuul CI environments) and the source repository is in detached HEAD state. The module tries to resolve 'HEAD' from the source repo and fails with "pathspec 'None' did not match any file(s) known to git". This fix adds conditional logic to: - Use ansible.builtin.copy for local filesystem paths (starts with '/') - Use ansible.builtin.git with proper version parameter for git URLs Additionally, adds a new variable cifmw_repo_setup_git_ref to explicitly control which git branch, tag, or commit to checkout when cloning the repo-setup repository (defaults to 'main'). This allows the role to work in both Zuul CI (where repos are pre-checked out locally) and manual deployments (where git URLs are used). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
fe2df36 to
ec87fce
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ce45d9a9260a46f0bac6de7263220cd6 ✔️ openstack-k8s-operators-content-provider SUCCESS in 29m 00s |
|
recheck |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/43eda46691e14254aec18dbeb9f92182 ✔️ openstack-k8s-operators-content-provider SUCCESS in 27m 48s |
|
recheck |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/98f38bd0a5b94e0da9d022e90be2abf7 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 29m 13s |
|
recheck |
The git module fails when cifmw_repo_setup_src points to a local path and the source repository is in detached HEAD state. The module tries to resolve 'HEAD' from the source repo and fails with "pathspec 'None' did not match any file(s) known to git".
This fix adds conditional logic to:
This allows the role to work in both, where repos are pre-checked out locally, and manual deployments (where git URLs are used).