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

notify user if directory contains lots of files on load #1603

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

kevinushey
Copy link
Collaborator

Closes #1573.

@kevinushey kevinushey requested a review from hadley July 26, 2023 23:46
""
)

renv_scope_options(renv.verbose = TRUE)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this suggests that the writef() should actually be a warning?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel like we need something like ewritef(), or some other version of writef() that ignores renv.verbose.

@@ -932,15 +941,26 @@ renv_snapshot_dependencies_impl <- function(project, type = NULL, dev = FALSE) {
if (elapsed < limit)
return()

renv_scope_options(renv.verbose = TRUE)
Copy link
Member

Choose a reason for hiding this comment

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

Duplicated below

@@ -391,6 +391,9 @@ renv_dependencies_find_dir <- function(path, root, depth) {
# list children
children <- renv_dependencies_find_dir_children(path, root, depth)

# notify about number of children
renv_condition_signal("renv.dependencies.count", list(path = path, count = length(children)))
Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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


# try to collect snapshot dependencies
renv_scope_options(renv.dependencies.elapsed_time_threshold = 0)
expect_snapshot(. <- renv_snapshot_dependencies(project))
Copy link
Member

Choose a reason for hiding this comment

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

If we stick with the writef(), I'd suggest adding a renv_scope_options(renv.verbose = FALSE) to assert that the warning is displayed even when not verbose.

@kevinushey
Copy link
Collaborator Author

I'm going to merge this and consider your comments as follow-up for #1607.

@kevinushey kevinushey merged commit bbe3b52 into main Jul 27, 2023
@hadley hadley deleted the bugfix/load-dependency-notification branch July 27, 2023 18:45
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.

renv 1.0.0 check on startup can lead to long session loading time
2 participants