Skip to content
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

[BUG]: Int32 overflow for Github object ids #2893

Open
1 task done
Apolloluy opened this issue Mar 5, 2024 · 4 comments
Open
1 task done

[BUG]: Int32 overflow for Github object ids #2893

Apolloluy opened this issue Mar 5, 2024 · 4 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@Apolloluy
Copy link

Apolloluy commented Mar 5, 2024

What happened?

Running

var envs = await github.Repository.Environment.GetAll(owner, "API_CICD");

Returns
image

System.OverflowException: 'Value was either too large or too small for an Int32.'
When attempting to parse the Github.id field in the response.

Versions

Octokit.nupkg 10.0.0 (.net)
image

Relevant log output

System.OverflowException
  HResult=0x80131516
  Message=Value was either too large or too small for an Int32.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Convert.ThrowInt32OverflowException()

Value = 2398648970
{
			"id": 2398648970,
			"node_id": "EN_kwDOJhYfOc6O-HqK",
			"name": "test",
			"url": "https://api.github.com/repos/ContextureHIE/API_CICD/environments/test",
			"html_url": "https://github.com/ContextureHIE/API_CICD/deployments/activity_log?environments_filter=test",
			"created_at": "2024-03-01T22:23:36Z",
			"updated_at": "2024-03-01T22:23:36Z",
			"can_admins_bypass": true,
			"protection_rules": [
				{
					"id": 16441898,
					"node_id": "GA_kwDOJhYfOc4A-uIq",
					"type": "required_reviewers",
					"prevent_self_review": false,
					"reviewers": [
						{
							"type": "User",
							"reviewer": {
								"login": "Apolloluy",
								"id": 44653204,
								"node_id": "MDQ6VXNlcjQ0NjUzMjA0",
								"avatar_url": "https://avatars.githubusercontent.com/u/44653204?v=4",
								"gravatar_id": "",
								"url": "https://api.github.com/users/Apolloluy",
								"html_url": "https://github.com/Apolloluy",
								"followers_url": "https://api.github.com/users/Apolloluy/followers",
								"following_url": "https://api.github.com/users/Apolloluy/following{/other_user}",
								"gists_url": "https://api.github.com/users/Apolloluy/gists{/gist_id}",
								"starred_url": "https://api.github.com/users/Apolloluy/starred{/owner}{/repo}",
								"subscriptions_url": "https://api.github.com/users/Apolloluy/subscriptions",
								"organizations_url": "https://api.github.com/users/Apolloluy/orgs",
								"repos_url": "https://api.github.com/users/Apolloluy/repos",
								"events_url": "https://api.github.com/users/Apolloluy/events{/privacy}",
								"received_events_url": "https://api.github.com/users/Apolloluy/received_events",
								"type": "User",
								"site_admin": false
							}
						}
					]
				}
			],
			"deployment_branch_policy": null
		}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Apolloluy Apolloluy added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Mar 5, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Mar 5, 2024
@jeffhandley
Copy link

Since this seems to repro using 10.0.0, it must be separate from #2889, which was fixed with #2890.

@kartheekp-ms
Copy link

kartheekp-ms commented May 13, 2024

Upgrading the octokit package version to 11.0.1 fixed the issue for me. https://www.nuget.org/packages/Octokit/11.0.1

kartheekp-ms referenced this issue in NuGet/Entropy May 15, 2024
@martincostello
Copy link
Contributor

I can still repro this with 11.0.1 for deployment environments. I have one with an ID of 2296494046 which overflows the Id property as it's still an int:

/// <summary>
/// Id of this deployment environment
/// </summary>
public int Id { get; private set; }

@martincostello
Copy link
Contributor

I would do a PR to fix it, but fixing it properly is a lottttttttt of breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

Successfully merging a pull request may close this issue.

5 participants