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

Refactor the GitHub team cache #73

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Nov 22, 2023

What does this PR do?

  • Tiny refactor to extract some logic only related to the cache to its own class to avoid having it in the github client itself
  • Add more test to the cache itself and update the existing tests accordingly

Additional notes

alopezz
alopezz previously approved these changes Nov 27, 2023
@@ -98,3 +98,12 @@ def cache_candidate_data(self, commit_hash: str, candidate_data: dict):
(directory / candidate_data['id']).touch()
else:
(directory / 'no_pr.json').write_text(json.dumps(candidate_data, cls=SetEncoder))

def get_team_members(self, team: str) -> set[str] | None:
if (members_file := self.get_team_members_file(team)).is_file():
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be much clearer without inlining the assignment with :=, as it makes it a bit too dense.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right!

@FlorentClarret FlorentClarret merged commit 2413e49 into master Nov 27, 2023
18 checks passed
@FlorentClarret FlorentClarret deleted the florentclarret/github/refacto_cache branch November 27, 2023 09:49
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.

2 participants