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

Update IssueEvent ID field from int to long #2060

Merged
merged 1 commit into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Octokit.Reactive/Clients/IObservableIssuesEventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public interface IObservableIssuesEventsClient
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The event id</param>
/// <param name="eventId">The event id</param>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
IObservable<IssueEvent> Get(string owner, string name, int number);
IObservable<IssueEvent> Get(string owner, string name, long eventId);

/// <summary>
/// Gets a single event
Expand All @@ -115,9 +115,9 @@ public interface IObservableIssuesEventsClient
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The event id</param>
/// <param name="eventId">The event id</param>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
IObservable<IssueEvent> Get(long repositoryId, int number);
IObservable<IssueEvent> Get(long repositoryId, long eventId);
}
}
12 changes: 6 additions & 6 deletions Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ public IObservable<IssueEvent> GetAllForRepository(long repositoryId, ApiOptions
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The event id</param>
public IObservable<IssueEvent> Get(string owner, string name, int number)
/// <param name="eventId">The event id</param>
public IObservable<IssueEvent> Get(string owner, string name, long eventId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return _client.Get(owner, name, number).ToObservable();
return _client.Get(owner, name, eventId).ToObservable();
}

/// <summary>
Expand All @@ -173,10 +173,10 @@ public IObservable<IssueEvent> Get(string owner, string name, int number)
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The event id</param>
public IObservable<IssueEvent> Get(long repositoryId, int number)
/// <param name="eventId">The event id</param>
public IObservable<IssueEvent> Get(long repositoryId, long eventId)
{
return _client.Get(repositoryId, number).ToObservable();
return _client.Get(repositoryId, eventId).ToObservable();
}
}
}
4 changes: 2 additions & 2 deletions Octokit.Tests.Integration/Clients/IssuesEventsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public async Task CanRetrieveIssueEventById()
var closed = await _issuesClient.Update(_context.RepositoryOwner, _context.RepositoryName, issue.Number, new IssueUpdate { State = ItemState.Closed });
Assert.NotNull(closed);
var issueEvents = await _issuesEventsClient.GetAllForRepository(_context.RepositoryOwner, _context.RepositoryName);
int issueEventId = issueEvents[0].Id;
var issueEventId = issueEvents[0].Id;

var issueEventLookupById = await _issuesEventsClient.Get(_context.RepositoryOwner, _context.RepositoryName, issueEventId);

Expand All @@ -418,7 +418,7 @@ public async Task CanRetrieveIssueEventByIdWithRepositoryId()
var closed = await _issuesClient.Update(_context.RepositoryOwner, _context.RepositoryName, issue.Number, new IssueUpdate { State = ItemState.Closed });
Assert.NotNull(closed);
var issueEvents = await _issuesEventsClient.GetAllForRepository(_context.Repository.Id);
int issueEventId = issueEvents[0].Id;
var issueEventId = issueEvents[0].Id;

var issueEventLookupById = await _issuesEventsClient.Get(_context.Repository.Id, issueEventId);

Expand Down
8 changes: 4 additions & 4 deletions Octokit/Clients/IIssuesEventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public interface IIssuesEventsClient
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The event id</param>
/// <param name="eventId">The event id</param>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<IssueEvent> Get(string owner, string name, int number);
Task<IssueEvent> Get(string owner, string name, long eventId);

/// <summary>
/// Gets a single event
Expand All @@ -116,9 +116,9 @@ public interface IIssuesEventsClient
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The event id</param>
/// <param name="eventId">The event id</param>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<IssueEvent> Get(long repositoryId, int number);
Task<IssueEvent> Get(long repositoryId, long eventId);
}
}
12 changes: 6 additions & 6 deletions Octokit/Clients/IssuesEventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ public Task<IReadOnlyList<IssueEvent>> GetAllForRepository(long repositoryId, Ap
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The event id</param>
public Task<IssueEvent> Get(string owner, string name, int number)
/// <param name="eventId">The event id</param>
public Task<IssueEvent> Get(string owner, string name, long eventId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return ApiConnection.Get<IssueEvent>(ApiUrls.IssuesEvent(owner, name, number));
return ApiConnection.Get<IssueEvent>(ApiUrls.IssuesEvent(owner, name, eventId));
}

/// <summary>
Expand All @@ -165,10 +165,10 @@ public Task<IssueEvent> Get(string owner, string name, int number)
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The event id</param>
public Task<IssueEvent> Get(long repositoryId, int number)
/// <param name="eventId">The event id</param>
public Task<IssueEvent> Get(long repositoryId, long eventId)
{
return ApiConnection.Get<IssueEvent>(ApiUrls.IssuesEvent(repositoryId, number));
return ApiConnection.Get<IssueEvent>(ApiUrls.IssuesEvent(repositoryId, eventId));
}
}
}
4 changes: 2 additions & 2 deletions Octokit/Helpers/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ public static Uri IssuesEvents(string owner, string name)
/// <param name="name">The name of the repository</param>
/// <param name="id">The event id</param>
/// <returns></returns>
public static Uri IssuesEvent(string owner, string name, int id)
public static Uri IssuesEvent(string owner, string name, long id)
{
return "repos/{0}/{1}/issues/events/{2}".FormatUri(owner, name, id);
}
Expand Down Expand Up @@ -2971,7 +2971,7 @@ public static Uri Issues(long repositoryId)
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="id">The event id</param>
/// <returns>The <see cref="Uri"/> that returns the issue/pull request event and issue info for the specified event.</returns>
public static Uri IssuesEvent(long repositoryId, int id)
public static Uri IssuesEvent(long repositoryId, long id)
{
return "repositories/{0}/issues/events/{1}".FormatUri(repositoryId, id);
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Response/IssueEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class IssueEvent
{
public IssueEvent() { }

public IssueEvent(int id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl)
public IssueEvent(long id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl)
{
Id = id;
NodeId = nodeId;
Expand All @@ -27,7 +27,7 @@ public IssueEvent(int id, string nodeId, string url, User actor, User assignee,
/// <summary>
/// The id of the issue/pull request event.
/// </summary>
public int Id { get; protected set; }
public long Id { get; protected set; }

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