Skip to content

[repo_setup] Fix git clone failure when using local filesystem path#3710

Open
stuggi wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
stuggi:local_repo_setup
Open

[repo_setup] Fix git clone failure when using local filesystem path#3710
stuggi wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
stuggi:local_repo_setup

Conversation

@stuggi
Copy link
Contributor

@stuggi stuggi commented Feb 24, 2026

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:

  • Use ansible.builtin.copy for local filesystem paths (starts with '/')
  • Use ansible.builtin.git with proper version parameter for git URLs

This allows the role to work in both, where repos are pre-checked out locally, and manual deployments (where git URLs are used).

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 24, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eshulman2 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@danpawlik danpawlik requested a review from a team February 24, 2026 15:50
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/da6266e0c66c429e9722a885a43eb01d

openstack-k8s-operators-content-provider FAILURE in 3m 54s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal-minor-update SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ cifmw-pod-zuul-files SUCCESS in 5m 27s
⚠️ adoption-standalone-to-crc-ceph-provider SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 45s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 48s
cifmw-molecule-build_openstack_packages FAILURE in 3m 31s
cifmw-molecule-repo_setup FAILURE in 3m 33s

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>
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ce45d9a9260a46f0bac6de7263220cd6

✔️ openstack-k8s-operators-content-provider SUCCESS in 29m 00s
podified-multinode-edpm-deployment-crc RETRY_LIMIT in 11m 17s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 14m 35s
cifmw-crc-podified-edpm-baremetal-minor-update RETRY_LIMIT in 14m 36s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 41s
adoption-standalone-to-crc-ceph-provider RETRY_LIMIT in 11m 38s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 40s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 21s
cifmw-molecule-build_openstack_packages FAILURE in 10m 22s
✔️ cifmw-molecule-repo_setup SUCCESS in 4m 13s

@stuggi
Copy link
Contributor Author

stuggi commented Feb 25, 2026

recheck

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/43eda46691e14254aec18dbeb9f92182

✔️ openstack-k8s-operators-content-provider SUCCESS in 27m 48s
podified-multinode-edpm-deployment-crc RETRY_LIMIT in 11m 23s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 14m 30s
cifmw-crc-podified-edpm-baremetal-minor-update RETRY_LIMIT in 14m 41s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 29s
adoption-standalone-to-crc-ceph-provider RETRY_LIMIT in 11m 36s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 15m 09s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 46s
cifmw-molecule-build_openstack_packages FAILURE in 10m 15s
✔️ cifmw-molecule-repo_setup SUCCESS in 4m 36s

@stuggi
Copy link
Contributor Author

stuggi commented Feb 25, 2026

recheck

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/98f38bd0a5b94e0da9d022e90be2abf7

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 29m 13s
podified-multinode-edpm-deployment-crc RETRY_LIMIT in 22m 35s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 30m 40s
cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 2h 12m 54s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 19s
adoption-standalone-to-crc-ceph-provider RETRY_LIMIT in 22m 17s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 40s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 28s
cifmw-molecule-build_openstack_packages FAILURE in 11m 18s
✔️ cifmw-molecule-repo_setup SUCCESS in 4m 58s

@stuggi
Copy link
Contributor Author

stuggi commented Feb 25, 2026

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants