* Fix handling for Streams
Fix `NullReferenceException` if raw content was handled as a string rather than a stream by `HttpClientAdapter.BuildResponse()`.
Resolves#2789.
* Add Connection.GetRaw tests
Add tests for `Connection.GetRaw()` and for #2789.
---------
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
* (GH-2802) Add unit test to demonstrate the problem
This unit test currently fails which demonstrates the problem and it should pass when I am done with the PR
* (GH-2802) Add a GetRaw method that accepts a timeout
I debated adding an optional parameter for the timeout to the existing GetRaw method (which would be my personal preference) but it would be a breaking change and I doubt the Octokit team would be interested in such a change
* (GH-2802) Invoke `GetRaw` rather than `Get>byte[]>` when retrieving a repo's archive content.
This ensure stream content are handled properly and solves the problem described in GitHub issue 2802
* (GH-2802) Fix unit tests that got broken due to my recent change to the GetArchive method
* (GH-2802) Fix formatting
* (GH-2802) Fix more formatting
* update models with updated permission enum
* add suppress message attribute
* update integration tests
* refactor: new and legacy update teams endpint
* refactor: add new delete team endpoint
* use TeamPermission on NewTeam
* use updated delete on team context dispose
* add permission enum for team response object
* refactor: remove legacy suffix from method names
* introduce permissions object on Team
* refactor: rename enum to TeamRepositoryPermission
* fix formatting
* change Permission to string to match api specs
* add TeamRepository
* add CheckTeamPermission endpoint support
* fix convention tests
* update comments on TeamRepository props
* add two new endpoints in TeamsClient
* refactor: rename ApiUrl for TeamPermission
* fix test
* implement methods for new endpoints
* add the integration tests
* fix spelling
* update comments
* refactor: rename method name
* fix: add end tag for remarks
* refactor: remove unused method param
* fix docstring comment
* the unit tests are in finally
* add docs for teams api
* split CheckTeamPermissions into two methods
* Update ObservableTeamsClientTests.cs based on review
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
* add cref to legacy update and delete endpoints
* remove editorconfig file
* Update Octokit.Tests/Clients/TeamsClientTests.cs
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
* remove unused line
* rename variable based on review
* rename prop to match constructor param
* add comment to explain TeamPermission enum values on update
Co-authored-by: notauserx <notauserx@users.noreply.github.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
* Added authentication using bearer token.
* Added Installation and AccessToken clients.
* Added new clients to Reactive project
* added support for DateTime serialized as FileTime
* added support for StatusEventPayload
* added support for StatusEventPayload
* Added test for StatusEventPayload and fixed serializer to return that event payload type.
* WIP - added ApplicationClient and related Api Urls.
* Continued implementing Installations support.
* Fixing build (WIP)
* fixed build
* added Account property to Installation. prefer nameof(x) over literal "x".
* fixed according to code review.
* fixed build.
* switched Installation ID from int to long.
* added Permissions and Events properties to Installation.
* added documentation to Application and Installation properties in IGitHubClient.
* wip - added tests to new clients
* wip - fix build
* wip - fixed build.
* added InstallationsClient tests.
* added integration test for InstallationsClient.
* changes requested in code review.
* add Get method for App
* Create GitHubApp response model instead of re-using existing Application response model
* add Get method to observable client
* fixed build (both locally and failed test).
* Fixed documentation and added some missing XML docs.
* added DebuggerDisplay to StatusEventPayload
* updated XML docs and added some missing bits. prefer nameof(x) over literal "x".
* Add xml comments to AccessToken response model and use DateTimeOffset rather than DateTime
* Tidy up XmlComments and make consistent across client and observable client and interfaces
* fixup unit tests to independently verify preview header
* Implement GetInstallation method
* revert commits unrelated to GitHubApps - these can be done on a separate PR if required
* this extra authenticator class doesnt appear to be used anywhere
* undo project file change as it doesnt appear to be necessary
* Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps"
This reverts commit c53cc110b8d807f62fdfeaa7df19e1532d050007, reversing
changes made to 0c9e413d420a4725738644ea5b13af6ec102d456.
* Revert "Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps""
This reverts commit 02d52b8adf814b6945c60cb59a907a8cd34b1ce7.
* add XmlDoc comments to response models and flesh out installation permissions
* name AcceptHeaders member consistently
* accidentally lost changes to Credentials.cs
* Enhance Intergation test framework to handle GitHubApp settings and discoer tests appropriately
Get code ready for GitHubJWT nuget package but for now just hardcode a JWT in ENV VAR
Add 1 integration test for each method and ensure they are working!
* fixed compiler warnings.
* Added support for Installation=>Id field that arrives in a Pull Request Event payload.
(See the last field in the sample JSON of https://developer.github.com/v3/activity/events/types/#pullrequestevent)
* Change integration test project to netcoreapp2.0 so we can use GitHubJwt nuget package in integration tests
* First cut at some GitHubApp doco
* update mkdocs config
* Moved the Installation property to ActivityPayload, so it's available in all payloads.
This feature is not undocumented, unfortunately, but valid:
https://platform.github.community/t/determining-which-installation-an-event-came-from/539/11
* Split Installation to Installation and InstallationId, and added a comfort method for gaining its AccessToken.
* fixed InstallationId CreateAccessToken to receive IGitHubAppsClient. added (and fixed) docs.
* reverted object-oriented style comfort method and it's docs.
* update all test projects to netcoreapp2.0
* tweak build configs to use 2.0.3 SDK
* also need to update cake frosting build to netcoreapp2.0
* tweak docs some more
* fix convention test failures
* test projects still had some old runtime parts in them!
* travis osx image needs to be at least 10.12 for .NET Core 2.0
* shell script might need the same argument tweak for cake
* more doc tweaks
* Make sure compiler warning output isnt somehow causing Linux and OSX builds to fail
* moar logging for linux/OSX builds
* stop sourcelink on linux/OSX builds to see if that is the problem
* set verbosity to detailed for the dotnet build step
* try new sourcelink and list out remotes
* is travis being weird with git clone?
* SourceLink may be defaulting to true on CI server so explicitly set it as false rather than omitting it
* detailed is a bit too verbose for travis, try normal
* turn sourcelink back on for Linux/OSX
* fix compiler warning
* Try SourceLink.Create.CommandLine instead of SourceLink.Create.GitHub
* CliToolReferences did not update to latest versions
* remove debug origin info
* turn off msbuild output
* go back to SourceLink.Create.GitHub!
* time diff between dev PC and API causes issues if specifying a full 600 second token
* handle extra date format that Installation end point now returns
* field needs to be protected in order to be deserialized
* provide even more buffer for client vs server clock drift
* Update to latest GitHubJwt reference
* go back to SDK 1 since SDK 2 is having sporadic travisCI faliures in TestSourceLink build step
* get appveyor working
* update sourcelink back to latest, and use SDK 1.04 (runtime 1.0.5)
* Updated GitHubClient.cs XML Docs to match dev docs.
* Updated Connection.cs XML Docs to match dev docs.
* Updated ProductHeaderValue.cs XML Docs to match GitHub dev docs.
* Updated EnterpriseProbe.cs XML Docs to match GitHub dev docs.
* Updated GitHubClient.cs XML Docs to match GitHub dev docs, corrected grammar issue.
* Updated Connection.cs XML Docs to match GitHub dev docs, corrected grammar issue.
* Updated ProductHeaderValue.cs XML Docs to match GitHub dev docs, corrected grammar issue.
* Removed my tabs, replaced with spaces to match format.
* Removed tabs again
* There seems to be some kind of bug where tabs are being shown though my local editor show none, so I'm submitting a bug to GitHub.com and editing in-browser to fix.
* Update GitHubClient.cs
* There seems to be some kind of bug where tabs are being shown though my local editor show none, so I'm submitting a bug to GitHub.com and editing in-browser to fix.
* Update Connection.cs
* There seems to be some kind of bug where tabs are being shown though my local editor show none, so I'm submitting a bug to GitHub.com and editing in-browser to fix.
* Change a couple of tabs to spaces
* tabs to spaces
* tabs to spaces
* Add possibility to configure GitHubClient timeout (#963)
A first attempt to fix the problem describe in #963 by adding a possibility
to extend the default timeout value (100s)
that is too short to be able to post assets in github release.
* Rename to SetRequestTimeout
Make comments consistent
* Use assembly version instead of hard-coded ones
Builds happening on AppVeyor specify the assembly version with `dotnet build /p:Version=<gitversion>`
* Set default version for dev time
This is to avoid that the default 1.0.0 version be assigned to the assemblies
* Move various package/assembly properties from AssemblyInfo into csproj files so dotnet build can set them all
* Get rid of SolutionInfo and move assembly version function into Connection class
* Rework FormatUserAgent to use InformationalVersion and guard against exceptions determining platform OS/arch (fixes#1617)
* Update assembly descriptions
* Reword dotnetcore to .NET Core
* Attempted workaround for package version dependency issue by specifying version on dotnet restore
see https://github.com/NuGet/Home/issues/4337
* Add client for organization outside collaborators
* Add unit/integration tests
* Add methods for removing an outside collaborator
* Add unit/integration tests
* Add new Put method to Connection which accepts a preview header
* Add methods for converting an org member to an outside collaborator
* Fix copy paste errors in new exceptions
* According to API docs, a 403 should be returned if the member is not a member of the org, but a 404 is actually returned
* Add unit/integration tests
* Remove unused using directives
* Got a bit overzealous with my removal of using directives
* Fix integration tests by using the configured Organization and test username rather than henrik's :)
* Remove ApiOptions overloads as it isn't currently supported
* Fix XML doc grammar
* Fix failing unit tests
* Missed a couple of nameof replacements
* Add release notes and bump version to 0.24
* run "build FormatCode" to fix up whitespace/formatting issues
* Fix failing Ssh key tests due to "validation exception". This key must be in use on github (under another user, most likely from these tests failing). Changed to a new SSH key and tweaked tests to reduce chance of a key being created and not destroyed
* Assignee and Assignees cant both be specified on NewIssue. We missed this one in the PR. Marked Assignee as [Obsolete] and fixed tests to use Assignees
* Fix a couple of Reactions tests that were calling the wrong client methods
* Fix timeline tests - looks like the response class has changed shape a bit, it now has an Issue object in the payload and Id field isnt present (leaving Id field there in case other timeline events do use it)
* Fix some following tests that require the test user to follow more than 1 other user
* Unskip these Event tests now because apparently they work!
* add breaking changes notes
* Update ApiErrorMessageSafe to return null for empty and whitespace strings (#1540)
* return null if ApiError.Message is empty or whitespace
* Uncomment test, which now passes
* update release notes to include PR1540
* Add "Bot" AccountType, was causing a deserialization exception when running the integration test "SearchForExcludedLanguage" (#1541)
* Update to include PR1541
* add bullets to make release notes easier to read
* markup additional code mentions in notes
* Fix grammar
fields => field
* Add some tests to be completed
* Actually fail the tests
* Create AbuseException class
Copied from ForbiddenException and then gone over to inherit from it.
* Actually add AbuseException to csproj
* Update test file
* Ran .\build FixProjects
* Test updates
* Default message update for AbuseException
* Separate the exception creation logic
* Remove message assertion -- doesn't matter here
* Additional test for abuse message
* Remove unnecessary variable assignment
* Failing test for unsafe request
* Attempt to fix test
Still broken -- I don't think empty strings count to trigger the default
message
* Remove test that will always fail due to another issue
Opened #1529 to explore this.
* New tests (some failing)
* Passing tests are, like, better than failing tests.
* Last passing test
* Cleanup
* Add test for zero value and fix code
Lol boundary cases.
* cleanup
* Mark ParseRetryAfterSeconds as static
* Add GetObjectData override to AbuseException
To include data for RetryAfterSeconds variable, and satisfy the build
check.
* Add back failing test & skip it
* Change to nullable int with null default
* Fix tests around nullable default
* whitespace fixes
* Compact the logic; tests still pass
* Invert the if statements for compactness / clarity
* Test subclasses & reformatting
* Test name changes
* Whitespace fix
* Remove redundant line
* [WIP]
* add new method to add assignees for an issue
* added new overloads
* added unit tests
* fixed missed overload calls
* fixed inconsistency in tests
* added integration tests
* fixed errors in tests
* fixed all remarks
* added new overloads
* added unit tests
* added integration tests
* fixed incorrect variable names
* added new overloads
* added unit tests
* added itegration tests
* fixed integration tests
* removed extra empty lines
* fixed errors in unit tests
* added overloads on IObservableReleasesClient and IReleasesClient
* added new unit tests
* added integration tests
* added Task as return value of unit tests
* added Task as return parameter
* added return value ReleasesClientTests
* another try to get tests work
* another one try
* undo prev commit
* fixed errors in tests
* removed extra ThrowsAsync checks
* added new overloads
* added unit tests
* added integration tests
* added integration tests
* Add ApiOptions overloads to IWatchedClient + tests.
* Add ApiOptions overloads to IObservableWatchedClient + tests.
* More tests.
* fixed error in ObservableWatchedClient
* added unit tests
* added integration tests
* added new overloads
* added unit tests
* added integration tests
* renamed "Ensures" methods to deliver more consistency in code
* fixed failed tests
* Add ApiOptions overloads to methods on I(Observable)IssuesLabelsClient (#1329)
* correcting a couple of tests (#1331)
* Add ApiOption overloads to methods on I(Observable)OrganizationsClient (#1324)
* Add ApiOptions overloads to methods on I(Observable)OrganizationMembersClient (#1332)
* fix description
* add new response for IssueAssignees
* add constructor for IssueAssignees
* add debugger display for NewAssignees
* add methods for observable assignees client; new unit tests
* add observable unit tests for add method
* place AddAssignees under IssueClient
* fix description
* [WIP] add generic delete method
* revert add assignees
* add assignees key under issue client
* remove IssueAssignees dependencies
* fix type IssueAssignees
* add remove method for issue assignees; finish generic delete method
* unit tests for remove assignees
* Add Assignees property to NewIssue and UpdateIssue requets
Add Asignees property to Issue response
Removed [SerializeNull] attribute from UpdateIssue.Assignee as this was causing it to remove assignee when none was specified
Add a couple of integration tests to prove Assignees are being deserialised
* rename NewAssignees to AssignessUpdate
* change Assignees key description
* check null Issue.ToUpdate method
* add accept header for IssuesClientTests
* Fix some more unit tests
* add integration test
Check if an assignee was added to an issue
* fix merge conflicts
* resolve conflicts
* implement some hints from @ryangribble
* resolve merge fixes
* clean up
* some more changes
* create new repo
Create a new repo for integrationtest
'CanRetrieveIssuesWithMultipleAssignees()'
* fix merge
* fix conflicts
* fix xml
* change test
* change delete overloads
* Fix tests
* fix xml
* Add helper function RemoveLabel
* Add helper function RemoveAssignee
* Format last commit
* Add integration tests to exercise new Assignees field on IssueUpdate
* GitHub API doesnt allow Assignee and Assignees properties to both be specified - API docs say that Assignee is deprecated so mark it [Obsolete] and dont populate it in Issue.ToUpdate()
* Add Assignees field to PullRequest response object, and integration tests to verify it is populated.
This field is not listed in the API docs but probing the API revealed it is included in payloads
* add a couple of extra tests to verify the IssueUpdate.Labels is working correctly
* Include assignees in ctor for consistency
* fix IssueUpdate test for new Assignees field
* Add get method for required status checks
* Add api urls for required status checks
* change name of apir url for required status checks
* fix xml comment
* add update method for required status checks
* add delete method for required status checks
* fix api url
* fix xml comment
* add api url for required status cehcks contexts
* add get method for required status checks contexts
* add replace method for required status checks contexts
* add add method for required status checks contexts
* add new overload for delete method
* add delete method for required status checks contexts; fix overloads for delete
* add api url for restrictions
* add get method for restrictions
* add delete method for restrictions
* add api url for teams restrictions
* add get method for team restrictions; fix delete method restrictions
* fix overhead for get team restrictions
* fix httpmethod for update required status checks
* add set method for team restrictions
* add add method for team restrictions
* add delete method for team restrictions
* add api url for user restrictions
* add get method for user restrictions
* add set method for user restrictions
* add add method for user restrictions
* add delete method for user restrictions
* Add unit test; fix api urls
* Add ExcludeFromTest class
* add exclude attribute to methods
* Add attribute usage
* Add parameter to interface
* add observable unit tests
* rename excludefromtest
exclude all the tests for the new api endpoints because they broke the
pagination and syncobsverable tests.
* rename excludefromattribute
* refactor observable methods
* [WIP] Add integration tests
* finish integration test
* fix renamed branch protection restrictions
* add team and user collections
* rename set to update
* rename test methods
* optimize integration tests
* made some tidy ups
- fixup comment wording Edit => Replace
- remove spurious characters from description
- remove un-needed exclude attributes
* remove ForOrgRepo tests
* remove unused org contexts
* dispose contexts
* remove obsolete GetRedirect
* add clarifying comment to restriction methods
* Add HTTP 451: Legal Takedown Exception.
* Add LegalRestrictionException in HandleErrors.
* Cast 451 to HttpStatusCode and include exception in csproj files.
* Tests added and "FixProjects".
* Fix: 403 -> 451 in 451Tests.