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

#2927: comment id model update to long instead of int #2928

Merged
merged 8 commits into from
Jun 10, 2024
4 changes: 2 additions & 2 deletions Octokit/Clients/CommitCommentReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOp
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}")]
public Task Delete(string owner, string name, int commentId, int reactionId)
public Task Delete(string owner, string name, long commentId, long reactionId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Expand All @@ -140,7 +140,7 @@ public Task Delete(string owner, string name, int commentId, int reactionId)
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repositories/{id}/comments/{comment_id}/reactions/{reaction_id}")]
public Task Delete(long repositoryId, int commentId, int reactionId)
public Task Delete(long repositoryId, long commentId, long reactionId)
{
return ApiConnection.Delete(ApiUrls.CommitCommentReaction(repositoryId, commentId, reactionId));
}
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Clients/GistCommentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public GistCommentsClient(IApiConnection apiConnection) : base(apiConnection)
/// <param name="commentId">The id of the comment</param>
/// <returns>Task{GistComment}.</returns>
[ManualRoute("GET", "/gists/{gist_id}/comments/{comment_id}")]
public Task<GistComment> Get(string gistId, int commentId)
public Task<GistComment> Get(string gistId, long commentId)
{
return ApiConnection.Get<GistComment>(ApiUrls.GistComment(gistId, commentId));
}
Expand Down Expand Up @@ -86,7 +86,7 @@ public Task<GistComment> Create(string gistId, string comment)
/// <param name="comment">The updated body of the comment</param>
/// <returns>Task{GistComment}.</returns>
[ManualRoute("PATCH", "/gists/{gist_id}/comments/{comment_id}")]
public Task<GistComment> Update(string gistId, int commentId, string comment)
public Task<GistComment> Update(string gistId, long commentId, string comment)
{
Ensure.ArgumentNotNullOrEmptyString(comment, nameof(comment));

Expand All @@ -101,7 +101,7 @@ public Task<GistComment> Update(string gistId, int commentId, string comment)
/// <param name="commentId">The id of the comment</param>
/// <returns>Task.</returns>
[ManualRoute("DELETE", "/gists/{gist_id}/comments/{comment_id}")]
public Task Delete(string gistId, int commentId)
public Task Delete(string gistId, long commentId)
{
return ApiConnection.Delete(ApiUrls.GistComment(gistId, commentId));
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/ICommitCommentReactionsClient.cs
Copy link

Choose a reason for hiding this comment

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

Looks like a few comment id/number parameters were not updated to long in the other methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public interface ICommitCommentReactionsClient
/// <param name="commentId">The comment id</param>
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
Task Delete(string owner, string name, int commentId, int reactionId);
Task Delete(string owner, string name, long commentId, long reactionId);

/// <summary>
/// Deletes a reaction for a specified Commit Comment
Expand All @@ -91,6 +91,6 @@ public interface ICommitCommentReactionsClient
/// <param name="commentId">The comment id</param>
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
Task Delete(long repositoryId, int commentId, int reactionId);
Task Delete(long repositoryId, long commentId, long reactionId);
}
}
6 changes: 3 additions & 3 deletions Octokit/Clients/IGistCommentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IGistCommentsClient
/// <returns>Task{GistComment}.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<GistComment> Get(string gistId, int commentId);
Task<GistComment> Get(string gistId, long commentId);

/// <summary>
/// Gets all comments for the gist with the specified id.
Expand Down Expand Up @@ -57,7 +57,7 @@ public interface IGistCommentsClient
/// <param name="commentId">The id of the comment</param>
/// <param name="comment">The updated body of the comment</param>
/// <returns>Task{GistComment}.</returns>
Task<GistComment> Update(string gistId, int commentId, string comment);
Task<GistComment> Update(string gistId, long commentId, string comment);

/// <summary>
/// Deletes the comment with the specified gist- and comment id.
Expand All @@ -66,6 +66,6 @@ public interface IGistCommentsClient
/// <param name="gistId">The id of the gist</param>
/// <param name="commentId">The id of the comment</param>
/// <returns>Task.</returns>
Task Delete(string gistId, int commentId);
Task Delete(string gistId, long commentId);
}
}
4 changes: 2 additions & 2 deletions Octokit/Clients/IIssueCommentReactionsClient.cs
Copy link

Choose a reason for hiding this comment

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

Looks like a few comment id/number parameters were not updated to long in the other methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public interface IIssueCommentReactionsClient
/// <param name="commentId">The comment id</param>
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
Task Delete(string owner, string name, int commentId, int reactionId);
Task Delete(string owner, string name, long commentId, long reactionId);

/// <summary>
/// Deletes a reaction for a specified Commit Comment
Expand All @@ -85,6 +85,6 @@ public interface IIssueCommentReactionsClient
/// <param name="commentId">The comment id</param>
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
Task Delete(long repositoryId, int commentId, int reactionId);
Task Delete(long repositoryId, long commentId, long reactionId);
}
}
4 changes: 2 additions & 2 deletions Octokit/Clients/IPullRequestReviewCommentReactionsClient.cs
Copy link

Choose a reason for hiding this comment

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

Looks like a few comment id/number parameters were not updated to long in the other methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public interface IPullRequestReviewCommentReactionsClient
/// <param name="commentId">The issue id</param>
Copy link

Choose a reason for hiding this comment

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

Documentation is wrong here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
Task Delete(string owner, string name, int commentId, int reactionId);
Task Delete(string owner, string name, long commentId, long reactionId);

/// <summary>
/// Deletes a reaction for a specified Pull Request comment
Expand All @@ -85,6 +85,6 @@ public interface IPullRequestReviewCommentReactionsClient
/// <param name="commentId">The issue id</param>
Copy link

Choose a reason for hiding this comment

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

Documentation is wrong here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
Task Delete(long repositoryId, int commentId, int reactionId);
Task Delete(long repositoryId, long commentId, long reactionId);
}
}
4 changes: 2 additions & 2 deletions Octokit/Clients/IssueCommentReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOp
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}")]
public Task Delete(string owner, string name, int commentId, int reactionId)
public Task Delete(string owner, string name, long commentId, long reactionId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Expand All @@ -134,7 +134,7 @@ public Task Delete(string owner, string name, int commentId, int reactionId)
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repositories/{id}/issues/comments/{comment_id}/reactions/{reaction_id}")]
public Task Delete(long repositoryId, int commentId, int reactionId)
public Task Delete(long repositoryId, long commentId, long reactionId)
{
return ApiConnection.Delete(ApiUrls.IssueCommentReaction(repositoryId, commentId, reactionId));
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/PullRequestReviewCommentReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Task<Reaction> Create(long repositoryId, int number, NewReaction reaction
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}")]
public Task Delete(string owner, string name, int commentId, int reactionId)
public Task Delete(string owner, string name, long commentId, long reactionId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Expand All @@ -134,7 +134,7 @@ public Task Delete(string owner, string name, int commentId, int reactionId)
/// <param name="reactionId">The reaction id</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repositories/{id}/pulls/comments/{comment_id}/reactions/{reaction_id}")]
public Task Delete(long repositoryId, int commentId, int reactionId)
public Task Delete(long repositoryId, long commentId, long reactionId)
{
return ApiConnection.Delete(ApiUrls.PullRequestReviewCommentReaction(repositoryId, commentId, reactionId));
}
Expand Down
14 changes: 7 additions & 7 deletions Octokit/Helpers/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ public static Uri IssueCommentReactions(long repositoryId, int number)
/// <param name="number">The comment number</param>
/// <param name="reaction">The reactionid for the comment</param>
/// <returns></returns>
public static Uri IssueCommentReaction(string owner, string name, int number, int reaction)
public static Uri IssueCommentReaction(string owner, string name, long number, long reaction)
{
return "repos/{0}/{1}/issues/comments/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
}
Expand All @@ -683,7 +683,7 @@ public static Uri IssueCommentReaction(string owner, string name, int number, in
/// <param name="number">The comment number</param>
/// <param name="reaction">The reactionid for the comment</param>
/// <returns></returns>
public static Uri IssueCommentReaction(long repositoryId, int number, int reaction)
public static Uri IssueCommentReaction(long repositoryId, long number, long reaction)
{
return "repositories/{0}/issues/comments/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
}
Expand Down Expand Up @@ -754,7 +754,7 @@ public static Uri CommitCommentReactions(long repositoryId, int number)
/// <param name="number">The comment number</param>
/// <param name="reaction">The reaction number</param>
/// <returns></returns>
public static Uri CommitCommentReaction(string owner, string name, int number, int reaction)
public static Uri CommitCommentReaction(string owner, string name, long number, long reaction)
{
return "repos/{0}/{1}/comments/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
}
Expand All @@ -766,7 +766,7 @@ public static Uri CommitCommentReaction(string owner, string name, int number, i
/// <param name="number">The comment number</param>
/// <param name="reaction">The reaction number</param>
/// <returns></returns>
public static Uri CommitCommentReaction(long repositoryId, int number, int reaction)
public static Uri CommitCommentReaction(long repositoryId, long number, long reaction)
{
return "repositories/{0}/comments/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
}
Expand Down Expand Up @@ -1506,7 +1506,7 @@ public static Uri PullRequestFiles(string owner, string name, int number)
/// </summary>
/// <param name="gistId">The id of the gist</param>
/// <param name="commentId">The id of the comment</param>
public static Uri GistComment(string gistId, int commentId)
public static Uri GistComment(string gistId, long commentId)
{
return "gists/{0}/comments/{1}".FormatUri(gistId, commentId);
}
Expand Down Expand Up @@ -1820,7 +1820,7 @@ public static Uri PullRequestReviewCommentReactions(long repositoryId, int numbe
/// <param name="number">The comment number</param>
/// <param name="reaction">The reactionid for the comment</param>
/// <returns></returns>
public static Uri PullRequestReviewCommentReaction(string owner, string name, int number, int reaction)
public static Uri PullRequestReviewCommentReaction(string owner, string name, long number, long reaction)
{
return "repos/{0}/{1}/pulls/comments/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
}
Expand All @@ -1832,7 +1832,7 @@ public static Uri PullRequestReviewCommentReaction(string owner, string name, in
/// <param name="number">The comment number</param>
/// <param name="reaction">The reactionid for the comment</param>
/// <returns></returns>
public static Uri PullRequestReviewCommentReaction(long repositoryId, int number, int reaction)
public static Uri PullRequestReviewCommentReaction(long repositoryId, long number, long reaction)
{
return "repositories/{0}/pulls/comments/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Request/PullRequestReviewCommentReplyCreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class PullRequestReviewCommentReplyCreate : RequestParameters
/// </summary>
/// <param name="body">The text of the comment</param>
/// <param name="inReplyTo">The comment Id to reply to</param>
public PullRequestReviewCommentReplyCreate(string body, int inReplyTo)
public PullRequestReviewCommentReplyCreate(string body, long inReplyTo)
{
Ensure.ArgumentNotNullOrEmptyString(body, nameof(body));

Expand All @@ -30,7 +30,7 @@ public PullRequestReviewCommentReplyCreate(string body, int inReplyTo)
/// <summary>
/// The comment Id to reply to.
/// </summary>
public int InReplyTo { get; private set; }
public long InReplyTo { get; private set; }

internal string DebuggerDisplay
{
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Response/CommitComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class CommitComment
{
public CommitComment() { }

public CommitComment(int id, string nodeId, string url, string htmlUrl, string body, string path, int position, int? line, string commitId, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt, ReactionSummary reactions)
public CommitComment(long id, string nodeId, string url, string htmlUrl, string body, string path, int position, int? line, string commitId, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt, ReactionSummary reactions)
{
Id = id;
NodeId = nodeId;
Expand All @@ -29,7 +29,7 @@ public CommitComment(int id, string nodeId, string url, string htmlUrl, string b
/// <summary>
/// The issue comment Id.
/// </summary>
public int Id { get; private set; }
public long Id { get; private set; }

/// <summary>
/// GraphQL Node Id
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Response/GistComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GistComment
{
public GistComment() { }

public GistComment(int id, string nodeId, string url, string body, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
public GistComment(long id, string nodeId, string url, string body, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
{
Id = id;
NodeId = nodeId;
Expand All @@ -23,7 +23,7 @@ public GistComment(int id, string nodeId, string url, string body, User user, Da
/// <summary>
/// The gist comment id.
/// </summary>
public int Id { get; private set; }
public long Id { get; private set; }

/// <summary>
/// GraphQL Node Id
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Response/IssueComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class IssueComment
{
public IssueComment() { }

public IssueComment(int id, string nodeId, string url, string htmlUrl, string body, DateTimeOffset createdAt, DateTimeOffset? updatedAt, User user, ReactionSummary reactions, AuthorAssociation authorAssociation)
public IssueComment(long id, string nodeId, string url, string htmlUrl, string body, DateTimeOffset createdAt, DateTimeOffset? updatedAt, User user, ReactionSummary reactions, AuthorAssociation authorAssociation)
{
Id = id;
NodeId = nodeId;
Expand All @@ -27,7 +27,7 @@ public IssueComment(int id, string nodeId, string url, string htmlUrl, string bo
/// <summary>
/// The issue comment Id.
/// </summary>
public int Id { get; private set; }
public long Id { get; private set; }

/// <summary>
/// GraphQL Node Id
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Models/Response/PullRequestReviewComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public class PullRequestReviewComment
{
public PullRequestReviewComment() { }

public PullRequestReviewComment(int id)
public PullRequestReviewComment(long id)
{
Id = id;
}

public PullRequestReviewComment(string url, int id, string nodeId, string diffHunk, string path, int? position, int? originalPosition, string commitId, string originalCommitId, User user, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, string htmlUrl, string pullRequestUrl, ReactionSummary reactions, int? inReplyToId, int? pullRequestReviewId, AuthorAssociation authorAssociation)
public PullRequestReviewComment(string url, long id, string nodeId, string diffHunk, string path, int? position, int? originalPosition, string commitId, string originalCommitId, User user, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, string htmlUrl, string pullRequestUrl, ReactionSummary reactions, int? inReplyToId, int? pullRequestReviewId, AuthorAssociation authorAssociation)
{
PullRequestReviewId = pullRequestReviewId;
Url = url;
Expand Down Expand Up @@ -46,7 +46,7 @@ public PullRequestReviewComment(string url, int id, string nodeId, string diffHu
/// <summary>
/// The comment Id.
/// </summary>
public int Id { get; private set; }
public long Id { get; private set; }

/// <summary>
/// GraphQL Node Id
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Response/Reaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Reaction
{
public Reaction() { }

public Reaction(int id, string nodeId, User user, ReactionType content)
public Reaction(long id, string nodeId, User user, ReactionType content)
{
Id = id;
NodeId = nodeId;
Expand All @@ -47,7 +47,7 @@ public Reaction(int id, string nodeId, User user, ReactionType content)
/// <summary>
/// The Id for this reaction.
/// </summary>
public int Id { get; private set; }
public long Id { get; private set; }

/// <summary>
/// GraphQL Node Id
Expand Down
Loading