fix(changelog): Add retry and robust error handling for GitHub GraphQL#701
Merged
fix(changelog): Add retry and robust error handling for GitHub GraphQL#701
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
…ation Fixes CRAFT-8 Remove redundant manual retry loop since @octokit/plugin-retry already handles 5xx retries automatically (up to 3 times with exponential backoff). The actual issue was missing response validation - GitHub GraphQL can return HTTP 200 with missing/null repository field, causing TypeError when accessing .repository properties. Changes: - Remove 37 lines of manual retry logic (duplicate of plugin behavior) - Keep essential response validation with ?.repository check - Maintain graceful error handling for all failure scenarios This fixes three scenarios: 1. HTTP 502 errors: Handled by @octokit/plugin-retry 2. HTTP 200 with errors array: Caught by try-catch 3. HTTP 200 with missing repository: Caught by validation check
Capture GraphQL changelog failures to Sentry with rich context for monitoring: - Tag 'error_type' for easy filtering (graphql_changelog_failure) - Tags for chunk_number and total_chunks for tracking failure patterns - Context with chunk details, commit count, HTTP status, and error name This enables: - Tracking frequency of GraphQL failures in production - Identifying patterns (e.g., specific chunks that fail consistently) - Monitoring the effectiveness of the retry plugin - Better visibility into GitHub API reliability issues The error is still logged as a warning and handled gracefully (skipping the failed chunk and continuing with remaining commits).
Add the full GraphQL query and additional metrics to Sentry error context: - GraphQL query string (for reproducing issues) - Query length (to identify if query size correlates with failures) - Total hashes being processed (context for chunk failures) This enables debugging questions like: - Do larger queries fail more often? - Are specific query patterns causing issues? - Can we reproduce failures with the exact query?
Move GraphQL query into the main graphql_chunk context and remove the redundant queryLength metric. The query string itself is more useful for debugging, and totalHashes already provides the scale information needed.
BYK
approved these changes
Jan 9, 2026
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.
Fixes CRAFT-8. The issue was that: GraphQL response lacks 'repository' due to 502, causing TypeError when accessed without validation.
This fix was generated by Seer in Sentry, triggered by Burak Yigit Kaya. 👁️ Run ID: 8414569
Not quite right? Click here to continue debugging with Seer.