Skip to content

Reuse GitHub organization data and REST connections - #305

Merged
hosom merged 3 commits into
mainfrom
hosom/reuse-github-rest-connections
Sep 14, 2026
Merged

hosom merged 3 commits into
mainfrom
hosom/reuse-github-rest-connections

Conversation

@hosom

@hosom hosom commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • read the cached organization membership hash once when constructing role groups, avoiding repeated deep contract validation from Reuse cached GitHub organization members when building role groups #304
  • configure Octokit with faraday-net_http_persistent so large paginated organization reads reuse TCP/TLS connections
  • release the combined changes as entitlements-github-plugin 1.2.5

Benchmark results

In github/entitlements#141320:

  • Proxima organization target: 64.79s -> 6.70s (89.7% faster)
  • main GitHub organization target: 23.65s -> 7.72s (67.4% faster)
  • GitHub teams: 41.16s -> 40.20s (unchanged as expected)

The organization-member reuse change previously improved an unprofiled live benchmark from 495.22s to 483.24s and removed the accidental O(n^2) contract-validation path.

Validation

  • 190 unit examples, 0 failures
  • 100% line coverage
  • RuboCop passes
  • gem builds successfully as 1.2.5

Supersedes #304.

Configure Octokit with Faraday persistent Net::HTTP adapter so paginated organization and team requests reuse connections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3f79283a-9bd3-46dd-8e33-676d145619c5
Copilot AI balanced review requested due to automatic review settings September 14, 2026 19:35
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3f79283a-9bd3-46dd-8e33-676d145619c5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review tier: Lite (auto)
Findings: None

Note

Copilot is running an experiment and ran this review at Lite.

What changed in this PR

This pull request enables persistent HTTP connection reuse for Octokit GitHub REST requests while preserving existing behavior.

Changes:

  • Adds the persistent Faraday adapter dependency.
  • Configures and memoizes the Octokit client.
  • Adds coverage for adapter selection and client reuse.
  • Updates the gemspec and lockfile.
File Summary
spec/​unit/​entitlements/​service/​github_spec.rb Verifies adapter configuration and client memoization.
lib/​entitlements/​service/​github.rb Configures persistent REST connections.
Gemfile.lock Locks the new dependency chain.
entitlements-github-plugin.gemspec Declares the runtime dependency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Read the organization membership hash once while constructing a role group. This avoids repeatedly executing the deep HashOf return contract for every username in the organization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5b8ed060-ed02-4402-b5e1-af407bcb2f61
@hosom hosom changed the title Reuse GitHub REST connections Reuse GitHub organization data and REST connections Sep 14, 2026
@hosom
hosom merged commit 41fcd88 into main Sep 14, 2026
14 checks passed
@hosom
hosom deleted the hosom/reuse-github-rest-connections branch September 14, 2026 21:57
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