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

326 new search package usage function #327

Merged
merged 10 commits into from
Dec 8, 2023

Conversation

maciekbanas
Copy link
Member

No description provided.

maciekbanas and others added 5 commits November 10, 2023 09:36
… importantly, a message handler has been added to tackle 403 error on public GitHub side. Also, a new `silence` parameter has been added, as a new function is simply a wrapper over existing ones, and calling it with all the messages would be superfluous. Some optimization in expect-tests.
@maciekbanas maciekbanas requested a review from Cotau November 15, 2023 08:02
@maciekbanas maciekbanas self-assigned this Nov 15, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Attention: 195 lines in your changes are missing coverage. Please review.

Comparison is base (1081673) 75.40% compared to head (d534e09) 84.05%.
Report is 181 commits behind head on devel.

❗ Current head d534e09 differs from pull request most recent head e02b2d4. Consider uploading reports for the commit e02b2d4 to get more accurate results

Files Patch % Lines
R/GitHost.R 72.72% 51 Missing ⚠️
R/EngineGraphQLGitLab.R 78.88% 34 Missing ⚠️
R/EngineRestGitHub.R 80.81% 33 Missing ⚠️
R/EngineGraphQLGitHub.R 79.83% 25 Missing ⚠️
R/GQLQueryGitHub.R 72.00% 14 Missing ⚠️
R/EngineRestGitLab.R 79.36% 13 Missing ⚠️
R/GQLQueryGitLab.R 88.63% 10 Missing ⚠️
R/GitStats.R 90.56% 10 Missing ⚠️
R/gitstats_functions.R 86.48% 5 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #327      +/-   ##
==========================================
+ Coverage   75.40%   84.05%   +8.64%     
==========================================
  Files          12       15       +3     
  Lines         992     1837     +845     
==========================================
+ Hits          748     1544     +796     
- Misses        244      293      +49     

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

Copy link
Collaborator

@Cotau Cotau left a comment

Choose a reason for hiding this comment

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

It seems to be runing nice, but I did encounter some errors, when following your workflow:

timeouts when scraping open repositories, I assume that this was to be expected but is there a way of extending timeouts or perhaps running it in chunks so that the code won't miss any important information?
`> check_package_usage(

  • test_gitstats,
  • "purrr" #enter a name of a package you want to search for
  • )
    ℹ Checking [purrr] package usage across repositories...
    ℹ HTTP 403 error: I will run request one more time after 60 secs...
    HTTP 403 API limit reached. 25% | ETA: 1m
    HTTP 400 Bad Request.■■■ 75% | ETA: 1m`

While running the code for internal repositories I also got some errors:
ℹ Checking [R****Templates] package usage across repositories... Empty object - will not be saved. 75% | ETA: 2m

what's more, while checking results it showed some repositories that were not updated since 2019 or 2020 which is long before "R****Templates" was introduced. Is that a logic error to be taken care of, or is it something regular here? if so should we cover it with some additional explanation?

…y errors), fixing search responses, changing logic of checking usage of a package (two separate functions); also as a side effect of previous attempts add possibility to pull files on given repos (although it is not used now, it may be in the future). Additionaly remove `silence` field from settings as there is no need to use it, change name of check_package to check_R_package.
@maciekbanas maciekbanas requested a review from Cotau December 1, 2023 11:17
@@ -256,6 +292,11 @@ GitStats <- R6::R6Class("GitStats",
private$files
},

#' @description Return R_package_usage table from GitStats.
get_R_package_usage = function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would create an output in more user friendly form as api links are not straightforward readable. I would add links to the repositories and repo names. Other than this it seems that the amuont of output is reasonable but that is to bu further investigation.

Copy link
Collaborator

@Cotau Cotau left a comment

Choose a reason for hiding this comment

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

please change the output of this search more user friendly

…me columns of repository output to standardize with files output. Add pulling files by repositories option to GitLab which was missing.
@maciekbanas maciekbanas requested a review from Cotau December 5, 2023 10:43
@maciekbanas maciekbanas mentioned this pull request Dec 5, 2023
19 tasks
Copy link
Collaborator

@Cotau Cotau left a comment

Choose a reason for hiding this comment

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

lgtm

@maciekbanas maciekbanas merged commit 46d3722 into devel Dec 8, 2023
2 checks passed
@maciekbanas maciekbanas deleted the 326-new-search-package_usage-function branch December 8, 2023 08:15
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