Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get local files with vcs-repo-file-url #837

Closed
SteveMacenski opened this issue Nov 11, 2023 · 3 comments
Closed

Cannot get local files with vcs-repo-file-url #837

SteveMacenski opened this issue Nov 11, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@SteveMacenski
Copy link

SteveMacenski commented Nov 11, 2023

Description

I'm setting up GitHub Actions for a new open-source project for Nav2 users (to be released in coming weeks) and ran into a problem that I'm not sure how to get around. By the way, thank you for this great work! I was shocked at how straight forward your work has made setting up CI. Relative to the complexities we have in Nav2 due to our long build times, complicated simulations, and whatnot on CircleCI, this is a breath of fresh air.

I'm using your tests as an example:

vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test.repos"

vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test.repos"

but for my case (e.g. vcs-repo-file-url: "${{ github.workspace }}/.github/deps.repos") and having issues that it fails with:

Invoking: bash -c,vcs import --force --recursive src/ --input /__w/opennav_coverage/opennav_coverage/.github/deps.repos
  /usr/bin/bash -c vcs import --force --recursive src/ --input /__w/opennav_coverage/opennav_coverage/.github/deps.repos
  /usr/bin/vcs:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import load_entry_point
  usage: vcs import [-h] [--input FILE_OR_URL] [--force] [--shallow]
                    [--recursive] [--retry N] [--skip-existing] [--debug] [-w N]
                    [--repos]
                    [path]
  vcs import: error: argument --input: can't open '/__w/opennav_coverage/opennav_coverage/.github/deps.repos': [Errno 2] No such file or directory: '/__w/opennav_coverage/opennav_coverage/.github/deps.repos'
Error: The process '/usr/bin/bash' failed with exit code 2

I've verified repeatedly that deps.repos does exist, at that path, without typo.

For now, this is a private repository while its in development with a client before being released publicly. Could that have something to do with it? If so, I'm not worried about it since it'll be fixed shortly. Your documentation though makes me think the default github token should be fine since its all in the same repository as the workflow.

Expected Behavior

CI to find a locally specified path to a file using vcs-repo-file-url.

Actual Behavior

Cannot find it

System (please complete the following information)

  • OS: rostooling/setup-ros-docker:ubuntu-jammy-latest
  • ROS 2 Distro: Iron
name: Test
on:
  pull_request:
  push:
    branches:
      - main

jobs:
  build_and_test:
    runs-on: ubuntu-latest
    env:
      ROS_DISTRO: ${{ matrix.ros_distro }}
    container:
      image: rostooling/setup-ros-docker:ubuntu-jammy-latest
    strategy:
      fail-fast: false
      matrix:
          ros_distro: [iron]
    steps:
    - name: Build and run tests
      id: action-ros-ci
      uses: ros-tooling/action-ros-ci@v0.3
      with:
        import-token: ${{ secrets.GITHUB_TOKEN }}
        target-ros2-distro: ${{ matrix.ros_distro }}
        vcs-repo-file-url: ${{ github.workspace }}/.github/deps.repos
    - uses: actions/upload-artifact@v1
      with:
        name: colcon-logs
        path: ros_ws/log
@SteveMacenski SteveMacenski added the bug Something isn't working label Nov 11, 2023
@SteveMacenski
Copy link
Author

My gut instinct tells me I'm messing something up that's obvious / careless, but I'm not able to identify it 😄

@christophebedard
Copy link
Member

christophebedard commented Nov 13, 2023

I think what you're missing is the actions/checkout step: https://github.com/ros-tooling/action-ros-ci#build-with-a-custom-repos-or-rosinstall-file. If you don't include that step, then your repo isn't cloned into the runner's workspace. action-ros-ci clones the repo so it doesn't need the repo to be checked out beforehand, but you do need it when using vcs-repo-file-url.

And actions/checkout should work fine with your private repo.

@SteveMacenski
Copy link
Author

Exactly right -- thanks! It was a careless user error, I missed that line entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants