Skip to content

feat(issue-fields): expose fullDatabaseId (BigInt) in list_issue_fields#2526

Open
iulia-b wants to merge 1 commit into
github:mainfrom
iulia-b:iunia/fix-issue-fields-db-id
Open

feat(issue-fields): expose fullDatabaseId (BigInt) in list_issue_fields#2526
iulia-b wants to merge 1 commit into
github:mainfrom
iulia-b:iunia/fix-issue-fields-db-id

Conversation

@iulia-b
Copy link
Copy Markdown
Contributor

@iulia-b iulia-b commented May 22, 2026

Summary

  • Add DatabaseID (int64) to IssueField struct, populated from fullDatabaseId BigInt scalar on all 4 concrete GQL union types
  • Repeat fullDatabaseId per union fragment (shurcooL/githubv4 cannot use interface-level fragments at union top-level)
  • Add parseFullDatabaseID helper to parse BigInt string to int64
  • Update tests to assert DatabaseID is populated from fullDatabaseId

Why

Fixes #

We are using this tool in two places:

  1. Set issue fields granular tool, which is using the GraphQL endpoint to update issue fields
  2. Issues write, which is using the REST endpoint to update issue fields on an issue
    Because of this, we need to have both node ID and database ID exposed in this tool so both other tools can use it.

What changed

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

- Add DatabaseID (int64) to IssueField struct, populated from fullDatabaseId
  BigInt scalar (returned as string) on all 4 concrete GQL union types
- Repeat fullDatabaseId per union fragment (shurcooL/githubv4 cannot use
  interface-level fragments at union top-level)
- Add parseFullDatabaseID helper to parse BigInt string to int64
- Update tests to assert DatabaseID is populated from fullDatabaseId
@iulia-b iulia-b self-assigned this May 22, 2026
@iulia-b iulia-b marked this pull request as ready for review May 26, 2026 11:09
@iulia-b iulia-b requested a review from a team as a code owner May 26, 2026 11:09
Copilot AI review requested due to automatic review settings May 26, 2026 11:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Exposes a numeric database identifier for issue fields returned by list_issue_fields, derived from the GraphQL fullDatabaseId (BigInt) scalar, and updates unit tests to validate the new field.

Changes:

  • Added DatabaseID to IssueField and populated it from fullDatabaseId across all union member fragments.
  • Introduced parseFullDatabaseID helper to parse the BigInt string into int64.
  • Updated Test_ListIssueFields fixtures and assertions to validate DatabaseID.
Show a summary per file
File Description
pkg/github/issue_fields.go Adds DatabaseID to the public output struct, fetches fullDatabaseId in GraphQL fragments, and parses it into int64.
pkg/github/issue_fields_test.go Extends mocked GraphQL responses and assertions to ensure DatabaseID is populated correctly.

Copilot's findings

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

// IssueField represents a repository issue field definition.
type IssueField struct {
ID string `json:"id"`
DatabaseID int64 `json:"database_id,omitempty"`
Comment on lines +253 to +264
// parseFullDatabaseID converts a BigInt scalar string (e.g. "12345") to int64.
// Returns 0 if the string is empty or cannot be parsed.
func parseFullDatabaseID(s string) int64 {
if s == "" {
return 0
}
n, err := strconv.ParseInt(s, 10, 64)
if err != nil {
return 0
}
return n
}
Comment on lines +253 to +260
// parseFullDatabaseID converts a BigInt scalar string (e.g. "12345") to int64.
// Returns 0 if the string is empty or cannot be parsed.
func parseFullDatabaseID(s string) int64 {
if s == "" {
return 0
}
n, err := strconv.ParseInt(s, 10, 64)
if err != nil {
@iulia-b iulia-b marked this pull request as draft May 26, 2026 11:12
@iulia-b iulia-b marked this pull request as ready for review May 26, 2026 13:10
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.

4 participants