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

Fix for verbose parameter. #424

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# GitStats 2.0.1

This is a patch release with some hot issues that needed to be addressed, notably covering `set_*_host()` functions with `verbose` control, fixing pulling data for GitLab subgroups and substantially speeding up `get_files()` function.
This is a patch release with some hot issues that needed to be addressed, notably covering `set_*_host()` functions with `verbose` control, tweaking a bit `verbose` feature in general, fixing pulling data for GitLab subgroups and speeding up `get_files()` function.

## Features:

- Getting files feature has been speeded up with switching to `Search API` instead of pulling files via `GraphQL` via iteration over organizations and repositories ([#411](https://github.com/r-world-devs/GitStats/issues/411)).
- Getting files feature has been speeded up when `GitStats` is set to scan whole hosts, with switching to `Search API` instead of pulling files via `GraphQL` (with iteration over organizations and repositories) ([#411](https://github.com/r-world-devs/GitStats/issues/411)).
- When setting hosts to be scanned in whole (without specifying `orgs` or `repos`) GitStats does not pull no more all organizations. Pulling all organizations from host is triggered only when user decides to pull repositories from organizations. If he decides, e.g. to pull repositories by code, there is no need to pull all organizations (which may be a time consuming process), as GitStats uses then `Search API` ([#393](https://github.com/r-world-devs/GitStats/issues/393)).
- It is now possible to mute messages also from `set_*_host()` functions with `verbose_off()` or `verbose` parameter ([#413](https://github.com/r-world-devs/GitStats/issues/413)).
- Setting `verbose` to `FALSE` does not lead to hiding output of the `get_*()` functions - i.e. a glimpse of table will always appear after pulling data, even if the `verbose` is switched off. `verbose` parameter serves now only the purpose to show and hide messages to user ([#423](https://github.com/r-world-devs/GitStats/issues/423)).

## Fixes:

Expand Down
12 changes: 6 additions & 6 deletions R/GitStats.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ GitStats <- R6::R6Class("GitStats",
verbose = verbose
)
}
if (verbose) dplyr::glimpse(repositories)
dplyr::glimpse(repositories)
return(invisible(repositories))
},

Expand Down Expand Up @@ -135,7 +135,7 @@ GitStats <- R6::R6Class("GitStats",
verbose = verbose
)
}
if (verbose) dplyr::glimpse(commits)
dplyr::glimpse(commits)
return(invisible(commits))
},

Expand Down Expand Up @@ -185,7 +185,7 @@ GitStats <- R6::R6Class("GitStats",
verbose = verbose
)
}
if (verbose) dplyr::glimpse(users)
dplyr::glimpse(users)
return(invisible(users))
},

Expand Down Expand Up @@ -214,7 +214,7 @@ GitStats <- R6::R6Class("GitStats",
verbose = verbose
)
}
if (verbose) dplyr::glimpse(files)
dplyr::glimpse(files)
return(invisible(files))
},

Expand Down Expand Up @@ -250,7 +250,7 @@ GitStats <- R6::R6Class("GitStats",
verbose = verbose
)
}
if (verbose) dplyr::glimpse(release_logs)
dplyr::glimpse(release_logs)
return(invisible(release_logs))
},

Expand Down Expand Up @@ -288,7 +288,7 @@ GitStats <- R6::R6Class("GitStats",
verbose = verbose
)
}
if (verbose) dplyr::glimpse(R_package_usage)
dplyr::glimpse(R_package_usage)
return(invisible(R_package_usage))
},

Expand Down
11 changes: 6 additions & 5 deletions R/gitstats_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ set_gitlab_host <- function(gitstats_object,
#' result from its storage.
#' @param verbose A logical, `TRUE` by default. If `FALSE` messages and printing
#' output is switched off.
#' @return A data.frame.
#' @examples
#' \dontrun{
#' my_gitstats <- create_gitstats() %>%
Expand Down Expand Up @@ -147,7 +148,7 @@ get_repos <- function(gitstats_object,
#' result from its storage.
#' @param verbose A logical, `TRUE` by default. If `FALSE` messages and
#' printing output is switched off.
#' @return A `GitStats` class object with commits table.
#' @return A data.frame.
#' @examples
#' \dontrun{
#' my_gitstats <- create_gitstats() %>%
Expand Down Expand Up @@ -227,7 +228,7 @@ get_commits_stats = function(gitstats_object,
#' )
#' get_users(my_gitstats, c("maciekabanas", "marcinkowskak"))
#' }
#' @return A `GitStats` object with table of users.
#' @return A data.frame.
#' @export
get_users <- function(gitstats_object,
logins,
Expand Down Expand Up @@ -263,7 +264,7 @@ get_users <- function(gitstats_object,
#' )
#' get_files(my_gitstats, c("LICENSE", "DESCRIPTION"))
#' }
#' @return A `GitStats` object with table of files.
#' @return A data.frame.
#' @export
get_files <- function(gitstats_object,
file_path,
Expand All @@ -289,7 +290,7 @@ get_files <- function(gitstats_object,
#' result from its storage.
#' @param verbose A logical, `TRUE` by default. If `FALSE` messages and
#' printing output is switched off.
#' @return A table of repositories content.
#' @return A data.frame.
#' @examples
#' \dontrun{
#' my_gitstats <- create_gitstats() %>%
Expand Down Expand Up @@ -320,7 +321,7 @@ get_R_package_usage <- function(
#' @name get_release_logs
#' @description Pull release logs from repositories.
#' @inheritParams get_commits
#' @return A table with release logs.
#' @return A data.frame.
#' @examples
#' \dontrun{
#' my_gitstats <- create_gitstats() %>%
Expand Down
2 changes: 1 addition & 1 deletion man/get_R_package_usage.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_commits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_release_logs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/get_repos.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_users.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading