mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
* 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)
121 lines
3.9 KiB
PowerShell
121 lines
3.9 KiB
PowerShell
|
|
function SetVariable([string]$key, [string]$value)
|
|
{
|
|
[environment]::SetEnvironmentVariable($key, $value, "User")
|
|
[environment]::SetEnvironmentVariable($key, $value)
|
|
}
|
|
|
|
function AskYesNoQuestion([string]$question, [string]$key)
|
|
{
|
|
$answer = Read-Host -Prompt ($question + " Press Y to set this, otherwise we'll skip it")
|
|
if ($answer -eq "Y")
|
|
{
|
|
SetVariable $key "YES"
|
|
}
|
|
else
|
|
{
|
|
SetVariable $key $null
|
|
}
|
|
|
|
Write-Host
|
|
|
|
return ($answer -eq "Y")
|
|
}
|
|
|
|
function VerifyEnvironmentVariable([string]$friendlyName, [string]$key, [bool]$optional = $false)
|
|
{
|
|
if ($optional -eq $true)
|
|
{
|
|
$label = "(optional)"
|
|
}
|
|
else
|
|
{
|
|
$label = "(required)"
|
|
}
|
|
|
|
$existing_value = [environment]::GetEnvironmentVariable($key,"User")
|
|
if ($existing_value -eq $null)
|
|
{
|
|
$value = Read-Host -Prompt "Set the $friendlyName to use for the integration tests $label"
|
|
SetVariable $key $value
|
|
}
|
|
else
|
|
{
|
|
Write-Host "$existing_value found as the configured $friendlyName"
|
|
if ($optional -eq $true)
|
|
{
|
|
$clear = Read-Host -Prompt 'Want to remove or change this optional value, press Y'
|
|
if ($clear -eq "Y")
|
|
{
|
|
$reset = Read-Host -Prompt "Press R to remove and Press C to change the value, otherwise we'll move on"
|
|
if ($reset -eq "C")
|
|
{
|
|
$value = Read-Host -Prompt "Change the $friendlyName to use for the integration tests"
|
|
SetVariable $key $value
|
|
}
|
|
elseif ($reset -eq "R")
|
|
{
|
|
SetVariable $key $null
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$reset = Read-Host -Prompt "Press Y to change this value, otherwise we'll move on "
|
|
if ($reset -eq "Y")
|
|
{
|
|
$value = Read-Host -Prompt "Change the $friendlyName to use for the integration tests"
|
|
SetVariable $key $value
|
|
}
|
|
}
|
|
}
|
|
|
|
Write-Host
|
|
}
|
|
|
|
Write-Host
|
|
Write-Warning "BIG FREAKING WARNING!!!!!"
|
|
Write-Warning "You should use a test account when running the Octokit integration tests!"
|
|
Write-Host
|
|
Write-Host
|
|
|
|
VerifyEnvironmentVariable "test account name" "OCTOKIT_GITHUBUSERNAME"
|
|
VerifyEnvironmentVariable "test account password" "OCTOKIT_GITHUBPASSWORD" $true
|
|
VerifyEnvironmentVariable "test account OAuth token" "OCTOKIT_OAUTHTOKEN"
|
|
|
|
if (AskYesNoQuestion "Some tests require a second test account, do you want to set one up?" "OCTOKIT_PRIVATEREPOSITORIES")
|
|
{
|
|
VerifyEnvironmentVariable "Second test account name" "OCTOKIT_GITHUBUSERNAME_2"
|
|
VerifyEnvironmentVariable "Second account password" "OCTOKIT_GITHUBPASSWORD_2"
|
|
}
|
|
|
|
AskYesNoQuestion "Do you have private repositories associated with your test account?" "OCTOKIT_PRIVATEREPOSITORIES" | Out-Null
|
|
|
|
VerifyEnvironmentVariable "organization name" "OCTOKIT_GITHUBORGANIZATION" $true
|
|
|
|
VerifyEnvironmentVariable "Override GitHub URL" "OCTOKIT_CUSTOMURL" $true
|
|
|
|
VerifyEnvironmentVariable "application ClientID" "OCTOKIT_CLIENTID" $true
|
|
VerifyEnvironmentVariable "application Secret" "OCTOKIT_CLIENTSECRET" $true
|
|
|
|
if (AskYesNoQuestion "Do you wish to setup GitHubApps integration test settings?" "OCTOKIT_GITHUBAPP_ENABLED")
|
|
{
|
|
VerifyEnvironmentVariable "GitHub App ID" "OCTOKIT_GITHUBAPP_ID"
|
|
VerifyEnvironmentVariable "GitHub App SLUG" "OCTOKIT_GITHUBAPP_SLUG"
|
|
VerifyEnvironmentVariable "GitHub App Installation ID" "OCTOKIT_GITHUBAPP_INSTALLATIONID"
|
|
VerifyEnvironmentVariable "GitHub App Pem File" "OCTOKIT_GITHUBAPP_PEMFILE"
|
|
}
|
|
|
|
if (AskYesNoQuestion "Do you wish to enable GitHub Enterprise (GHE) Integration Tests?" "OCTOKIT_GHE_ENABLED")
|
|
{
|
|
VerifyEnvironmentVariable "GitHub Enterprise account name" "OCTOKIT_GHE_USERNAME"
|
|
VerifyEnvironmentVariable "GitHub Enterprise account password" "OCTOKIT_GHE_PASSWORD" $true
|
|
VerifyEnvironmentVariable "GitHub Enterprise OAuth token" "OCTOKIT_GHE_OAUTHTOKEN"
|
|
|
|
VerifyEnvironmentVariable "GitHub Enterprise organization name" "OCTOKIT_GHE_ORGANIZATION" $true
|
|
|
|
VerifyEnvironmentVariable "GitHub Enterprise URL" "OCTOKIT_GHE_URL" $true
|
|
|
|
VerifyEnvironmentVariable "GitHub Enterprise application ClientID" "OCTOKIT_GHE_CLIENTID" $true
|
|
VerifyEnvironmentVariable "GitHub Enterprise application Secret" "OCTOKIT_GHE_CLIENTSECRET" $true
|
|
} |