Repository navigation
fix(issues): treat missing fullDatabaseId on IssueField types as unsupported GHES schema - #3907
Open
tang-ontheway wants to merge 1 commit into
Open
tang-ontheway wants to merge 1 commit into
tang-ontheway wants to merge 1 commit into
Conversation
…pported GHES schema
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the GHES compatibility change intended to preserve REST results when optional GraphQL enrichment is unsupported.
No open issues 🎉
What changed in this PR
Fixes #3899 by allowing search_issues to return REST results when GHES lacks fullDatabaseId on issue field types, rather than failing during optional GraphQL enrichment.
Changes:
- Recognizes missing
fullDatabaseIdschema errors across the four supported issue field types. - Adds regression cases for single- and double-quoted errors, including a request using a fields filter.
| File | Description |
|---|---|
pkg/github/issues.go |
Extends unsupported-schema detection to missing fullDatabaseId fields. |
pkg/github/issues_test.go |
Tests graceful fallback for GHES schema errors on date and text field types. |
Review effort: Balanced (adaptive)
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 #3899
Root Cause
On GitHub Enterprise Server 3.21, the GraphQL issue field types (
IssueFieldDate,IssueFieldNumber,IssueFieldSingleSelect,IssueFieldText) exist in the schema, sosearch_issues's optionalfetchIssueFieldValuesByNodeIDenrichment fails with:Field 'fullDatabaseId' doesn't exist on type 'IssueFieldDate'isUnsupportedIssueFieldValuesSchemaErrorinpkg/github/issues.goonly recognized missing-field errors forissueFieldValuesonIssueand unknown-type / invalid-fragment errors onIssueField*types, so this schema mismatch was treated as a fatal error instead of degrading gracefully to the REST search results.Changes
isUnsupportedIssueFieldValuesSchemaErrorinpkg/github/issues.goto also recognize missingfullDatabaseIdfield errors (doesn't exist on type,does not exist on type,cannot query field,is not defined on type) onIssueFieldDate,IssueFieldNumber,IssueFieldSingleSelect, andIssueFieldText.pkg/github/issues_test.go(Test_SearchIssues_FieldValuesEnrichment) covering single-quoted and double-quoted missingfullDatabaseIderrors onIssueFieldDateandIssueFieldText.Verification
go test ./pkg/github -run Test_SearchIssues -v: all subtests passed (0.415s).