Skip to content

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

@Apolloluy

Description

@Apolloluy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions