Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Fetch user activity from GitHub using httpx & asyncio #355

Merged
merged 20 commits into from
Aug 28, 2021

Conversation

alysivji
Copy link
Member

@alysivji alysivji commented Aug 28, 2021

What does this do

  • create AsyncGitHubClient that uses httpx and asyncio to fetch data asynchronously
  • reduced surface area of old GitHubClient to the one function that is used
  • removed a lot of unit tests for the GitHub Summary feature and replaced them with end-to-end tests that use vcr.py to replay requests made with httpx
    • not really happy with the way this feature was implemented, there are a lot of leaky abstractions which know too much information about other classes
  • started to refactor the post_github_summary_message task by inlining each of the steps
    • again, not happy with the leaky abstractions; trying to make the data flow in a way that makes sense
  • updated black

Why are we doing this

Part of #352

How should this be tested

  • removed a lot of unit tests since we are in the middle of a refactor
  • added end-to-end tests which show the feature works as expected

Migrations

n/a

Dependencies

n/a

Callouts

  • ran a benchmark on my localhost... for 26 users, went from ~3-4 seconds to around 1.5 second

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2021

Codecov Report

Merging #355 (8a9c026) into master (1d2c06d) will decrease coverage by 0.15%.
The diff coverage is 97.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
- Coverage   89.67%   89.51%   -0.16%     
==========================================
  Files          71       71              
  Lines        2509     2509              
==========================================
- Hits         2250     2246       -4     
- Misses        259      263       +4     
Impacted Files Coverage Δ
busy_beaver/app.py 86.15% <50.00%> (+0.21%) ⬆️
...beaver/apps/github_integration/summary/workflow.py 95.45% <95.45%> (-1.10%) ⬇️
busy_beaver/common/wrappers/github.py 97.24% <98.27%> (+1.83%) ⬆️
...y_beaver/apps/github_integration/summary/blocks.py 100.00% <100.00%> (ø)
..._beaver/apps/github_integration/summary/summary.py 95.65% <100.00%> (-4.35%) ⬇️
busy_beaver/clients.py 100.00% <100.00%> (ø)
busy_beaver/common/wrappers/__init__.py 100.00% <100.00%> (ø)
busy_beaver/toolbox/__init__.py 100.00% <100.00%> (ø)
busy_beaver/toolbox/helpers.py 93.75% <100.00%> (+1.44%) ⬆️
busy_beaver/common/wrappers/requests_client.py 88.23% <0.00%> (-8.83%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d2c06d...8a9c026. Read the comment docs.

@alysivji alysivji merged commit 5e3543f into busy-beaver-dev:master Aug 28, 2021
@alysivji alysivji deleted the 352/async-github-calls branch August 28, 2021 20:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants