precommit icon indicating copy to clipboard operation
precommit copied to clipboard

Can additional dependencies include private github repositories?

Open danielinteractive opened this issue 3 years ago • 4 comments
trafficstars

Hello developers,

is pre-commit able to fetch private github repos as dependencies? I am currently trying to setup the precommit config yaml for an R-package that depends on another private github repository R-package, but it seems it cannot find it - my guess is because it is internal and therefore (?) not exposed in the API? In particular, https://api.github.com/repos/orgname/reponame cannot be retrieved and gives 404. Are any workarounds possible here? Maybe it is something we can fix in our github settings? or provide tokens or so?

Thanks, cheers Daniel

danielinteractive avatar May 20 '22 08:05 danielinteractive

The install process is implemented in the upstream framework https://pre-commit.com, as part of the language: r functionality (I contributed it). The source code is here. Did you figure out how to install the private dependency with {renv} outside a pre-commit setting? Please post that here (with hidden tokens :D and other private info).

Then, we can maybe file an issue upstream to support it. There were a few issues upstream on configuration of hook environments on install, in particular https://github.com/pre-commit/pre-commit/issues/758, but it seems to me that we'll probably need another solution than those proposed in the issue, as additional_dependencies won't work for us.

lorenzwalthert avatar May 20 '22 09:05 lorenzwalthert

Thanks @lorenzwalthert - I will check in our team if we can use {renv} for this, and then come back

danielinteractive avatar May 20 '22 09:05 danielinteractive

Well not exactly. Clarification: your repo does not have to use renv. pre-commit has its own install mechanisms based on renv. So all I need you to do is to figure out how to install from a private repo with renv in any context. Then we will figure out how to adapt the upstream framework. Bonus: you create a private repo with no content that we can use as a reprex.

lorenzwalthert avatar May 20 '22 10:05 lorenzwalthert

Yeah that is what I meant :-) thx!

danielinteractive avatar May 20 '22 10:05 danielinteractive

Any update here? Otherwise I'd vote to close this.

lorenzwalthert avatar Jan 29 '23 17:01 lorenzwalthert

Hm I think I solved this in the end but forgot how. So we can close

danielinteractive avatar Jan 30 '23 13:01 danielinteractive