-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MAINT]: Is Octokit.GraphQL affected by the Int32 overflow issue? #311
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
I noticed a similar type in the model:
AFAICT it's treated as a string and never parsed to an int.
|
I see - @jeffhandley is referring to this property which I agree looks suspicious: octokit.graphql.net/Octokit.GraphQL/Model/Issue.cs Lines 97 to 100 in e6b1e02
|
That does look suspicious! I've attempted to create a reproductive case here but I'm unfamiliar with this package and receiving ambiguous errors so I'm hoping someone can double-check my work. My request: using Octokit.GraphQL;
using Octokit.GraphQL.Model;
using static Octokit.GraphQL.Variable;
var token = System.Environment.GetEnvironmentVariable("GITHUB_TOKEN");
var productInformation = new ProductHeaderValue("int_overflow_bug_repro", "v0.0.1");
var connection = new Connection(productInformation, token);
var owner = "octokit";
var name = "octokit.graphql.net";
var query = new Query()
.Repository(owner: owner, name: name)
.Issues(first: 100, states: new[] { IssueState.Open })
.AllPages()
.Select(issue => new
{
issue.Number,
issue.Title,
issue.Body,
issue.State,
issue.CreatedAt,
issue.DatabaseId
});
var result = await connection.Run(query); Error:
If I remove the
which doesn't make any sense to me, so I'm thoroughly confused. Hopefully somebody can help me fine-tune this repro case so we can be sure we need to make a change here! |
I was able to confirm that this repros with GraphQL. Reducing my sample and will share shortly. Here's the callstack that throws:
|
Here's my repro - not exactly minimal but it might help you fix the problem with yours. https://gist.github.com/ericstj/b3ff24b68f389c68acbc68299a76c800 I think the result of |
Here's a minimal repro: using Octokit.GraphQL;
using Octokit.GraphQL.Model;
var token = System.Environment.GetEnvironmentVariable("GITHUB_TOKEN");
var productInformation = new ProductHeaderValue("int_overflow_bug_repro", "v0.0.1");
var connection = new Connection(productInformation, token);
var owner = "octokit";
var name = "octokit.graphql.net";
var query = new Query()
.Repository(owner: owner, name: name)
.Issues(states: new[] { IssueState.Open })
.AllPages()
.Select(issue => new
{
Id = issue.DatabaseId
});
var result = await connection.Run(query);
Console.WriteLine(result.Count()); This fails with
Though this one seems less severe due to the way that graphQL executes this query. It will only bind members that are part of the select expression, so if I remove the reference to |
Thank you for the help reproducing this! I've created #312 and tested that it fixes the issue. |
I've ended up tying myself in knots on this a little bit. First, manually changing the data type of the model causes request deserialization to succeed, though this isn't a permanent solution since those models are generated off of the spec given by https://api.github.com/graphql and periodically regenerated. Next, I attempted to alter parsing of the spec to account for Finally, I've landed on the approach of running a post-processing step for each .cs file that contains a |
Hi @kfcampbell - thanks for getting that fix in asap! Do you have a timeline for releasing a hotfix? This is currently blocking our release pipeline which is becoming urgent. Thanks! |
Describe the need
octokit/octokit.net#2889 is being tracked as needing an urgent hot-fix as the ecosystem of applications using Octokit have all stopped working due to an Int32 overflow.
Does Octokit.GraphQL need an urgent hot-fix to make a compensating change too?
SDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: