Skip to content

Remove invalid IssueField fragment from set_issue_field discovery query#39586

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-api-query-issue-38797
Jun 16, 2026
Merged

Remove invalid IssueField fragment from set_issue_field discovery query#39586
pelikhan merged 6 commits into
mainfrom
copilot/fix-api-query-issue-38797

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

set_issue_field field discovery was failing at GraphQL validation because the query referenced ... on IssueField, a type that is not present in the current GitHub schema. This prevented field resolution from completing before mutation execution.

  • Query compatibility fix

    • Removed ... on IssueField { id name } from repository-level and organization-level issueFields selections in actions/setup/js/set_issue_field.cjs.
    • Kept only concrete field fragments (IssueFieldText, IssueFieldNumber, IssueFieldDate, IssueFieldSingleSelect, IssueFieldMultiSelect) so discovery remains schema-valid.
  • Regression coverage

    • Updated set_issue_field.test.cjs assertions to ensure the query does not include the invalid IssueField fragment condition.
    • Added set_issue_field_api_query.integration.test.cjs to validate query execution against the live GraphQL schema. The test is wired into vitest.integration.config.mjs so it runs under the existing test:js-integration-live-api command and the js-integration-live-api CI job.
nodes {
  __typename
  ... on IssueFieldText { id name }
  ... on IssueFieldNumber { id name }
  ... on IssueFieldDate { id name }
  ... on IssueFieldSingleSelect { id name options { id name } }
  ... on IssueFieldMultiSelect { id name options { id name } }
}

Copilot AI and others added 2 commits June 16, 2026 15:49
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix set_issue_field IssueField fragment and add API query integration test Remove invalid IssueField fragment from set_issue_field discovery query Jun 16, 2026
Copilot AI requested a review from pelikhan June 16, 2026 15:58
@pelikhan pelikhan marked this pull request as ready for review June 16, 2026 16:02
Copilot AI review requested due to automatic review settings June 16, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Not ready to approve

The new live-API integration test is currently brittle/mis-scoped for CI execution, and an unrelated generated workflow lockfile change should be dropped unless intentional.

Pull request overview

Fixes set_issue_field GraphQL field-discovery by removing an invalid ... on IssueField fragment that fails schema validation, keeping discovery queries limited to concrete issue field types.

Changes:

  • Removed the invalid ... on IssueField { id name } fragment from repo/org issueFields discovery selections.
  • Updated the unit test to assert the query does not include the non-existent IssueField fragment.
  • Added a new integration test file intended to validate the discovery query against the live GitHub GraphQL API schema/query execution.
File summaries
File Description
actions/setup/js/set_issue_field.cjs Removes the invalid IssueField fragment from the discovery query.
actions/setup/js/set_issue_field.test.cjs Updates query-shape assertions to ensure the invalid fragment is absent.
actions/setup/js/set_issue_field_api_query.integration.test.cjs Adds a live-API integration test for query validity and fragment exclusion.
.github/workflows/objective-impact-report.lock.yml Updates generated workflow metadata hash (appears unrelated to this PR’s purpose).

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 3

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +61
const introspection = await octokit.graphql(
`query {
__type(name: "IssueField") {
name
}
}`
);

expect(introspection.__type).toBeNull();
expect(ISSUE_FIELDS_DISCOVERY_QUERY).not.toMatch(/\.\.\.\s+on\s+IssueField\s*\{/);

const result = await octokit.graphql(ISSUE_FIELDS_DISCOVERY_QUERY, { owner, repo });
expect(result?.repository).toBeDefined();
Comment on lines +34 to +40
describe("set_issue_field GraphQL discovery query integration", () => {
it("validates against live schema and excludes the removed IssueField fragment", async () => {
const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
if (!token) {
console.log("Skipping live GraphQL schema test - no GITHUB_TOKEN or GH_TOKEN available");
return;
}
Comment thread .github/workflows/objective-impact-report.lock.yml Outdated
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Copilot AI and others added 2 commits June 16, 2026 16:39
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Done in 4e8fbb7:

  • Dropped the unrelated lockfile change (objective-impact-report.lock.yml reverted)
  • Removed the brittle __type(name: "IssueField") == null introspection assertion — the integration test now simply executes the discovery query and asserts the response is defined, which is the schema-validity check that matters
  • Wired the integration test into vitest.integration.config.mjs so it runs under the existing test:js-integration-live-api command and the js-integration-live-api CI job

@pelikhan pelikhan merged commit 6f1c7c7 into main Jun 16, 2026
14 checks passed
@pelikhan pelikhan deleted the copilot/fix-api-query-issue-38797 branch June 16, 2026 17:00
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.

3 participants