107 Commits

Author SHA1 Message Date
Rasmus Mikkelsen
16cea259dd docs: Provide easy alternative to create App JWT token (#2937)
* Provide easy alternative to create App JWT token

* Make it clear that its the key content

* Commit suggested changes by @kfcampbell

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

* Add a reminder regarding the required using statements

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2024-06-24 12:34:59 -05:00
Andrey Akinshin
48d061afd2 [feat] Introduce NewRelease.DiscussionCategoryName, Fixes #2746
Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
2024-01-02 15:51:21 -06:00
Liam Neville
2d4ba4e891 [FEAT] Self-hosted runners and Self-hosted runner groups APIs 2023-04-28 13:03:15 -05:00
Nick Floyd
00b89daa23 [maint] Removes the old implementation of sourcelink and uses the newer one present in the .net SDK (#2666)
* reoves the old implemetnation of sourcelink and uses the newer one  present in the .net SDK

* cleans up appveyor

* updates proj with sourcelink props

* adds deterministic build check as well.

* Update docs/debugging-source.md

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2023-02-07 11:14:49 -06:00
notauserx
891015c39f update models with updated permission enum (#2633)
* 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>
2023-01-20 10:48:00 -08:00
Keegan Campbell
bf6678543f Remove instances of lower-case h (#2655) 2023-01-12 11:56:44 -06:00
Zero-Point-Three Mach
64614ce1d3 Fix #2618 - Improve docs for the 'release' chapter (#2628)
Fix sample code and add 'get latest' section

1. Fix the sample code for "Get All" not working.
2. Add the "Get Latest" section.
2022-12-01 15:56:06 -08:00
notauserx
46b5077b16 add islocked filter to SeachIssuesRequest (#2623)
* add islocker filter to SeachIssuesRequest

* update docs

* Update docs/search.md with review suggestions

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

Co-authored-by: notauserx <notauserx@users.noreply.github.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2022-11-30 15:20:19 -08:00
Matt
7b6d57af33 Add NewRelease.GenerateReleaseNotes property (#2596)
* Add `GenerateReleaseNotes` property

Enable generating release notes during creation of a release.

* Update release docs
2022-10-18 06:38:50 +01:00
Riccardo De Agostini
fa29939f50 Use correct methods and URL to generate release notes (#2592) 2022-10-07 13:06:53 -05:00
Rares Iova
b3d2096766 [Releases]Added support for generating release notes (#2563) 2022-09-07 11:01:32 -05:00
Randy Kreisel
269201cd96 Remove reference to Basic Authentication in the docs (#2555)
* Update getting-started.md

Edited the section on Authentication to remove Basic Auth, which GitHub no longer supports, with instructions for using a Personal Access Token.

* Update getting-started.md

Second commit: Removed "/en" from links.

* Update docs/getting-started.md

Co-authored-by: Tim Rogers <timrogers@github.com>

* Update docs/getting-started.md

Co-authored-by: Tim Rogers <timrogers@github.com>

* Update getting-started.md

Removed the two bullet pointed items because the sentence preceding them provided a clearer description of the options.

Co-authored-by: Tim Rogers <timrogers@github.com>
2022-08-30 12:36:02 +01:00
notauserx
595e35d641 add active lock reason to PR (#2543)
* add active lock reason to PR

* update docs

* refactor: extract lock and unlock from IIssuesClient
create ILockUnlockClient so both IIssuesClient and IPullRequestClient can
access lock and unlock methods.

* refactor LockUnlock for reactive clients

* Update doc to include lock unlock sample code

* Use Assert.Null to check null value in test

Co-authored-by: notauserx <notauserx@users.noreply.github.com>
2022-08-19 18:36:47 +01:00
Chris Simpson
b4ca7c7c57 docs: Adds documentation on how to create a branch (#2541) 2022-08-11 01:35:54 -05:00
Stefan-J-Hanke
2179065201 [DOCS] Corrects links into github documentation (#2378) 2022-07-11 09:23:08 -05:00
Nick Floyd
c4e6fcdbcc Updates the repo docs with the current release workflow (#2438)
* updates the repo docs with the current release workflow
2022-04-27 14:49:19 -05:00
Eric Carlson
20549430e5 Add support for multi users and orgs in SearchCodeRequest (#2291) 2021-02-13 16:28:32 -04:00
Alexander Salamatov
bd85dd9a4e Update git-database.md (#2247) 2020-10-06 09:50:22 -03:00
Hannah Kiekens
946b0872b7 Fix documentation: change all master branch references to main (#2220) 2020-07-07 15:01:55 -03:00
Next Turn
2bfd101bd0 Replace emojis with Unicode characters (#2169) 2020-04-11 20:45:39 -03:00
Eric Carlson
3e7c70cf4e add support for multiple extension filters (#2019)
* add support for multiple extension filters

* update documentation, use ienumerable instead of ilist
2019-10-03 08:53:33 -03:00
Brendan Forster
8cd0b341dd Begin implementation of Enterprise ManagementConsole API, redux (#2010)
* Initial implementation of ManagementConsole - maintenance mode

* Add environment var support for management console password for integration tests

* Add reactive client and unit tests

* Update some xmlDoc

* I think this is a better way to setup the underlying baseUri on IConneciton, to achieve managemet console access rather than requiring a specific GitHubClient that cant call normal API's
Instead, the management client methods can check the base Url and if it contains /api/v3/ they can set their relative endpoint Uri to include a leading "/" which will cause the /api/v3/ to be removed.

* Update EnterpriseClient.cs

Fix xml comments

* Update IEnterpriseClient.cs

Fix xml comments

* Still trying to get the xmDoc perfect, thanks app veyor :)

* XmlDoc'ing my way to success

* Add specific test attribute for management console tests

* check chronic string empty/null

* Use helper's password field in test

* Tidy up maintenance mode tests by using a context/destructor to manage the initial/end state of maintenance mode

* make internal and tidy up URL concatenation

* move GHE endpoint fixup inside ApiUrls methods

* Rework request object to be the correct structure so SimpleJsonSerializer can be used to serialize it.  Remove MaintenanceDate class and just pass in the Date/string for when
Still need to use UrlFormEncoding rather than json in the POST body though...

* Create abstract base class for FormUrlEncoded parameters (similar to existing RequetParameters) and inherit from it in UpdateMaintenanceRequest

* Fix maintenance context logic - destructor should always turn maintenance OFF regardless of initial requested state

* Fix xml comment

* Fix Xml comment

* Those pesky xml comments!

* Fine, I give up!

* Fix string.Format

* fix bad rebase

* fix failing convention tests

* restore missing whitespace

* writing some docs

* some edits

* edit
2019-09-22 15:09:56 -03:00
Jan Klass
1f01b22de5 Fix typo (#1985) 2019-09-04 08:41:13 -03:00
Abhijeet
153250fbcd adding example for creating PR from fork (#1944)
* adding example for creating PR from fork

* addressing pr feedback
2019-02-24 21:30:57 +10:00
Brian Chavez
3470f45b32 Spellcheck documentation. (#1929) 2019-01-14 08:11:27 -04:00
Brendan Forster
d1528ce57d update docs to include the await keyword (#1924) 2019-01-11 07:31:48 -04:00
Sébastien Ros
2cdc2679b1 Fixing sample (#1879) 2018-10-02 17:43:40 +10:00
Rich Lander
2cb1821295 Updating to more recent repo names 2018-09-24 10:22:29 -04:00
d-a-s
90b0a7c551 appClient - all GitHubApps methods inside subclass (#1853)
In implementing this, I found that `appClient.GetCurrent()` (etc.) don't work, but that there is a subclass, so that `appClient.GitHubApps.GetCurrent()` etc does work. Took me a while to figure it out, thought that updated docs might help others.
2018-07-29 11:47:26 +10:00
Adrian Godong
1515dc2a2f Update github-apps.md (#1843) 2018-07-04 22:29:44 +10:00
Ryan Gribble
ef1994d86f Attempt to clarify GitHubApp docs (#1824)
* Attempt to clarify GitHubApp docs

* Tweak additional notes formatting

* more tweaks
2018-06-29 16:06:03 +10:00
Ehsan Mirsaeedi
f34a4298e4 Mentioning the reset time is based on UTC standard (#1819) 2018-06-20 22:32:12 +10:00
Mark Adamson
596d0cfdcc Fix typo causing compile error (#1804) 2018-06-02 12:50:35 +10:00
Mark Adamson
03ee6d7bb8 Correct upload asset code (#1805)
1. Remove incorrect usage of await on synchronous method
2. Dispose of stream after use
2018-06-02 12:49:17 +10:00
Itai Bar-Haim
5ffc96995f Adding initial support for GitHub Apps. (#1738)
* 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)
2018-04-16 20:42:23 +10:00
Andrius Bentkus
7aeea34fb2 Add csharp hint to code blocks (#1791) 2018-04-04 20:57:53 +10:00
Ehsan Mirsaeedi
f1b9674110 Improve Rate Limits' Documentation (#1742)
* Improve Rate Limits' Documentation

I added an example about client.Miscellaneous.GetRateLimits().

* Update getting-started.md

* Update getting-started.md

* Update getting-started.md

* Update getting-started.md

* Update getting-started.md
2018-01-22 12:59:36 +10:00
Michael Scovetta
73679d0657 Remove extra space before close ticks. (#1699)
This is breaking the layout at http://octokitnet.readthedocs.io/en/latest/http-client/.
2017-10-29 22:07:44 +10:00
Prashant Cholachagudda
2495487608 Fixed code formatting (#1691) 2017-10-23 12:50:09 +10:00
Ryan Gribble
7114bcb41e General updates (#1653)
* Update README and shipping-releases as they are a bit out of date

* Update year/copyright info

* Update cake.frosting to latest for newest dotnet tooling support, and adjust builds for new configuration parameters

* update xunit packages so codelens works for nested test classes (VS2017 15.3 update is also required)

* Fixup VS version and remove win debugging tools
2017-08-16 21:33:03 +10:00
Kristian Hellang
5ee4d64046 Add StringEnum to handle unknown enum values returned from API (#1595)
* Added StringEnum<TEnum>

* Added tests

* Make sure the serializer can work with StringEnum

* Use StringEnum for EventInfo.Event

* Add convention test to assert that all Response models use StringEnum<> to wrap enum properties

* Add Stringnum<> to all response types failing convention test

* Handle StringEnum to Enum conversion when Issue response model populates IssueUpdate request model

* Fix unit test

* Refactor SimpleJsonSerializer to expose the DeserializeEnum strategy so it can be used in StringEnum class

* Need to expose/use SerializeEnum functionality too, so we use the correct string representation of enum values that have custom properties (eg ReactionType Plus1 to "+1")

* fix unit tests, since the string is now the "correct" upstream api value

* Add a couple of tests for the Enum serialize/deserialize when underscores, hyphens and custom property attributes are present

* Compare parsed values for equality

* add convention test to ensure enum members all have Parameter property set

* update test to cover implicit conversions too

* this test should work but fails at the moment due to magic hyphen removal in deserializer causing a one way trip from utf-8 to EncodingType.Utf8 with no way to get back

* (unsuccesfully) expand event info test to try to catch more cases of unknown event types

* fix broken integration test while im here

* Fixed build errors after .NET Core merge

* Value -> StringValue, ParsedValue -> Value

* Don't allow StringValue to be null

* Ignore enums not used in request/response models

* Added ParameterAttribute to almost all enum values

* Ignore Language enum

* Fix failing tests

* Fix milestone sort parameter and tests

* whitespace

* fix milestone unit tests

* Fix StringEnum.Equals ... This could've been embarrassing!

* Change SimpleJsonSerializer Enum handling to only use `[Parameter()]` attributes (no more magic removal of hyphen/underscores from strings)

* Tidy up this integration test while im here

* Only test request/response enums in convention test

* Keep skipping Language

* Remove unused method

* Remove excluded enum types

* Removed unnecessary ParameterAttributes

* Remove unused enum

* Add StringEnum test for string-comparison of two invalid values

* Bring back IssueCommentSort and use it in IssueCommentRequest

This reverts commit 38a4a291d1476ef8c992fe0f76956974b6f32a49.

* Use assembly instead of namespace for Octokit check

* Add failing test to reproduce the issue where only the first enum paramter/value was added to the cache

* Fix deserializer enum cache to include all enum members rather than only the first member encountered

* Use a static SimpleJsonSerializer in StringEnum

* Remove serializer instance in StringEnum

* Add some documentation on StringEnum<TEnum>

* Fix parameter value to resolve failing integration test
2017-06-25 19:29:57 +10:00
Elias Ojala
8877eea1cb Added syntax highlighting to docs/getting-started.md (#1619) 2017-06-25 19:20:22 +10:00
Luke Watson
afb81b7c48 ReleaseUpdate should be NewRelease in create release section 2017-06-07 09:26:24 -04:00
Naoto TAKAHASHI
30e3ec8f61 [doc/issues]fix typo 2017-05-07 15:27:15 +09:00
Ryan Gribble
79dc11d89f Update release code sample to client.Repository.Release 2017-04-02 22:59:40 +10:00
Sean Killeen
3a1070feca Add docs snippet for label coloring (#1530)
* Update label docs to reflect color information

Resolves #790

* Clarify doc language

Because I couldn't just have a one-commit PR. No, that'd be too easy.

* Futher clarification

I guess we might as well make it right.
2017-01-10 07:11:11 +10:00
Sean Killeen
49c2d52030 Add ApiInfo Rate limiting description to Getting Started (#1524)
* Draft section on ApiInfo in getting started

* typo: to --> do

* Add link to github api

* Add note on authenticated client limits

* wording tweak

* Point to better API doc link

* change variable init in code sample
2017-01-01 15:20:10 +10:00
Abdul Rehman Gill
e893895a0b Update git-database.md
"GitDatabase" has been removed. Use "Git" instead.
2016-09-30 13:27:45 +05:00
Brendan Forster
8dcb1db0da just marking up some code 2016-09-29 11:43:22 +10:00
Phil Haack
693cc29dd5 Code to test URL for an enterprise instance. (#1404)
* Code to test URL for an enterprise instance.

Based on code we use in GitHub Desktop for Windows.

* Add an example of the enterprise probe

* Add helpful constructor to EnterpriseProbe

* Suppress code analysis warning
Add xml comments to ctors and make consistent with GitHubClient/Connection etc

* Update getting started to use the new EnterpriseProbe ctor
2016-09-21 15:28:12 +10:00