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

Edge cases: No revdep, Pkg checked not installed, Pkg not on CRAN #6

Closed
coatless opened this issue Jan 23, 2018 · 5 comments
Closed

Edge cases: No revdep, Pkg checked not installed, Pkg not on CRAN #6

coatless opened this issue Jan 23, 2018 · 5 comments

Comments

@coatless
Copy link

@coatless coatless commented Jan 23, 2018

Listing the edge cases in one issue as they have the same underlying error message and I'm trying to exceed 200 words 😎

Issues

  1. Package lacks reverse dependencies. c.f. pkgKitten
  2. Package not installed, could be from a typo et cetera. Would be nice if there was a warning...
  3. Package not on CRAN

Error Diagnostics

All edge cases give warnings like:

inqueue <- enqueueJobs("pkgKitten", ".")
# Error: title is not a string (length 1 character)

outqueue <- dequeueJobs("pkgKitten", ".")
# NA_NA started at 2018-01-23 00:01:13 Warning in download.packages(tok[1], ".", quiet = TRUE) : 
# no package ‘NA’ at the repositories

Protection

Largely the case since:

Empty data.table (0 rows) of 2 cols: Package,Version

will be empty during:

prrd/R/enqueue.R

Lines 36 to 40 in e936686

for (i in 1:n) {
ttl <- paste0(work[i,Package])
msg <- paste(work[i,Package], work[i, Version], sep="_")
publish(q, title = ttl, message = msg)
}

I think one bit we discussed was adding with = FALSE (data.table's drop = FALSE) inside the work subset

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jan 23, 2018

Part is fixiing 1:n for the loop to seq_len(nrow(work)) but that still needs special for empty, and single row.

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jan 23, 2018

"Package not on CRAN" is not valid; you may have different options(repos) -- we have a local-to-work drat repo at work. "Somewhere in available.packages() output" is a better test.

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jan 23, 2018

"Not installed" is not valid I think.

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jan 24, 2018

This really reduced down to one additional check, and that I made. The n=1 case is taken care of by data.table.

@coatless
Copy link
Author

@coatless coatless commented Jan 24, 2018

Great! I'll give it a whirl and see if I can break it more 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.