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

Function deletePackage added #119

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Function deletePackage added #119

wants to merge 12 commits into from

Conversation

tonytonov
Copy link

Following up the discussion in #81, created a deletePackage functionality. Documentation and tests are included. Also spotted two minor inconsistencies in the existing code -- see diff for details.

The tests don't cover mac.binary -- I am using a snapshot which doesn't have Mac packages for 3.5 for some reason -- maybe there's a simple workaround you can come up with. A test case works with a dependency graph of existing packages -- let me know if you need details. There are some explanatory comments as well.

I ran devtools::check, and apart from the vignette building (which seems like a process performed differently?), everything looks good.

@codecov-io
Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #119 into master will increase coverage by 0.75%.
The diff coverage is 93.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   74.05%   74.81%   +0.75%     
==========================================
  Files          13       14       +1     
  Lines         636      663      +27     
==========================================
+ Hits          471      496      +25     
- Misses        165      167       +2
Impacted Files Coverage Δ
R/addPackages.R 81.53% <100%> (-0.15%) ⬇️
R/deletePackages.R 92.85% <92.85%> (ø)

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 abe1b31...d55dd8f. Read the comment docs.

@andrie
Copy link
Owner

andrie commented Jul 2, 2019

Thanks for this work.

I have created a new branch 119-deletePackages that rebases your PR onto the current dev branch, and I suggest we use that branch as the working copy.

@andrie
Copy link
Owner

andrie commented Jul 2, 2019

I have made some comments in the code, but I have one remaining, bigger question.

If I understand this PR correctly, when you remove a package, all of the reverse dependencies will also be removed. If that's the case, is there a danger that the repo can end up in an inconsistent state?

For example:

  • Package A depends on C
  • Package B also depends on C

Now you decide to remove package B. What happens to C, and what does it mean for the state of A?

@tonytonov
Copy link
Author

Thanks. I'll go through your comments this week.
I'll have to take a closer look at my tests to confirm that, but I remember I was aware of that problem. So for every package in the "to be deleted" package list I'm checking if this package is safe to delete. The package is safe to delete only when it's not used by any other package.
I'll double-check that and get back to you. Naturally, we may consider introducing stricter rules for deletion.

@tonytonov
Copy link
Author

@andrie You mentioned comments in the code -- how can I see them?

@andrie
Copy link
Owner

andrie commented Jul 4, 2019

Interesting - my expectation was that you would receive an email pointing to the comments. You can access these on github by clicking on the "Files changed" button in the PR. This is the link:

https://github.com/andrie/miniCRAN/pull/119/files

NAMESPACE Show resolved Hide resolved
@tonytonov
Copy link
Author

tonytonov commented Jul 4, 2019 via email

@andrie
Copy link
Owner

andrie commented Jul 4, 2019

Hmm. I just added you to "assignees" - hopefully that makes a difference?

@tonytonov
Copy link
Author

Sadly, no. I can see the on/off switch for comments, and it is on. Maybe I need to reopen the PR after its' rebase, no clue.

image

@achubaty
Copy link
Collaborator

achubaty commented Jul 4, 2019

@andrie I can't see comments either. If you began commenting using the review functionality, you may not have clicked "submit review".

image

R/deletePackages.R Outdated Show resolved Hide resolved
R/deletePackages.R Outdated Show resolved Hide resolved
if (!is.null(d[[pkg]])) d[[pkg]] else character()
})))
l <- list(...)
if ('reverse' %in% names(l)) {
Copy link
Owner

Choose a reason for hiding this comment

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

This is a bit unclear to me what's the desired behaviour. It seems that if reverse is in the dots, you always set reverse = FALSE?

I think this will benefit from writing the ... explicitly as arguments.

@andrie
Copy link
Owner

andrie commented Jul 6, 2019

Thanks for the pointer, @achubaty. I think that was indeed the problem, so hopefully you can now see my comments.

@bollard
Copy link

bollard commented Mar 25, 2022

Is there any prospect of this being merged and released? Would be a really useful feature. Thanks

@tonytonov
Copy link
Author

Oh my, I never got that last notification about the review, so I didn't know it got stuck on my end. @andrie would you be willing to consider this PR again? If so, I'll try to resurrect it :)

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.

5 participants