{"action":"created","issue":{"url":"https://api.github.com/repos/octokit/octokit.graphql.net/issues/131","repository_url":"https://api.github.com/repos/octokit/octokit.graphql.net","labels_url":"https://api.github.com/repos/octokit/octokit.graphql.net/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/octokit/octokit.graphql.net/issues/131/comments","events_url":"https://api.github.com/repos/octokit/octokit.graphql.net/issues/131/events","html_url":"https://github.com/octokit/octokit.graphql.net/pull/131","id":342491820,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMzc5OTky","number":131,"title":"[WIP] HttpClient injection","user":{"login":"martincostello","id":1439341,"node_id":"MDQ6VXNlcjE0MzkzNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1439341?v=4","gravatar_id":"","url":"https://api.github.com/users/martincostello","html_url":"https://github.com/martincostello","followers_url":"https://api.github.com/users/martincostello/followers","following_url":"https://api.github.com/users/martincostello/following{/other_user}","gists_url":"https://api.github.com/users/martincostello/gists{/gist_id}","starred_url":"https://api.github.com/users/martincostello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martincostello/subscriptions","organizations_url":"https://api.github.com/users/martincostello/orgs","repos_url":"https://api.github.com/users/martincostello/repos","events_url":"https://api.github.com/users/martincostello/events{/privacy}","received_events_url":"https://api.github.com/users/martincostello/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-18T21:05:36Z","updated_at":"2018-07-28T11:50:42Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/octokit/octokit.graphql.net/pulls/131","html_url":"https://github.com/octokit/octokit.graphql.net/pull/131","diff_url":"https://github.com/octokit/octokit.graphql.net/pull/131.diff","patch_url":"https://github.com/octokit/octokit.graphql.net/pull/131.patch"},"body":"Adds a test showing a proof-of-concept for injection of `HttpClient` into `Connection` so that `IHttpClientFactory` can be used for scenarios such as ASP.NET Core 2.1+ applications.\r\n\r\nRelates to #125."},"comment":{"url":"https://api.github.com/repos/octokit/octokit.graphql.net/issues/comments/408601940","html_url":"https://github.com/octokit/octokit.graphql.net/pull/131#issuecomment-408601940","issue_url":"https://api.github.com/repos/octokit/octokit.graphql.net/issues/131","id":408601940,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODYwMTk0MA==","user":{"login":"martincostello","id":1439341,"node_id":"MDQ6VXNlcjE0MzkzNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1439341?v=4","gravatar_id":"","url":"https://api.github.com/users/martincostello","html_url":"https://github.com/martincostello","followers_url":"https://api.github.com/users/martincostello/followers","following_url":"https://api.github.com/users/martincostello/following{/other_user}","gists_url":"https://api.github.com/users/martincostello/gists{/gist_id}","starred_url":"https://api.github.com/users/martincostello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martincostello/subscriptions","organizations_url":"https://api.github.com/users/martincostello/orgs","repos_url":"https://api.github.com/users/martincostello/repos","events_url":"https://api.github.com/users/martincostello/events{/privacy}","received_events_url":"https://api.github.com/users/martincostello/received_events","type":"User","site_admin":false},"created_at":"2018-07-28T11:50:42Z","updated_at":"2018-07-28T11:50:42Z","author_association":"CONTRIBUTOR","body":"@StanleyGoldman I've done some refactoring based on the feedback and rebased onto master. The changes I've made are:\r\n\r\n  1. Refactored `Connection` as suggested to add the new constructor that accepts `HttpClient` following the pattern in Octokit as suggested. I've also added an extra `HttpClient`-based constructor that makes DI easier in the case where the default URI is used (i.e. for GitHub.com).\r\n  1. Added an optional parameter to `Run()` that accepts a `CancellationToken` which is passed to the `SendAsync()` method of `HttpClient`. I've not plumbed this in to the query runners as then that goes a bit viral, but happy to add this in this PR or a different one if you think it's worth doing.\r\n  1. Add validation of arguments to constructors and methods.\r\n  1. Changed `GitHubApiUri` to a get property instead of a read-only field, as that's more usual for C#.\r\n  1. Added `ConfigureAwait(false)` to places where `await` is used to prevent potential deadlocks in apps with a synchronization context, like an application with a UI.\r\n  1. I've added XML documentation mostly lifted as-is from Octokit and applied it to all the public members of the `Connection` class, rather than just delete `<inherit-doc/>`.\r\n  1. I've updated the test projects to target `netcoreapp2.1` as 1.1 is relatively old in .NET Core terms now, as well as update the .NET Core Test SDK and xunit. This then created some code analysis warnings from the xunit analysers that have shipped in-box since `2.3.0`, so I fixed those too. I think as an unintended side-effect of the runtime upgrade, some of the tests in `ExpressionRewriterTests` are now failing because the `ToString()` representations now include the airity of the type (so ```IEnumerable`1``` instead of `IEnumerable`). I wasn't sure the best way to fix these, so for now they're still broken.\r\n  1. Fixed a `NullReferenceException` in tests that use `ExpressionCompiler` that can occur when the tests are run in parallel with each other and try to add items to the dictionary at the same time. I've resolved this by changing the code to use `ConcurrentDictionary` instead."}}
{"actor":{"display_login":"martincostello"}}