-
Notifications
You must be signed in to change notification settings - Fork 7
GitHub Service Improvements #143
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
Conversation
…erformance bump for large orgs)
…r unhandled exception classes
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.
Pull Request Overview
This PR improves the GitHub service integration by refactoring organization member retrieval for clarity and performance, adding retry logic to network calls, and enhancing test coverage.
- Refactors organization member fetching to use retryable wrappers
- Increases Octokit per_page setting for better performance on large orgs
- Adds additional unit tests for various edge cases
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
spec/unit/spec_helper.rb | Adds stubs for sleep to bypass delays in tests |
spec/unit/entitlements/service/github_spec.rb | Adds new contexts for admin/member edge cases |
spec/unit/entitlements/backend/github_team/service_spec.rb | Adjusts test expectations for retry behavior |
lib/entitlements/service/github.rb | Refactors methods to use Retryable, increases per_page |
lib/entitlements/config/retry.rb | Adds custom Retryable configuration |
lib/entitlements/backend/github_team/service.rb | Wraps GitHub team API calls in retryable blocks |
lib/entitlements/backend/github_team.rb | Adds Retry setup call |
lib/entitlements/backend/github_org/service.rb | Wraps organization membership updates in retryable |
lib/entitlements/backend/github_org.rb | Adds Retry setup call |
entitlements-github-plugin.gemspec | Adds dependency on retryable gem |
Comments suppressed due to low confidence (1)
spec/unit/entitlements/backend/github_team/service_spec.rb:848
- [nitpick] Hardcoding the retry count as exactly 3 times may lead to brittle tests if the retry configuration is updated in the future. Consider using the configured retry value or a more flexible expectation to ensure the test remains robust.
expect(octokit).to receive(:team).with(1234).and_raise(exc).exactly(3).times
GitHub Service Improvements
This pull request does the following:
organization_members()
to make it bit easier to read.retryable
gem to the project as a runtime dep and assigns it a standard configuration.octokit
with a retryable block for unhandled exception classes.per_page
setting of Octokit from 30 -> 100. This changes it from the default to the max.A pretty significant bonus of setting the
per_page
default from 30 -> 100 is an increase in performance for large organizations. Specifically orgs with a few thousand members (or more), will see a performance bump here.