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

GITC-478: Caching github user object. #9804

Merged
merged 3 commits into from
Dec 8, 2021

Conversation

nutrina
Copy link
Contributor

@nutrina nutrina commented Dec 2, 2021

Have created model to store the serialized github entities. Have also reworked code, mainly in the git/utils.py file to make use of this cache.

Description

This fixes the caching and conditional requests for the user object from Github API.
For now this only handles the user obejct requests, but this fix can be extended for repo and issue objects as well.

Refers/Fixes

GITC-478
This should fix the high amount of rate limit errors in sentry.

Testing

This would normally be triggered by going to the profile or dashboard pages for a user.

logger = logging.getLogger(__name__)


class GitCache(SuperModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

@nutrina can you add tests for this model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ksolo Yes, I am on it

@nutrina nutrina force-pushed the GITC-478-github-rate-limit branch from 91e9485 to aa5305e Compare December 6, 2021 10:53
@nutrina
Copy link
Contributor Author

nutrina commented Dec 6, 2021

@ksolo Have added test cases

@nutrina nutrina force-pushed the GITC-478-github-rate-limit branch from aa5305e to fea7217 Compare December 6, 2021 10:57
@nutrina nutrina requested a review from ksolo December 6, 2021 10:58
@nutrina nutrina force-pushed the GITC-478-github-rate-limit branch from fea7217 to 836170a Compare December 6, 2021 17:24
@nutrina nutrina changed the base branch from master to stable December 6, 2021 17:25
Have created model to store the serialized github entities. Have also reworked code, mainly in the `git/utils.py` file to make use of this cache.
@nutrina nutrina force-pushed the GITC-478-github-rate-limit branch from 836170a to ba6a0c3 Compare December 6, 2021 17:29
@nutrina
Copy link
Contributor Author

nutrina commented Dec 6, 2021

@thelostone-mc I have rebased this to stable

@thelostone-mc thelostone-mc changed the base branch from stable to master December 8, 2021 08:56
@thelostone-mc thelostone-mc merged commit 10fa4fc into master Dec 8, 2021
nutrina added a commit that referenced this pull request Dec 10, 2021
* GITC-478: Caching github user object.

Have created model to store the serialized github entities. Have also reworked code, mainly in the `git/utils.py` file to make use of this cache.

* GITC-478: remove logs for sensitive data

* GITC-478: Adding tests
Copy link

@alicii93 alicii93 left a comment

Choose a reason for hiding this comment

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

10x09D1564FB8344A4d0F74975bCed78eB7c7912617

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.

4 participants