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

Reorganize code for setting hosts, remove plot functions. #383

Merged
merged 15 commits into from
Apr 4, 2024

Conversation

maciekbanas
Copy link
Member

Reorganizing hosts with new user functions, new host subclasses, organizing host code into functions, moving methods, optimizing token checks (moving them from engine to host class), changing idea of setting up engines (no iteration, but explicit set up of engine), cleaning code from supportive methods. Adjust tests: new test host classes.

…g hosts with new user functions, new host subclasses, organizing host code into functions, moving methods, optimizing token checks (moving them from engine to host class), changing idea of setting up engines (no iteration, but explicit set up of engine), cleaning code from supportive methods. Adjust tests: new test host classes.
@maciekbanas maciekbanas self-assigned this Mar 27, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 88.98305% with 39 lines in your changes are missing coverage. Please review.

Project coverage is 80.85%. Comparing base (1081673) to head (32491d2).
Report is 238 commits behind head on devel.

❗ Current head 32491d2 differs from pull request most recent head 71c68b3. Consider uploading reports for the commit 71c68b3 to get more accurate results

Files Patch % Lines
R/test_helpers.R 41.66% 21 Missing ⚠️
R/GitHost.R 92.99% 11 Missing ⚠️
R/EngineRestGitLab.R 70.00% 3 Missing ⚠️
R/EngineGraphQL.R 50.00% 1 Missing ⚠️
R/EngineGraphQLGitHub.R 66.66% 1 Missing ⚠️
R/GitHostGitHub.R 97.72% 1 Missing ⚠️
R/GitHostGitLab.R 98.33% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #383      +/-   ##
==========================================
+ Coverage   75.40%   80.85%   +5.44%     
==========================================
  Files          12       15       +3     
  Lines         992     2230    +1238     
==========================================
+ Hits          748     1803    +1055     
- Misses        244      427     +183     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@marcinkowskak marcinkowskak left a comment

Choose a reason for hiding this comment

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

When trying to set connection I get error:


> git_stats <- create_gitstats() %>%
+   set_github_host(
+     orgs = c("r-world-devs", "openpharma")
+   ) %>%
+   set_github_host(
+     host = "github.roche.com",
+     orgs = "RWDScodeshare"
+   ) %>%
+   set_gitlab_host(
+     host = "code.roche.com",
+     orgs = "RWDInsightsEngineering"
+   )
ℹ Using PAT from GITHUB_PAT envar.
ℹ Your search parameter set to [org].
ℹ Checking passed organizations...
✔ Set connection to GitHub.
ℹ Using PAT from GITHUB_PAT_ROCHE envar.
ℹ Your search parameter set to [org].
ℹ Checking passed organizations...
✔ Set connection to GitHub.
Error in `purrr::map_vec()`:
! `out[[1]]` must have size 1, not size 7.
Run `rlang::last_trace()` to see where the error occurred.
> rlang::last_trace()
<error/vctrs_error_assert_size>
Error in `purrr::map_vec()`:
! `out[[1]]` must have size 1, not size 7.
---
Backtrace:
     ▆
  1. ├─... %>% ...
  2. ├─GitStats::set_gitlab_host(., host = "code.roche.com", orgs = "RWDInsightsEngineering")
  3. │ └─gitstats_obj$set_gitlab_host(...) at GitStats/R/gitstats_functions.R:74:3
  4. │   └─GitHostGitLab$new(...) at GitStats/R/GitStats.R:89:7
  5. │     └─GitStats (local) initialize(...)
  6. │       └─super$initialize(orgs = orgs, repos = repos, token = token, host = host) at GitStats/R/GitHostGitLab.R:15:7
  7. │         └─private$set_token(token) at GitStats/R/GitHost.R:26:7
  8. │           └─private$set_default_token() at GitStats/R/GitHost.R:249:9
  9. │             └─private$test_token(token) at GitStats/R/GitHost.R:404:7
 10. │               └─private$check_token_scopes(response, token) at GitStats/R/GitHost.R:428:9
 11. │                 └─... %>% unlist() at GitStats/R/GitHostGitLab.R:102:7
 12. ├─base::unlist(.)
 13. ├─dplyr::select(., scopes)
 14. ├─dplyr::filter(., date == max(date))
 15. └─purrr::map_vec(...)
Run rlang::last_trace(drop = FALSE) to see 6 hidden frames.

@maciekbanas maciekbanas marked this pull request as ready for review March 28, 2024 11:31
…super correct, but check_orgs_and_repos set private$scan_all which needs to be before setting up engines, as the parameter is passed to engines.
Copy link
Collaborator

@marcinkowskak marcinkowskak left a comment

Choose a reason for hiding this comment

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

Left some minor comments regarding documentation

vignettes/get_repositories.Rmd Outdated Show resolved Hide resolved
R/GitStats.R Outdated Show resolved Hide resolved
R/GitStats.R Outdated Show resolved Hide resolved
R/GitStats.R Show resolved Hide resolved
R/gitstats_functions.R Outdated Show resolved Hide resolved
R/gitstats_functions.R Show resolved Hide resolved
_pkgdown.yml Show resolved Hide resolved
@maciekbanas maciekbanas mentioned this pull request Apr 4, 2024
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.

3 participants