-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix for ThrowInt32OverflowException in Issue.Events.GetAllForRepository #2037
Conversation
- Updated Model with long Id - Fixed tests - Updated IssuesClient and interface - Updated IssuesEventsClient and interface
Codecov Report
@@ Coverage Diff @@
## master #2037 +/- ##
=======================================
Coverage 70.73% 70.73%
=======================================
Files 537 537
Lines 14106 14106
=======================================
Hits 9978 9978
Misses 4128 4128
|
Which tests was this? And how are they failing? |
Four instances of:
Unless I missed something at Dev startup - but directly from master - the four of those fail. Also there are some integration tests that fail - but I assumed that there are some environment variables I don't have. |
It's weird because both master and this PR don't seem to have issues with those tests. These are the usages as I understand it, and I can't spot how the changes relate to your PR: |
There's some setup required - https://github.com/octokit/octokit.net/blob/master/CONTRIBUTING.md#slow-tests - but I'm not worried about them for this PR. |
Yeah it is those four, they do break for me on master as well - without any changes. Any idea what to try? I get this:
|
Seems to be happening in:
I wonder if it is dotnet core 3 related... |
@terrance00 please open a new issue with details about it - we run the tests for |
Hey man, sorry for the delay. I have resigned to running the tests in the command line - and that does not fail for those tests. Leads me to believe that it must be something IDE related in relation the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@terrance00 thanks for submitting this PR. I think we can avoid changing the number
parameter from an int
to a long
here as these are for the Issue
itself, not the EventInfo
number
that is being deserialized. This will simplify the diff of changes.
@@ -55,7 +55,7 @@ public interface IObservableIssuesClient | |||
/// <param name="number">The issue number</param> | |||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", | |||
Justification = "Method makes a network request")] | |||
IObservable<Issue> Get(string owner, string name, int number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number
used in this interface is not the one overflowing. Can we undo the changes in this file to simplify the diff?
@@ -52,7 +52,7 @@ public interface IIssuesClient | |||
/// <param name="number">The issue number</param> | |||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", | |||
Justification = "Method makes a network request")] | |||
Task<Issue> Get(string owner, string name, int number); | |||
Task<Issue> Get(string owner, string name, long number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here - this number
used in this interface is not the one overflowing. Can we undo the changes in this file to simplify the diff?
@@ -20,7 +20,7 @@ public interface IObservableIssuesEventsClient | |||
/// <param name="owner">The owner of the repository</param> | |||
/// <param name="name">The name of the repository</param> | |||
/// <param name="number">The issue number</param> | |||
IObservable<EventInfo> GetAllForIssue(string owner, string name, int number); | |||
IObservable<EventInfo> GetAllForIssue(string owner, string name, long number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing for this file - number
here is the issue number itself, no the EventInfo
number that is being deserialized.
@@ -21,7 +21,7 @@ public interface IIssuesEventsClient | |||
/// <param name="owner">The owner of the repository</param> | |||
/// <param name="name">The name of the repository</param> | |||
/// <param name="number">The issue number</param> | |||
Task<IReadOnlyList<EventInfo>> GetAllForIssue(string owner, string name, int number); | |||
Task<IReadOnlyList<EventInfo>> GetAllForIssue(string owner, string name, long number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing for this file - number
here is the issue number itself, no the EventInfo
number
that is being deserialized.
Thanks for taking a shot at this @terrance00! I received #2060 which was the minimal fix so this can be closed out, but I hope that you can find time in the future for another contribution. |
Fixes #2031
Updated Model with long Id
Fixed tests
Updated IssuesClient and interface
Updated IssuesEventsClient and interface
Double checked that the same tests still failing for the same reasons.