-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
…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.
Codecov ReportAttention: Patch coverage is
❗ 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. |
There was a problem hiding this 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.
…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.
There was a problem hiding this 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
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.