mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 10:25:36 +00:00
[Breaking Change]: Fix DeploymentStatus IDs Overflowing (#2736)
This commit is contained in:
@@ -51,5 +51,57 @@ namespace Octokit.Tests.Models
|
||||
Assert.Equal(DateTimeOffset.Parse("2012-07-20T01:19:13Z"), actual.UpdatedAt);
|
||||
Assert.Equal("Deploy request from hubot", actual.Description);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanDeserialize64BitId()
|
||||
{
|
||||
const string json = @"{
|
||||
""url"": ""https://api.github.com/repos/tgstation/TerraGov-Marine-Corps/deployments/965900823/statuses/2151661540"",
|
||||
""id"": 2151661540,
|
||||
""node_id"": ""DES_kwDOCXi6sc6AP7_k"",
|
||||
""state"": ""in_progress"",
|
||||
""creator"": {
|
||||
""login"": ""comfyorange"",
|
||||
""id"": 61334995,
|
||||
""node_id"": ""MDQ6VXNlcjYxMzM0OTk1"",
|
||||
""avatar_url"": ""https://avatars.githubusercontent.com/u/61334995?v=4"",
|
||||
""gravatar_id"": """",
|
||||
""url"": ""https://api.github.com/users/comfyorange"",
|
||||
""html_url"": ""https://github.com/comfyorange"",
|
||||
""followers_url"": ""https://api.github.com/users/comfyorange/followers"",
|
||||
""following_url"": ""https://api.github.com/users/comfyorange/following{/other_user}"",
|
||||
""gists_url"": ""https://api.github.com/users/comfyorange/gists{/gist_id}"",
|
||||
""starred_url"": ""https://api.github.com/users/comfyorange/starred{/owner}{/repo}"",
|
||||
""subscriptions_url"": ""https://api.github.com/users/comfyorange/subscriptions"",
|
||||
""organizations_url"": ""https://api.github.com/users/comfyorange/orgs"",
|
||||
""repos_url"": ""https://api.github.com/users/comfyorange/repos"",
|
||||
""events_url"": ""https://api.github.com/users/comfyorange/events{/privacy}"",
|
||||
""received_events_url"": ""https://api.github.com/users/comfyorange/received_events"",
|
||||
""type"": ""User"",
|
||||
""site_admin"": false
|
||||
},
|
||||
""description"": ""The project is being deployed"",
|
||||
""environment"": ""TGS: TGMC"",
|
||||
""target_url"": """",
|
||||
""created_at"": ""2023-06-29T19:10:55Z"",
|
||||
""updated_at"": ""2023-06-29T19:10:55Z"",
|
||||
""deployment_url"": ""https://api.github.com/repos/tgstation/TerraGov-Marine-Corps/deployments/965900823"",
|
||||
""repository_url"": ""https://api.github.com/repos/tgstation/TerraGov-Marine-Corps"",
|
||||
""environment_url"": """",
|
||||
""log_url"": """",
|
||||
""performed_via_github_app"": null
|
||||
}";
|
||||
|
||||
var actual = new SimpleJsonSerializer().Deserialize<DeploymentStatus>(json);
|
||||
|
||||
Assert.Equal(2151661540, actual.Id);
|
||||
Assert.Equal("https://api.github.com/repos/tgstation/TerraGov-Marine-Corps/deployments/965900823/statuses/2151661540", actual.Url);
|
||||
Assert.Equal(DeploymentState.InProgress, actual.State);
|
||||
Assert.Null(actual.Payload);
|
||||
Assert.Equal(String.Empty, actual.TargetUrl);
|
||||
Assert.Equal(DateTimeOffset.Parse("2023-06-29T19:10:55Z"), actual.CreatedAt);
|
||||
Assert.Equal(DateTimeOffset.Parse("2023-06-29T19:10:55Z"), actual.UpdatedAt);
|
||||
Assert.Equal("The project is being deployed", actual.Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Octokit
|
||||
{
|
||||
public DeploymentStatus() { }
|
||||
|
||||
public DeploymentStatus(int id, string nodeId, string url, DeploymentState state, User creator, IReadOnlyDictionary<string, string> payload, string targetUrl, string logUrl, string environmentUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description)
|
||||
public DeploymentStatus(long id, string nodeId, string url, DeploymentState state, User creator, IReadOnlyDictionary<string, string> payload, string targetUrl, string logUrl, string environmentUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description)
|
||||
{
|
||||
Id = id;
|
||||
NodeId = nodeId;
|
||||
@@ -30,7 +30,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// Id of this deployment status.
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
public long Id { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// GraphQL Node Id
|
||||
|
||||
Reference in New Issue
Block a user