Skip to content

Batch GitHub team GraphQL reads - #301

Open
hosom wants to merge 1 commit into
mainfrom
batch-github-team-graphql
Open

Batch GitHub team GraphQL reads#301
hosom wants to merge 1 commit into
mainfrom
batch-github-team-graphql

Conversation

@hosom

@hosom hosom commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prefetch GitHub teams with bounded GraphQL alias batches
  • preserve predictive and authoritative cache semantics
  • paginate each team independently and cache missing teams
  • safely escape GraphQL string values and log rate-limit metadata

Validation

  • bundle exec rspec spec/unit --format progress (205 examples, 0 failures, 100% coverage)
  • bundle exec rubocop -c .rubocop.yml lib/ spec/ (31 files, no offenses)
  • git diff --check

Dependency

This is stacked on #300 so the batching diff can be reviewed separately from GraphQL connection reuse and organization-membership cache optimizations.

Copilot AI balanced review requested due to automatic review settings September 8, 2026 20:29
@hosom
hosom force-pushed the reuse-graphql-http branch from 7cd282e to 1b8bd1c Compare September 8, 2026 20:29
@hosom
hosom force-pushed the batch-github-team-graphql branch from 95c2ebb to 1045758 Compare September 8, 2026 20:29

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

🟡 Changes recommended

Cached missing-team results prevent newly created teams from being re-read before synchronization.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity

New issues introduced by this change (1)
Severity Finding
High severity lib/​entitlements/​backend/​github_team/​service.rb — Caching an authoritative nil here breaks creation in Provider#commit: after create_team,…
What changed in this PR

Adds bounded GraphQL batching for GitHub team reads while preserving cache behavior and independent pagination.

Changes:

  • Batches authoritative team queries with aliases, escaping, pagination limits, and rate-limit logging.
  • Adds provider/controller prefetch support and caches missing teams.
  • Expands tests for batching, pagination, caching, and failures.
File Description
lib/​entitlements/​backend/​github_team/​service.rb Implements batched team reads and caching.
lib/​entitlements/​backend/​github_team/​provider.rb Adds provider-level prefetching.
lib/​entitlements/​backend/​github_team/​controller.rb Prefetches all calculated teams together.
spec/​unit/​spec_helper.rb Updates GraphQL response fixtures.
spec/​unit/​entitlements/​backend/​github_team/​service_spec.rb Tests batching and pagination.
spec/​unit/​entitlements/​backend/​github_team/​provider_spec.rb Tests provider prefetch caching.
spec/​unit/​entitlements/​backend/​github_team/​controller_spec.rb Updates controller expectations.

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

end

{ cache: false, value: team }
@team_cache[team_identifier] = { cache: false, value: team }
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bff1e95b-3949-4ae8-b3a5-737fd278a977
@hosom
hosom force-pushed the reuse-graphql-http branch from 1b8bd1c to 3298437 Compare September 9, 2026 20:33
@hosom
hosom force-pushed the batch-github-team-graphql branch from 1045758 to 2df575e Compare September 9, 2026 20:33
Base automatically changed from reuse-graphql-http to main September 9, 2026 20:38
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