Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fixes and improvements for strategies #26
Fixes and improvements for strategies #26
Changes from 20 commits
d86414e
aad9662
261ed9b
c7d2368
81dcef0
3edf4e6
37b6748
9821383
c9f98e5
4352850
d940853
0579af9
c2d4b99
89f3b76
f65c8b3
e58166a
33e7277
846f5b0
a470d97
9796b12
5a3a6d9
0f6b80e
ac12fea
31ff448
5370242
7ae7b72
109db00
047d3f2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still struggle to fully understand what it does and why it is there.
You have the following:
d$get_remotes()[!(remotes_pkg %in% new_ref_pkg)]
is a vector of remotes not present in config/needs/verdepchecknew_ref_remote
is vector with config/needs/verdepcheck refs for packages existing in remotes fieldSo essentially it's (conditionally) replacing remotes entries with config/needs/verdepcheck entries. OK seems that I get what it does while writing this comment.
UPDATE: I just came up with example where you actually remove some entries so it's not only about replacing one with another. Then I guess we can modify for loop with
if (cond1) then NULL else if (cond2) x else y
$get_remotes()
twice - also not a big dealnew_refs
,new_ref_remote
,new_ref_remote
and none of them indicates new references for remote fieldHow about a simple for loop:
desc_cond_set_refs
first and thendesc_remotes_cleanup
using one argument only indicating desc object. This could potentially simplify naming issue as well as it fits to the role better - you want to replace desc remotes field with another field (that is being extracted from the same desc object and not another argument)Please have a look at
get_refs_from_desc
executed at the very beginning of each installation proposal constructor - it is that function which is responsible for preparing correct list of references for further analysis. I would even ask if we need a Remotes at all - as we already / should have everything we need in the config/needs/verdepcheck. That field can potentially have downstream implications so I am inclined to request to always clear it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally speaking it seems that it's just
new_remotes_refs <- setdiff(remotes_refs, new_refs)
- i.e. remove remotes that exists in the second fun arg. You seem to donew_remotes_refs <- c(setdiff(remotes_refs, setdiff(new_refs, remotes_refs)), setdiff(new_refs, remotes_refs))
which is a little bit more complex to follow and fully understand. Am I right with my thinking? Is there any reason why we are doing it this way?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to remove all packages that have been resolved to a CRAN package and modify the ones that resolved to a GitHub tag.
I think the code below better describes the logic.
note: the
setdiff
should only output a non-empty vector if the DESCRIPTION is badly formedTransforming:
To:
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.