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

Error while caching git repo when package is in a subdirectory #172

Open
cicdguy opened this issue Jan 10, 2023 · 0 comments
Open

Error while caching git repo when package is in a subdirectory #172

cicdguy opened this issue Jan 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@cicdguy
Copy link
Collaborator

cicdguy commented Jan 10, 2023

Summary

If an R package exists in a subdirectory of a git repo, during the caching process an error is encountered due to the subdirectory not being recognized as a git repository.

Steps to reproduce

In a shell:

# Clone sample R package
git clone [email protected]:insightsengineering/r.pkg.template.git
cd r.pkg.template

# Create subdirectory and move R package contents to subdirectory
mkdir subdirectory
mv * subdirectory
cd subdirectory

In an R console:

# Attempt to compute dependency table
x <- staged.dependencies::dependency_table()

The error:

Copying local dir ~/r.pkg.template/subdirectory to cache dir ~/.staged.dependencies/packages_cache/local_insightsengineering_r.pkg.template_d98eb848af25dc4c5b9e8dab434f64c7
Error in repository(repo) : The 'path' is not in a git repository

Potential solutions

  1. Skip cache in case of failure
  2. Add option to skip_cache in the dependency_table function
  3. Cache the root of the project
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