From 1c57af7c165943b17a7c9d4932a1cede723ab98e Mon Sep 17 00:00:00 2001 From: banasm Date: Tue, 14 May 2024 06:48:06 +0000 Subject: [PATCH 1/2] Fix for verbose and update NEWS. Verbose does not control printed output no more. --- NEWS.md | 5 +++-- R/GitStats.R | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index d3f120bb..edad46e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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: diff --git a/R/GitStats.R b/R/GitStats.R index 0f9f3fe9..507d2f21 100644 --- a/R/GitStats.R +++ b/R/GitStats.R @@ -96,7 +96,7 @@ GitStats <- R6::R6Class("GitStats", verbose = verbose ) } - if (verbose) dplyr::glimpse(repositories) + dplyr::glimpse(repositories) return(invisible(repositories)) }, @@ -135,7 +135,7 @@ GitStats <- R6::R6Class("GitStats", verbose = verbose ) } - if (verbose) dplyr::glimpse(commits) + dplyr::glimpse(commits) return(invisible(commits)) }, @@ -185,7 +185,7 @@ GitStats <- R6::R6Class("GitStats", verbose = verbose ) } - if (verbose) dplyr::glimpse(users) + dplyr::glimpse(users) return(invisible(users)) }, @@ -214,7 +214,7 @@ GitStats <- R6::R6Class("GitStats", verbose = verbose ) } - if (verbose) dplyr::glimpse(files) + dplyr::glimpse(files) return(invisible(files)) }, @@ -250,7 +250,7 @@ GitStats <- R6::R6Class("GitStats", verbose = verbose ) } - if (verbose) dplyr::glimpse(release_logs) + dplyr::glimpse(release_logs) return(invisible(release_logs)) }, @@ -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)) }, From 10c56e7eca631b0dd86433b7fd06409c9af4188a Mon Sep 17 00:00:00 2001 From: banasm Date: Tue, 14 May 2024 07:35:22 +0000 Subject: [PATCH 2/2] Fix documentation. --- R/gitstats_functions.R | 11 ++++++----- man/get_R_package_usage.Rd | 2 +- man/get_commits.Rd | 2 +- man/get_files.Rd | 2 +- man/get_release_logs.Rd | 2 +- man/get_repos.Rd | 3 +++ man/get_users.Rd | 2 +- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/R/gitstats_functions.R b/R/gitstats_functions.R index df00de28..31950f77 100644 --- a/R/gitstats_functions.R +++ b/R/gitstats_functions.R @@ -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() %>% @@ -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() %>% @@ -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, @@ -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, @@ -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() %>% @@ -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() %>% diff --git a/man/get_R_package_usage.Rd b/man/get_R_package_usage.Rd index 92b95055..4f794e07 100644 --- a/man/get_R_package_usage.Rd +++ b/man/get_R_package_usage.Rd @@ -27,7 +27,7 @@ result from its storage.} printing output is switched off.} } \value{ -A table of repositories content. +A data.frame. } \description{ Wrapper over searching repositories by code blobs related to diff --git a/man/get_commits.Rd b/man/get_commits.Rd index 1720df4a..7a402613 100644 --- a/man/get_commits.Rd +++ b/man/get_commits.Rd @@ -26,7 +26,7 @@ result from its storage.} printing output is switched off.} } \value{ -A \code{GitStats} class object with commits table. +A data.frame. } \description{ List all commits from all repositories for an organization or a diff --git a/man/get_files.Rd b/man/get_files.Rd index 07d0216f..caf57174 100644 --- a/man/get_files.Rd +++ b/man/get_files.Rd @@ -24,7 +24,7 @@ result from its storage.} printing output is switched off.} } \value{ -A \code{GitStats} object with table of files. +A data.frame. } \description{ Pull files content from Git Hosts. diff --git a/man/get_release_logs.Rd b/man/get_release_logs.Rd index e6ba9f86..ef945bc4 100644 --- a/man/get_release_logs.Rd +++ b/man/get_release_logs.Rd @@ -26,7 +26,7 @@ result from its storage.} printing output is switched off.} } \value{ -A table with release logs. +A data.frame. } \description{ Pull release logs from repositories. diff --git a/man/get_repos.Rd b/man/get_repos.Rd index a7a9e740..f18c34a2 100644 --- a/man/get_repos.Rd +++ b/man/get_repos.Rd @@ -35,6 +35,9 @@ result from its storage.} \item{verbose}{A logical, \code{TRUE} by default. If \code{FALSE} messages and printing output is switched off.} } +\value{ +A data.frame. +} \description{ List all repositories for an organization or by a keyword. } diff --git a/man/get_users.Rd b/man/get_users.Rd index 94318d8f..c77ca201 100644 --- a/man/get_users.Rd +++ b/man/get_users.Rd @@ -23,7 +23,7 @@ result from its storage.} printing output is switched off.} } \value{ -A \code{GitStats} object with table of users. +A data.frame. } \description{ Pull users data from Git Host.