镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(github): optimize notification enrichment requests - #3583

Merged
setchy merged 1 commit into
mainfrom
fix/optimize-github-enrichment-requests
Nov 1, 2026
Merged

setchy merged 1 commit into
mainfrom
fix/optimize-github-enrichment-requests

Conversation

@setchy

@setchy setchy commented Nov 1, 2026

Copy link
Copy Markdown
Member

Problem

The merged enrichment batch was reduced to 25 after GitHub started rejecting 100-notification batches with Resource limits for this query exceeded. That avoids the failure but quadruples enrichment requests per polling interval. The query had grown with recent metric fields such as reviews, review threads, issue fields, linked issues, and CI checks.

Change

  • Restore 100-notification merged batches, with automatic 100 -> 50 -> 25 split-and-retry only on GitHub's resource-limit error. Other errors keep the existing handling.
  • Bound the expensive connections:
    • labels: 25, plus totalCount
    • issue field values: 25
    • review threads: 25
    • reviews: 25
    • linked issues: 10
    • discussion comments/replies: 5/5
  • The labels pill now reports the true total label count from totalCount while rendering the fetched tokens.
  • No REST polling, conditional-cache, persisted-cache, or incremental since changes.

Trade-offs

  • Review and review-thread metrics reflect the latest first 25 entries for very large PRs.
  • Labels and issue fields beyond 25 are not rendered; the label total count remains accurate.
  • Linked issues beyond 10 and older discussion activity are not fetched.

Testing

  • pnpm test — 209 files, 2056 tests passed
  • pnpm check — formatting, lint, and types pass
  • openspec validate optimize-github-enrichment-requests --store gitify-specs --strict — valid

OpenSpec change: optimize-github-enrichment-requests

Restore the 100-notification merged enrichment batch and split it in half on GitHub resource-limit errors, down to batches of 25 before falling back to per-notification enrichment.

Bound expensive enrichment connections to keep the larger batch within GitHub's resource budget: labels 25 with totalCount, issue fields 25, review threads 25, reviews 25, linked issues 10, and discussion comments/replies 5/5.

Carry the true label count through the subject so the labels pill reports the total while rendering the fetched tokens. Update tests and GraphQL codegen for the new bounds.
@setchy
setchy requested a review from afonsojramos as a code owner November 1, 2026 14:30
@github-actions github-actions Bot added bug Something isn't working forge:github GitHub Cloud, GitHub Enterprise labels Nov 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

@setchy
setchy merged commit db4e3a2 into main Nov 1, 2026
19 checks passed
@setchy
setchy deleted the fix/optimize-github-enrichment-requests branch November 1, 2026 15:40
@github-actions github-actions Bot added this to the Release 8.0.0 milestone Nov 1, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in Gitify v8.0.0! 🎉

Downloads for macOS, Windows, and Linux are available on the release page.

Thanks for helping make Gitify better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working forge:github GitHub Cloud, GitHub Enterprise

Development

Successfully merging this pull request may close these issues.

1 participant