chore(release): v0.6.0 - #88
Merged
Merged
Conversation
#86) ## What Lands the structural fix for #83: one batched **GraphQL** query per account replaces the per-PR REST hydration N+1. Each poll hydrated every distinct open PR with up to 3 REST calls (`GET pulls/{n}` + `commits/{sha}/check-runs` + `pulls/{n}/reviews`) plus a per-repo permission fetch — on a large inbox (measured ~193 req for one cold refresh of a 76-PR inbox) this could exhaust the core 5000-req/hr limit. A new `pullRequestBatch` on the `GitHubAPI` protocol fetches detail + reviews + check-runs **+ the viewer's repo merge signals** for all PRs in one query. ## Design principle: transport swap, not a logic rewrite The GraphQL client maps the response back onto the existing decoded value types (`PullRequestDetail` / `PullRequestReview` / `CheckRun` / `RepoMergeInfo`), so the store's unchanged `deriveGate` / `ciRollup` / `checkRowModel` derivation consumes a batched result identically. Everything downstream (gates, CI banners, hydration marks, notifications) is untouched. ## Fallback (GHE + robustness) - **On by default**; any GraphQL failure (a GHE server missing `mergeStateStatus`, a transport error) auto-falls-back to the per-PR REST path **per account**. - Per-node nulls (a repo/PR the viewer can't resolve) degrade to a REST retry for that one PR. - The REST path (incl. `hydrateRepoPermissions` and the `updated_at` short-circuit) is retained verbatim as the fallback. ## Files - `GitHubGraphQLQuery.swift` *(new)* — aliased batch query builder + internal chunking (25 PRs/query). - `GraphQLPRMapping.swift` *(new)* — response decode + mapping (incl. legacy `StatusContext` → `CheckRun`, `mergeStateStatus` → `mergeable_state`, `viewerPermission` → `canMerge`). - `AppConfig.graphQLURL(forAPI:)` — public + GHE endpoint derivation. - `AppStoreHydration.swift` — GraphQL fast path in the drain with REST fallback; folds each bundle's repo merge info into `repoMergeInfo` so a later gate-only refresh after approve still finds it. - `AppStore.useGraphQLBatch` flag (default true; tests flip it to exercise the REST short-circuit). ## Tests - `GraphQLPRMappingTests` — decode/map a canned response: bundle fields, `mergeStateStatus` mapping table, CheckRun + StatusContext → rollup, per-node null tolerance, top-level `errors` → throw, query builder + chunking + slug split. - `AppConfigWebHostTests` — GraphQL endpoint (public + GHE + port + fallback). - `AppStoreTests` — batch path hydrates via one round-trip (no per-PR REST), and `batchError` → REST fallback still hydrates. - Existing REST short-circuit tests pinned to `useGraphQLBatch = false`. - Full suite: **280 tests, 0 failures**; `just check` clean. Closes #83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotion PR for v0.6.0.
Merging this releases it: release.yml tags
v0.6.0, builds + signs + notarizes the DMG, uploads it to the GitHub release, updates the Homebrew cask, and syncsstageback frommain.