diff --git a/DESCRIPTION b/DESCRIPTION index d9d6fd78..86362475 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,15 +1,15 @@ Package: GitStats -Title: Get Statistics from 'GitHub' and 'GitLab' -Version: 2.1.1 +Title: Standardized Git Repository Data +Version: 2.1.2 Authors@R: c( person(given = "Maciej", family = "Banas", email = "banasmaciek@gmail.com", role = c("aut", "cre")), person(given = "Kamil", family = "Koziej", email = "koziej.k@gmail.com", role = "aut"), person(given = "Karolina", family = "Marcinkowska", email = "karolina_marcinkowska@onet.pl", role = "aut"), person(given = "Matt", family = "Secrest", email = "secrestm@gene.com", role = "aut") ) -Description: Obtain statistics in a standardized way from multiple 'Git' services: 'GitHub' and 'GitLab' for the time-being. - Its main purpose is to help teams, whose activities are spread across multiple git platforms, get their repository metadata - in a standardized way from all these platforms. +Description: Obtain standardized data from multiple 'Git' services, including 'GitHub' and 'GitLab'. + Designed to be 'Git' service-agnostic, this package assists teams with activities spread across various + 'Git' platforms by providing a unified way to access repository data. License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE, r6 = TRUE) diff --git a/NEWS.md b/NEWS.md index f953c45c..4c468524 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +# GitStats 2.1.2 + +This is a patch release which introduces some hot fixes and new data in `get_commits()` output. + +- Added `repo_url` column to output of `get_commits()` function ([#535](https://github.com/r-world-devs/GitStats/issues/535)). +- Fixed setting default tokens when `verbose` mode is set to `FALSE` ([#525](https://github.com/r-world-devs/GitStats/issues/525)) and fixed checking token scopes for GitLab ([#526](https://github.com/r-world-devs/GitStats/issues/526)). +- Fixed `get_repos_urls()` output when individual repositories are set in `set_*_host()`([#529](https://github.com/r-world-devs/GitStats/issues/529)). Earlier the function pulled all repositories for an organization, even though, repositories were defined for the host, not whole organizations. This is similar to the solved earlier ([#439](https://github.com/r-world-devs/GitStats/issues/439)). +- Fixed getting GitLab subgroups as organizations in repositories table output when pulling repositories with code ([#531](https://github.com/r-world-devs/GitStats/issues/531)). + # GitStats 2.1.1 This is a patch release which introduces some improvements in `get_R_package_usage()` on speed and possibility to pull at once data on multiple R packages, new `get_storage()` function and some fixes for checking token scopes and setting hosts. diff --git a/R/EngineGraphQLGitHub.R b/R/EngineGraphQLGitHub.R index aa20a36f..f75f827a 100644 --- a/R/EngineGraphQLGitHub.R +++ b/R/EngineGraphQLGitHub.R @@ -143,6 +143,8 @@ EngineGraphQLGitHub <- R6::R6Class( NA } commit$node$committed_date <- gts_to_posixt(commit$node$committed_date) + commit$node$repo_url <- commit$node$repository$url + commit$node$repository <- NULL commit$node }) commits_row$repository <- repo_name @@ -159,6 +161,10 @@ EngineGraphQLGitHub <- R6::R6Class( dplyr::relocate( any_of(c("author_login", "author_name")), .after = author + ) %>% + dplyr::relocate( + repo_url, + .before = api_url ) } return(commits_table) @@ -386,18 +392,18 @@ EngineGraphQLGitHub <- R6::R6Class( repo, since, until, - commits_cursor = "", - author_id = "") { - commits_by_org_query <- self$gql_query$commits_by_repo( - org = org, - repo = repo, - since = date_to_gts(since), - until = date_to_gts(until), - commits_cursor = commits_cursor, - author_id = author_id + commits_cursor = "") { + commits_by_org_query <- self$gql_query$commits_from_repo( + commits_cursor = commits_cursor ) response <- self$gql_response( - gql_query = commits_by_org_query + gql_query = commits_by_org_query, + vars = list( + "org" = org, + "repo" = repo, + "since" = date_to_gts(since), + "until" = date_to_gts(until) + ) ) return(response) }, diff --git a/R/EngineRestGitHub.R b/R/EngineRestGitHub.R index 5b8a69b1..86ec5e91 100644 --- a/R/EngineRestGitHub.R +++ b/R/EngineRestGitHub.R @@ -106,10 +106,15 @@ EngineRestGitHub <- R6::R6Class( }, #' Pull all repositories URLS from organization - get_repos_urls = function(type, org) { - repos_urls <- self$response( + get_repos_urls = function(type, org, repos) { + repos_response <- self$response( endpoint = paste0(private$endpoints[["organizations"]], org, "/repos") - ) %>% + ) + if (!is.null(repos)) { + repos_response <- repos_response %>% + purrr::keep(~ .$name %in% repos) + } + repos_urls <- repos_response %>% purrr::map_vec(function(repository) { if (type == "api") { repository$url diff --git a/R/EngineRestGitLab.R b/R/EngineRestGitLab.R index a11048ce..1324df50 100644 --- a/R/EngineRestGitLab.R +++ b/R/EngineRestGitLab.R @@ -107,7 +107,7 @@ EngineRestGitLab <- R6::R6Class( "languages" = paste0(project$languages, collapse = ", "), "issues_open" = project$issues_open, "issues_closed" = project$issues_closed, - "organization" = project$namespace$path, + "organization" = project$namespace$full_path, "repo_url" = project$web_url ) } @@ -142,7 +142,8 @@ EngineRestGitLab <- R6::R6Class( replacement = "", x = gsub(paste0("(.*)", org, "/"), "", commit$web_url) ), - "organization" = org + "organization" = org, + "repo_url" = stringr::str_match(commit$web_url, "(.*)/-/commit/.*")[2] ) }) }) @@ -166,10 +167,15 @@ EngineRestGitLab <- R6::R6Class( }, # Pull all repositories URLs from organization - get_repos_urls = function(type, org) { - repos_urls <- self$response( + get_repos_urls = function(type, org, repos) { + repos_response <- self$response( endpoint = paste0(private$endpoints[["organizations"]], utils::URLencode(org, reserved = TRUE), "/projects") - ) %>% + ) + if (!is.null(repos)) { + repos_response <- repos_response %>% + purrr::keep(~ .$path %in% repos) + } + repos_urls <- repos_response %>% purrr::map_vec(function(project) { if (type == "api") { project$`_links`$self diff --git a/R/GQLQueryGitHub.R b/R/GQLQueryGitHub.R index 555d3269..2c465b67 100644 --- a/R/GQLQueryGitHub.R +++ b/R/GQLQueryGitHub.R @@ -101,34 +101,21 @@ GQLQueryGitHub <- R6::R6Class("GQLQueryGitHub", }, #' @description Prepare query to get commits on GitHub. - #' @param org A GitHub organization. - #' @param repo Name of a repository. - #' @param since Git Time Stamp of starting date of commits. - #' @param until Git Time Stamp of end date of commits. #' @param commits_cursor An endCursor. - #' @param author_id An Id of an author. #' @return A query. - commits_by_repo = function(org, - repo, - since, - until, - commits_cursor = "", - author_id = "") { - if (nchar(author_id) == 0) { - author_filter <- author_id - } else { - author_filter <- paste0('author: { id: "', author_id, '"}') - } - - paste0('{ - repository(name: "', repo, '", owner: "', org, '") { + commits_from_repo = function(commits_cursor = "") { + paste0(' + query GetCommitsFromRepo($repo: String! + $org: String! + $since: GitTimestamp + $until: GitTimestamp){ + repository(name: $repo, owner: $org) { defaultBranchRef { target { ... on Commit { - history(since: "', since, '" - until: "', until, '" - ', private$add_cursor(commits_cursor), " - ", author_filter, ") { + history(since: $since + until: $until + ', private$add_cursor(commits_cursor), ") { pageInfo { hasNextPage endCursor @@ -147,6 +134,9 @@ GQLQueryGitHub <- R6::R6Class("GQLQueryGitHub", } additions deletions + repository { + url + } } } } diff --git a/R/GitHost.R b/R/GitHost.R index 3e325083..0fb6981c 100644 --- a/R/GitHost.R +++ b/R/GitHost.R @@ -516,8 +516,10 @@ GitHost <- R6::R6Class( set_default_token = function(verbose) { primary_token_name <- private$token_name token <- Sys.getenv(primary_token_name) - if (private$test_token(token) && verbose) { - cli::cli_alert_info("Using PAT from {primary_token_name} envar.") + if (private$test_token(token)) { + if (verbose) { + cli::cli_alert_info("Using PAT from {primary_token_name} envar.") + } } else { pat_names <- names(Sys.getenv()[grepl(primary_token_name, names(Sys.getenv()))]) possible_tokens <- pat_names[pat_names != primary_token_name] @@ -698,7 +700,8 @@ GitHost <- R6::R6Class( } repos_urls <- rest_engine$get_repos_urls( type = type, - org = org + org = org, + repos = private$set_repos(org) ) return(repos_urls) }, .progress = progress) %>% diff --git a/R/GitHostGitHub.R b/R/GitHostGitHub.R index f4e570df..4b0089c3 100644 --- a/R/GitHostGitHub.R +++ b/R/GitHostGitHub.R @@ -188,7 +188,9 @@ GitHostGitHub <- R6::R6Class( until = until, progress = progress ) %>% - graphql_engine$prepare_commits_table(org) + graphql_engine$prepare_commits_table( + org = org + ) return(commits_table_org) }, .progress = if (private$scan_all && progress) { "[GitHost:GitHub] Pulling commits..." diff --git a/R/GitHostGitLab.R b/R/GitHostGitLab.R index 428b6e0f..875dc083 100644 --- a/R/GitHostGitLab.R +++ b/R/GitHostGitLab.R @@ -184,27 +184,9 @@ GitHostGitLab <- R6::R6Class("GitHostGitLab", ) }, - # check token scopes - # response parameter only for need of super method + # An empty method to fullfill call from super class. check_token_scopes = function(response = NULL, token) { - private$token_scopes <- try({ - httr2::request(private$endpoints$tokens) %>% - httr2::req_headers("Authorization" = paste0("Bearer ", token)) %>% - httr2::req_perform() %>% - httr2::resp_body_json() %>% - purrr::keep(~ .$active) %>% - purrr::map(function(pat) { - data.frame(scopes = unlist(pat$scopes), date = pat$last_used_at) - }) %>% - purrr::list_rbind() %>% - dplyr::filter( - date == max(date) - ) %>% - dplyr::select(scopes) %>% - unlist() - }, - silent = TRUE) - any(private$access_scopes %in% private$token_scopes) + TRUE }, # Add `api_url` column to table. diff --git a/R/GitStats.R b/R/GitStats.R index 8d93cef7..46a6325f 100644 --- a/R/GitStats.R +++ b/R/GitStats.R @@ -700,7 +700,7 @@ GitStats <- R6::R6Class( progress = progress ) } else if (!is.null(with_files)) { - privater$get_repos_from_host_with_files( + private$get_repos_from_host_with_files( host = host, add_contributors = add_contributors, with_files = with_files, diff --git a/README.Rmd b/README.Rmd index 8f6de2aa..776f072b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -33,13 +33,15 @@ With GitStats you can pull git data in a uniform way (table format) from GitHub ## Installation -```r From CRAN: +```r install.packages("GitStats") +``` Or development version: +```r devtools::install_github("r-world-devs/GitStats") ``` diff --git a/README.md b/README.md index decb72a6..0d3003f3 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,15 @@ GitHub and GitLab. For the time-being you can get data on: ## Installation -``` r From CRAN: +``` r install.packages("GitStats") +``` Or development version: +``` r devtools::install_github("r-world-devs/GitStats") ``` diff --git a/inst/get_repos_urls_workflow.R b/inst/get_repos_urls_workflow.R index ad357185..b78979a0 100644 --- a/inst/get_repos_urls_workflow.R +++ b/inst/get_repos_urls_workflow.R @@ -6,3 +6,30 @@ test_gitstats <- create_gitstats() |> ) get_repos_urls(test_gitstats, with_code = "shiny") + +# should return 2 repos URLs +create_gitstats() %>% + set_github_host( + repos = c("r-world-devs/GitStats", "r-world-devs/shinyCohortBuilder") + ) %>% + get_repos_urls() + +# should return 2 repos URLs +create_gitstats() %>% + set_github_host( + repos = c("r-world-devs/GitStats", "r-world-devs/shinyCohortBuilder") + ) %>% + get_repos_urls(type = "api") + +create_gitstats() %>% + set_gitlab_host( + orgs = "mbtests" + ) %>% + get_repos_urls() + +# should return 1 repo URL +create_gitstats() %>% + set_gitlab_host( + repos = "mbtests/gitstatstesting" + ) %>% + get_repos_urls(type = "api") diff --git a/tests/testthat/_snaps/get_commits-GitHub.md b/tests/testthat/_snaps/get_commits-GitHub.md index 637aace0..2f631896 100644 --- a/tests/testthat/_snaps/get_commits-GitHub.md +++ b/tests/testthat/_snaps/get_commits-GitHub.md @@ -1,7 +1,7 @@ # commits_by_repo GitHub query is built properly Code - gh_commits_by_repo_query + gh_commits_from_repo_query Output - [1] "{\n repository(name: \"GitStats\", owner: \"r-world-devs\") {\n defaultBranchRef {\n target {\n ... on Commit {\n history(since: \"2023-01-01T00:00:00Z\"\n until: \"2023-02-28T00:00:00Z\"\n \n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n ... on Commit {\n id\n committed_date: committedDate\n author {\n name\n user {\n name\n login\n }\n }\n additions\n deletions\n }\n }\n }\n }\n }\n }\n }\n }\n }" + [1] "\n query GetCommitsFromRepo($repo: String!\n $org: String!\n $since: GitTimestamp\n $until: GitTimestamp){\n repository(name: $repo, owner: $org) {\n defaultBranchRef {\n target {\n ... on Commit {\n history(since: $since\n until: $until\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n ... on Commit {\n id\n committed_date: committedDate\n author {\n name\n user {\n name\n login\n }\n }\n additions\n deletions\n repository {\n url\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }" diff --git a/tests/testthat/_snaps/set_host.md b/tests/testthat/_snaps/set_host.md index e3e8c181..48d069fd 100644 --- a/tests/testthat/_snaps/set_host.md +++ b/tests/testthat/_snaps/set_host.md @@ -80,15 +80,6 @@ i Check if you use correct token. ! Scope that is needed: [read_api]. ---- - - Code - create_gitstats() %>% set_github_host(host = "wrong.url", orgs = c("openpharma", - "r_world_devs")) - Condition - Error: - ! Could not resolve host: wrong.url - # Error pops out, when two clients of the same url api are passed as input Code diff --git a/tests/testthat/helper-expect-responses.R b/tests/testthat/helper-expect-responses.R index a0590472..32dba117 100644 --- a/tests/testthat/helper-expect-responses.R +++ b/tests/testthat/helper-expect-responses.R @@ -112,7 +112,7 @@ expect_gh_commit_gql_response <- function(object) { ) expect_list_contains( object$node, - c("id", "committed_date", "author", "additions", "deletions") + c("id", "committed_date", "author", "additions", "deletions", "repository") ) } diff --git a/tests/testthat/helper-expect-tables.R b/tests/testthat/helper-expect-tables.R index 74b555b9..12043a2e 100644 --- a/tests/testthat/helper-expect-tables.R +++ b/tests/testthat/helper-expect-tables.R @@ -40,12 +40,12 @@ expect_commits_table <- function(get_commits_object, with_stats = TRUE, exp_auth commit_cols <- if (exp_author) { c( "id", "committed_date", "author", "author_login", "author_name", "additions", "deletions", - "repository", "organization", "api_url" + "repository", "organization", "repo_url", "api_url" ) } else { c( "id", "committed_date", "author", "additions", "deletions", - "repository", "organization", "api_url" + "repository", "organization", "repo_url", "api_url" ) } expect_s3_class(get_commits_object, "data.frame") diff --git a/tests/testthat/helper-fixtures.R b/tests/testthat/helper-fixtures.R index 6d574213..5fc10365 100644 --- a/tests/testthat/helper-fixtures.R +++ b/tests/testthat/helper-fixtures.R @@ -65,6 +65,13 @@ test_fixtures$github_repositories_rest_response <- list( test_fixtures$github_repository_rest_response, list( "id" = 2222222222222, + "name" = "testRepo2", + "html_url" = "https://testhost.com/test-org/TestRepo", + "url" = "https://testhost.com/api/v4/repos/test-org/TestRepo" + ), + list( + "id" = 2222222222222, + "name" = "testRepo3", "html_url" = "https://testhost.com/test-org/TestRepo", "url" = "https://testhost.com/api/v4/repos/test-org/TestRepo" ) @@ -73,10 +80,17 @@ test_fixtures$github_repositories_rest_response <- list( test_fixtures$gitlab_repositories_rest_response <- list( list( + "path" = "testRepo1", "_links" = list("self" = "https://gitlab.com/api/v4/projects/43400864"), "web_url" = "https://gitlab.com/mbtests/gitstats-testing-2" ), list( + "path" = "testRepo2", + "_links" = list("self" = "https://gitlab.com/api/v4/projects/43398933"), + "web_url" = "https://gitlab.com/mbtests/gitstatstesting" + ), + list( + "path" = "testRepo3", "_links" = list("self" = "https://gitlab.com/api/v4/projects/43398933"), "web_url" = "https://gitlab.com/mbtests/gitstatstesting" ) @@ -243,7 +257,10 @@ github_commit_edge <- list( ) ), "additions" = 5L, - "deletions" = 8L + "deletions" = 8L, + "repository" = list( + "url" = "test_url" + ) ) ) @@ -280,7 +297,7 @@ gitlab_commit <- list( "committed_date" = "2023-04-05T12:07:50.000+00:00", "trailers" = list(), "extedned_trailers" = list(), - "web_url" = "https://test_url.com", + "web_url" = "https://test_url.com/-/commit/sxsxsxsx", "stats" = list( "additions" = 1L, "deletions" = 0L, diff --git a/tests/testthat/test-get_commits-GitHub.R b/tests/testthat/test-get_commits-GitHub.R index c8b4e6e3..65433a53 100644 --- a/tests/testthat/test-get_commits-GitHub.R +++ b/tests/testthat/test-get_commits-GitHub.R @@ -1,15 +1,9 @@ test_that("commits_by_repo GitHub query is built properly", { - gh_commits_by_repo_query <- - test_gqlquery_gh$commits_by_repo( - org = "r-world-devs", - repo = "GitStats", - since = "2023-01-01T00:00:00Z", - until = "2023-02-28T00:00:00Z" - ) + gh_commits_from_repo_query <- + test_gqlquery_gh$commits_from_repo() expect_snapshot( - gh_commits_by_repo_query + gh_commits_from_repo_query ) - test_mocker$cache(gh_commits_by_repo_query) }) test_that("`get_commits_page_from_repo()` pulls commits page from repository", { diff --git a/tests/testthat/test-get_urls_repos-GitHub.R b/tests/testthat/test-get_urls_repos-GitHub.R index 9cada53a..fd0c2e75 100644 --- a/tests/testthat/test-get_urls_repos-GitHub.R +++ b/tests/testthat/test-get_urls_repos-GitHub.R @@ -1,4 +1,4 @@ -test_that("get_repos_urls() works", { +test_that("get_repos_urls() works for whole orgs", { mockery::stub( test_rest_github$get_repos_urls, "self$response", @@ -6,11 +6,30 @@ test_that("get_repos_urls() works", { ) gh_repos_urls <- test_rest_github$get_repos_urls( type = "web", - org = "test-org" + org = "test-org", + repos = NULL ) - expect_gt( - length(gh_repos_urls), - 0 + expect_length( + gh_repos_urls, + 3 + ) + test_mocker$cache(gh_repos_urls) +}) + +test_that("get_repos_urls() works for individual repos", { + mockery::stub( + test_rest_github$get_repos_urls, + "self$response", + test_fixtures$github_repositories_rest_response + ) + gh_repos_urls <- test_rest_github$get_repos_urls( + type = "web", + org = "test-org", + repos = c("testRepo", "testRepo2") + ) + expect_length( + gh_repos_urls, + 2 ) test_mocker$cache(gh_repos_urls) }) @@ -24,6 +43,7 @@ test_that("get_all_repos_urls prepares api repo_urls vector", { test_fixtures$github_repositories_rest_response ) gh_api_repos_urls <- test_rest_github$get_repos_urls( + repos = NULL, type = "api" ) expect_gt(length(gh_api_repos_urls), 0) diff --git a/tests/testthat/test-get_urls_repos-GitLab.R b/tests/testthat/test-get_urls_repos-GitLab.R index 5e743c0b..75f28141 100644 --- a/tests/testthat/test-get_urls_repos-GitLab.R +++ b/tests/testthat/test-get_urls_repos-GitLab.R @@ -1,4 +1,4 @@ -test_that("get_repos_urls() works", { +test_that("get_repos_urls() works for org", { mockery::stub( test_rest_gitlab$get_repos_urls, "self$response", @@ -6,20 +6,50 @@ test_that("get_repos_urls() works", { ) gl_api_repos_urls <- test_rest_gitlab$get_repos_urls( type = "api", - org = "mbtests" + org = "mbtests", + repos = NULL ) - expect_gt( - length(gl_api_repos_urls), - 0 + expect_length( + gl_api_repos_urls, + 3 ) test_mocker$cache(gl_api_repos_urls) gl_web_repos_urls <- test_rest_gitlab$get_repos_urls( type = "web", - org = "mbtests" + org = "mbtests", + repos = NULL ) - expect_gt( - length(gl_web_repos_urls), - 0 + expect_length( + gl_web_repos_urls, + 3 + ) + test_mocker$cache(gl_web_repos_urls) +}) + +test_that("get_repos_urls() works for individual repos", { + mockery::stub( + test_rest_gitlab$get_repos_urls, + "self$response", + test_fixtures$gitlab_repositories_rest_response + ) + gl_api_repos_urls <- test_rest_gitlab$get_repos_urls( + type = "api", + org = "mbtests", + repos = c("testRepo1", "testRepo2") + ) + expect_length( + gl_api_repos_urls, + 2 + ) + test_mocker$cache(gl_api_repos_urls) + gl_web_repos_urls <- test_rest_gitlab$get_repos_urls( + type = "web", + org = "mbtests", + repos = c("testRepo1", "testRepo2") + ) + expect_length( + gl_web_repos_urls, + 2 ) test_mocker$cache(gl_web_repos_urls) }) diff --git a/tests/testthat/test-helpers.R b/tests/testthat/test-helpers.R index 86b4a349..09bb8488 100644 --- a/tests/testthat/test-helpers.R +++ b/tests/testthat/test-helpers.R @@ -151,6 +151,30 @@ test_that("`test_token` works properly", { ) }) +test_that("`test_token` works properly", { + skip_on_cran() + expect_true( + gitlab_testhost_priv$test_token(Sys.getenv("GITLAB_PAT_PUBLIC")) + ) + expect_false( + gitlab_testhost_priv$test_token("false_token") + ) +}) + +test_that("`check_token_scopes` works for GitHub", { + skip_on_cran() + github_pat <- Sys.getenv("GITHUB_PAT") + github_response <- httr2::request("https://api.github.com") |> + httr2::req_headers("Authorization" = paste0("Bearer ", github_pat)) |> + httr2::req_perform() + expect_true( + github_testhost_priv$check_token_scopes( + response = github_response, + token = github_pat + ) + ) +}) + test_that("`set_default_token` sets default token for GitLab", { skip_on_cran() expect_snapshot( diff --git a/tests/testthat/test-set_host.R b/tests/testthat/test-set_host.R index 8329187a..cdeaf470 100644 --- a/tests/testthat/test-set_host.R +++ b/tests/testthat/test-set_host.R @@ -113,14 +113,14 @@ test_that("Error shows, when wrong input is passed when setting connection and h token = Sys.getenv("GITLAB_PAT_PUBLIC") ) ) - expect_snapshot({ + expect_error({ create_gitstats() %>% set_github_host( host = "wrong.url", orgs = c("openpharma", "r_world_devs") ) }, - error = TRUE + "Could not resolve host." ) }) @@ -173,3 +173,21 @@ test_that("Error pops out when `org` does not exist", { error = TRUE ) }) + +test_that("Setting verbose for set_*_host() to FALSE works fine", { + skip_on_cran() + expect_no_error( + create_gitstats() %>% + set_github_host( + orgs = c("openpharma", "r-world-devs"), + verbose = FALSE + ) + ) + expect_no_error( + create_gitstats() %>% + set_gitlab_host( + orgs = "mbtests", + verbose = FALSE + ) + ) +})