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

[v4] git as implied requirement #1320

Open
DArtagan opened this issue Mar 7, 2024 · 6 comments
Open

[v4] git as implied requirement #1320

DArtagan opened this issue Mar 7, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@DArtagan
Copy link

DArtagan commented Mar 7, 2024

Hi, I've been tracking the progress of v4 - to move our company over when possible.

We run our tests and codecov in a container. With this most recent version (4.1.0), an error is thrown:

Error: Unable to locate executable file: git. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

Which makes sense - we don't have git installed inside that container. Is it intentionally a requirement for uploading with codecov?

In looking for a work-around I also noticed one possible typo I wanted to raise, diable. For example:

const disableSafeDirectory = isTrue(core.getInput('diable_safe_directory'));

Thanks - let me know if there's any additional information I can provide.

@DArtagan
Copy link
Author

DArtagan commented Mar 26, 2024

Typo fixed in #1343! Whether git is an intentional requirement for uploading remains an open question.

@thomasrockhu-codecov
Copy link
Contributor

@rohan-at-sentry to investigate and prioritize, the CLI I think is not git agnostic.

@rohan-at-sentry
Copy link
Contributor

@DArtagan , yes git is indeed a requirement for the CLI today.

Were you able to find a workaround for your usecase?

@DArtagan
Copy link
Author

DArtagan commented May 2, 2024

I couldn't find documentation about it, so we've just not upgraded to v4.

@rohan-at-sentry
Copy link
Contributor

@DArtagan this is now documented better on our docs here.

I'm wondering if you were able to try running the CLI in docker as outlined here?

@DArtagan
Copy link
Author

DArtagan commented May 15, 2024

I do appreciate the updated docs. Honestly, when setting it up the Action - we just used what was written in the README of this repo. (I don't think that README yet mentions that this Action is dependent on a Git binary.)

If I'm following, the "Running test within containers" link you included seems to be a short two sentences linking to "Here's how you can set up Codecov CLI to upload to Codecov". That page suggests CURLing a script from a URL and bash-executing it to set environment variables? Emotional reaction: that gives me the heebie-jeebies for a production pipeline - one has no control over what's on the other side of the URL, it feels unsafe. No hashing or anything to guarantee consistent deterministic behaviour. But it also wouldn't install Git into the container either.

Happily our Workflow is pretty much right out of the README example. Though we first ask the GitHub runner to spin up the container, and then run all following commands inside it:

jobs:
  python-tests:
    container:
      image: ${{ inputs.image }}  # our container image name
    steps:
      - name: Run Python tests
        run: python -m pytest --cov=app --cov-report xml:coverage/coverage.xml --cov-report term:skip-covered
      - uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457
        with:
          token: ${{ secrets.codecov_token }}
          files: /coverage/.coverage,/coverage/coverage.xml,/coverage/lcov.info
          flags: unittests
          fail_ci_if_error: true
          root_dir: /app

@DArtagan DArtagan changed the title [v4] safe directoy git error [v4] git as implied requirement May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants