10000 Pass all authentication and build arguments to dependencies by jimhester · Pull Request #145 · r-lib/remotes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pass all authentication and build arguments to dependencies #145

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

Merged
merged 4 commits into from
Aug 31, 2018

Conversation

jimhester
Copy link
Member

We now pass all authentication arguments and build arguments to remotes
and dependencies. This means you can supply the authentication
in in the top level install_() call and have that same authentication
be used in downstream Remotes.

This also should propagate upgrade to dependencies appropriately, so
setting upgrade = FALSE should disable upgrading for all dependencies,
even grandchildren.

Fixes #86
Fixes #53

@jimhester jimhester requested a review from gaborcsardi August 28, 2018 19:58
@jimhester jimhester force-pushed the pass_arguments branch 2 times, most recently from e080620 to b228918 Compare August 28, 2018 20:45
We now pass all authentication arguments and build arguments to remotes
and dependencies. This means you can supply the authentication
in in the top level `install_()` call and have that same authentication
be used in downstream Remotes.

This also should propagate upgrade to dependencies appropriately, so
setting `upgrade = FALSE` should disable upgrading for all dependencies,
even grandchildren.

Fixes r-lib#53
Fixes r-lib#86
Fixes r-lib#87
@codecov-io
Copy link
codecov-io commented Aug 29, 2018

Codecov Report

Merging #145 into master will decrease coverage by 6.65%.
The diff coverage is 94.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
- Coverage   92.84%   86.19%   -6.66%     
==========================================
  Files          29       29              
  Lines        1650     1666      +16     
==========================================
- Hits         1532     1436      -96     
- Misses        118      230     +112
Impacted Files Coverage Δ
R/install-local.R 100% <ø> (ø) ⬆️
R/install-git.R 90.47% <ø> (ø) ⬆️
R/install-cran.R 90% <ø> (ø) ⬆️
R/install-url.R 94.11% <ø> (ø) ⬆️
R/install-github.R 57.47% <0%> (-37.94%) ⬇️
R/install-svn.R 93.24% <100%> (ø) ⬆️
R/install-bitbucket.R 92.18% <100%> (ø) ⬆️
R/install-gitlab.R 90.9% <100%> (ø) ⬆️
R/install.R 95.94% <100%> (+0.17%) ⬆️
R/install-bioc.R 89.76% <100%> (-0.16%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1d9e0f...f7ce9a1. Read the comment docs.

@jimhester jimhester force-pushed the pass_arguments branch 2 times, most recently from 5ccaa43 to d197a70 Compare August 29, 2018 15:32
build, build_opts) {
dependencies = FALSE, quiet = NULL) {

# We want to pass only args that exist in the downstream functions
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really love this, but I am not sure of a better way to do it, you could list even more arguments here to catch them, but that seems like it would be a pain to maintain as the possible number of arguments in the install_() functions increases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it would be nice to have some "centralized" solution for this. But it will do here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we required that all install functions take ... and then use ellipsis to warn if an argument is never evaluated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remotes does not have dependencies, by design. ellipsis already has compiled code, and will trigger the DLL locking issue on Windows.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, oops, I forgot about that constraint.

jimhester 8000 added 2 commits August 29, 2018 13:42
They now get passed all arguments from the parent call, but some of them
are not applicable to the remote constructor
@jimhester
Copy link
Member Author

@gaborcsardi This could be reviewed now when you have time

Copy link
Member
@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty straightforward, looks great, thanks!

8000

build, build_opts) {
dependencies = FALSE, quiet = NULL) {

# We want to pass only args that exist in the downstream functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it would be nice to have some "centralized" solution for this. But it will do here.

@jimhester jimhester merged commit 9c60442 into r-lib:master Aug 31, 2018
@jimhester
Copy link
Member Author

Thanks for the review!

packages,
repos = repos,
type = type,
dependencies = dependencies,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to translate dependencies = TRUE to dependencies = NA to avoid installing all suggested dependencies of dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on an empirical test, this works fine, at least install_github("r-lib/processx", dependencies = TRUE) only installs Suggests for processx.

antoine-sachet added a commit to antoine-sachet/remotes that referenced this pull request Apr 10, 2019
Effectively reverts r-lib#145. This will break the install of private dependencies for people who used the auth_token (or equivalent) argument. It is however easy and more robust to pass credentials to the deps via environment variables.
@antoine-sachet antoine-sachet mentioned this pull request Apr 10, 2019
jimhester pushed a commit that referenced this pull request Apr 10, 2019
Effectively reverts some of #145. This will break the install of private dependencies for people who used the auth_token (or equivalent) argument. It is however easy and more robust to pass credentials to the deps via environment variables.

Fixes #337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0