CI against python package with custom .repos file fails
ijnek opened this issue · 6 comments
Description
The Build with a custom repos
or rosinstall
file instructions fails for a python package with a setup.cfg
file in the repository root directory.
This issue has been discussed and a draft PR (ros-tooling/setup-ros#408) has been raised (which doesn't work), but I believe that the issue originates from the usage of actions/checkout@v2
as specified in the instructions provided in the README of this repo.
If actions/checkout@v2
is purely to access a .repos file, can't we obtain it from the repository cloned into src/${randomStringPrefix}/${repo["repo"]}/
instead?
Currently, the following code exists in index.js
const resolvedUrl = resolveVcsRepoFileUrl(vcsRepoFileUrl);
yield execShellCommand([`vcs import --force --recursive src/ --input ${resolvedUrl}`], options);
Although the solution below won't work for URLs, for local file paths something like below would work:
const resolvedUrl = resolveVcsRepoFileUrl(vcsRepoFileUrl);
yield execShellCommand([`vcs import --force --recursive src/ --input src/${randomStringPrefix}/${repo["repo"]}/${resolvedUrl}`], options);
and for a repo that contains a file dependencies.repos
, we can omit actions/checkout
, and just have:
steps:
- uses: ros-tooling/setup-ros@v0.2
- uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: my_package
target-ros2-distro: galactic
vcs-repo-file-url: dependencies.repos
My alternative code doesn't handle many cases so isn't a solution, but is what I'd expect instead of using actions/checkout.
Expected Behavior
CI for a python package containing a custom .repos
file to succeed.
Actual Behavior
To Reproduce
- Go to https://github.com/ijnek/nao_button_sim/
- Fork project
- Manually run "Build and Test (foxy)" workflow on the
github-ci-problem-reproduce
branch. - Build will fail and error logs will show.
System (please complete the following information)
- OS: ubuntu-latest
- ROS 2 Distro: foxy, galactic, rolling
My alternative code doesn't handle many cases so isn't a solution, but is what I'd expect instead of using actions/checkout.
In what cases does this not work? Other than handling URLs and all.
In my use case I have the .repos file in my repository, but the instructions in Build with a custom repos
or rosinstall
file generate a .repos before action-ros-ci using rosinstall_generator
.
I haven't really thought about how rosinstall_generator would work without running actions/checkout
first.
Friendly ping @christophebedard, what are your thoughts on this?
@ijnek sorry for the delay. I did some investigation yesterday and today, and I think I found a fix: ros-tooling/setup-ros#466. See also ros-tooling/setup-ros#75 (comment)
Also note that you're using vcs-file-repo-url
instead of vcs-repo-file-url
in your repo here, so it simply gets ignored. The actual issue described above still applies of course.
@christophebedard Thank you for looking into this. As you pointed out, I had file and repo the other way around. The changes on your branch do seem to fix the issue.
This should now be fixed with ros-tooling/setup-ros@v0.2
, @0.2.2
, or @master
.