Skip to content
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

Implement Check Suites API #1846

Merged
merged 84 commits into from
Jul 14, 2018
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
ae43fc7
Check run request models
Cyberboss May 7, 2018
8ab8d63
Check Run response models
Cyberboss May 7, 2018
a473b24
Check run clients
Cyberboss May 7, 2018
561d086
Check run ApiUrls and AcceptHeaders
Cyberboss May 7, 2018
c7704b0
Pack it all together for now
Cyberboss May 7, 2018
319444d
Add missing accept headers to connection calls
Cyberboss May 8, 2018
c17c997
Standardize class definitions
Cyberboss May 8, 2018
e1512f1
Merge upstream/master into CheckRuns
Cyberboss May 8, 2018
ef25014
Standardize function names
Cyberboss May 8, 2018
5530d72
Merge ICheckRunAnnotationsClient into ICheckRunsClient
Cyberboss May 8, 2018
ea9d629
Properly organize clients
Cyberboss May 8, 2018
2960e5e
Cleanup CheckRun response model
Cyberboss May 8, 2018
92333d3
Fix slug check run urls
Cyberboss May 8, 2018
f6eeee0
Add checks installation permission
Cyberboss May 8, 2018
97b24de
Use StringEnums where appropriate
Cyberboss May 8, 2018
cfa63a8
Cleanup check run output models
Cyberboss May 8, 2018
70d84bf
Flesh out CheckSuite model
Cyberboss May 8, 2018
21cf835
Delete CheckRunsList
Cyberboss May 8, 2018
f39a637
Remove a sealed, fix some line endings
Cyberboss May 8, 2018
0cac015
Adding check suite models
Cyberboss May 8, 2018
6688ece
Skeleton check suite client implementation
Cyberboss May 8, 2018
5b40de8
Add check suite ApiUrls
Cyberboss May 8, 2018
f5683fa
Flesh out check suites client
Cyberboss May 8, 2018
3534c64
Add parameterless CheckRun constructor
Cyberboss May 8, 2018
bd9ceb8
Add DebuggerDisplay to checks models
Cyberboss May 8, 2018
e186550
Add observable checks interfaces
Cyberboss May 8, 2018
8a6a59f
Add return values to POST and PATCH check clients
Cyberboss May 8, 2018
e58fee9
Fix some check suite client return values
Cyberboss May 8, 2018
b71a376
Skeleton reactive checks implementation
Cyberboss May 9, 2018
b75dced
Implement observable checks clients
Cyberboss May 9, 2018
86c19a5
Remove rogue tabs
Cyberboss May 9, 2018
1002e4a
Add CheckSuiteEventPayload
Cyberboss May 9, 2018
6176d06
Add CheckRunEventPayload
Cyberboss May 9, 2018
03505c9
Add DebuggerDisplay attributes to checks API payloads
Cyberboss May 9, 2018
7d9f6e7
Properly nullables check suite/run conclusion
Cyberboss May 11, 2018
afb682b
Add CheckSuiteEventTests
Cyberboss May 11, 2018
b90d056
Fix checks client accessor naming issues
Cyberboss May 11, 2018
febec72
Add missing Text field to CheckRunOutput
Cyberboss May 11, 2018
0295807
Marks CheckRunUpdate's conclusion as nullable
Cyberboss May 11, 2018
9a37903
Fix reactive checks client naming
Cyberboss May 11, 2018
57d8848
Today I learned DateTimeOffset is a struct
Cyberboss May 14, 2018
a489ee4
Modify check clients to put slug version before repo id version
Cyberboss May 14, 2018
42720f8
Add nullable to CheckRun.CompletedAt
Cyberboss May 14, 2018
199489c
Implement parameterless ICheckRunsClient.GetAllForReference and GetAl…
Cyberboss May 15, 2018
594cfba
Add missing RequestParameters base to CheckSuiteRequest
Cyberboss May 15, 2018
a1d3c7a
Implement checks API GetAll methods
Cyberboss May 15, 2018
b3c1b56
Bring parity to Reactive checks clients
Cyberboss May 15, 2018
4390468
fix project settings to get GitHubApp helper working again
ryangribble May 28, 2018
2cbc605
remove un-needed InstallationId setting - provide helper method to fi…
ryangribble May 28, 2018
ceee35e
fix up request object ctors based on required/optional parameters
ryangribble May 28, 2018
1f22ffe
fix up request object ctors based on required/optional parameters
ryangribble May 28, 2018
36973a3
add some initial integration tests for CheckSuites and CheckRuns incl…
ryangribble May 28, 2018
68c291c
Add test for Request CheckSuite
ryangribble May 28, 2018
c861eec
simplify Get CheckSuite test to not require as much data setup
ryangribble May 28, 2018
7430553
Add test for CheckSuite GetAllForReference
ryangribble May 28, 2018
d242c3a
Add test for CheckSuite UpdatePreferences
ryangribble May 28, 2018
64f8ac8
rename response models
ryangribble Jun 30, 2018
0a6176e
rename CheckSuitesList to CheckSuitesResponse and use as response to …
ryangribble Jul 2, 2018
8aeb805
Fix tests
ryangribble Jul 2, 2018
4321431
Fix observable
ryangribble Jul 2, 2018
f28b770
fix model convention tests
ryangribble Jul 2, 2018
368ad79
remove CheckRuns so we can focus only on CheckSuites for now
ryangribble Jul 2, 2018
0a98187
naming things is hard
ryangribble Jul 2, 2018
aadf84c
oh so many unit tests for CheckSuites methods
ryangribble Jul 5, 2018
bb4bf66
make client mockable
ryangribble Jul 5, 2018
95ce0c1
Fix issue with .Max() when no results returned
ryangribble Jul 5, 2018
47482b6
fix request parameter names
ryangribble Jul 5, 2018
c538f47
add Xml doc comments
ryangribble Jul 7, 2018
02d6ebe
Add XmlDoc comments to request/common model objects
ryangribble Jul 7, 2018
2a2929c
rename class to match usage
ryangribble Jul 7, 2018
c389a16
Merge remote-tracking branch 'origin/master' into check-suites
ryangribble Jul 7, 2018
a7a743e
tidy ups
ryangribble Jul 8, 2018
7e003d9
xmldoc for observable clients
ryangribble Jul 8, 2018
da3f944
fix method order
ryangribble Jul 10, 2018
56062d2
add observable unit tests and get them passing
ryangribble Jul 10, 2018
b1d3796
Add Observable unit tests and get them passing
ryangribble Jul 10, 2018
18b68bf
add observable integration tests
ryangribble Jul 10, 2018
6b2603a
tidy up ApiUrl method name
ryangribble Jul 10, 2018
87b5b43
whitespace/using tidy ups
ryangribble Jul 10, 2018
21e95a1
Ensure CheckSuiteEventPayload class is handled in deserializer and ad…
ryangribble Jul 10, 2018
145c329
add response model XmlDoc comments
ryangribble Jul 10, 2018
dadc3ce
missed one xmldoc
ryangribble Jul 11, 2018
d36e201
add xmldoc to NewCheckSuite request and remove HeadBranch property as…
ryangribble Jul 11, 2018
bdb1c23
add some extra check suites integration tests
ryangribble Jul 13, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions Octokit.Reactive/Clients/IObservableCheckSuitesClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
using System;

namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Check Suites API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/">Check Suites API documentation</a> for more information.
/// </remarks>
public interface IObservableCheckSuitesClient
{
/// <summary>
/// Gets a single Check Suite by Id
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#get-a-single-check-suite">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
IObservable<CheckSuite> Get(string owner, string name, long checkSuiteId);

/// <summary>
/// Gets a single Check Suite by Id
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#get-a-single-check-suite">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
IObservable<CheckSuite> Get(long repositoryId, long checkSuiteId);

/// <summary>
/// Lists Check Suites for a commit reference (SHA, branch name or tag name)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name or tag name) to list check suites for</param>
IObservable<CheckSuitesResponse> GetAllForReference(string owner, string name, string reference);

/// <summary>
/// Lists Check Suites for a commit reference (SHA, branch name or tag name)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The reference (SHA, branch name or tag name) to list check suites for</param>
IObservable<CheckSuitesResponse> GetAllForReference(long repositoryId, string reference);

/// <summary>
/// Lists Check Suites for a commit reference (SHA, branch name or tag name)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name or tag name) to list check suites for</param>
/// <param name="request">Details to filter the request, such as by App Id or Check Name</param>
IObservable<CheckSuitesResponse> GetAllForReference(string owner, string name, string reference, CheckSuiteRequest request);

/// <summary>
/// Lists Check Suites for a commit reference (SHA, branch name or tag name)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The reference (SHA, branch name or tag name) to list check suites for</param>
/// <param name="request">Details to filter the request, such as by App Id or Check Name</param>
IObservable<CheckSuitesResponse> GetAllForReference(long repositoryId, string reference, CheckSuiteRequest request);

/// <summary>
/// Lists Check Suites for a commit reference (SHA, branch name or tag name)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name or tag name) to list check suites for</param>
/// <param name="request">Details to filter the request, such as by App Id or Check Name</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckSuitesResponse> GetAllForReference(string owner, string name, string reference, CheckSuiteRequest request, ApiOptions options);

/// <summary>
/// Lists Check Suites for a commit reference (SHA, branch name or tag name)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The reference (SHA, branch name or tag name) to list check suites for</param>
/// <param name="request">Details to filter the request, such as by App Id or Check Name</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckSuitesResponse> GetAllForReference(long repositoryId, string reference, CheckSuiteRequest request, ApiOptions options);

/// <summary>
/// Updates Check Suites prefrences on a repository, such as disabling automatic creation when code is pushed
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#set-preferences-for-check-suites-on-a-repository">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="preferences">The check suite preferences</param>
IObservable<CheckSuitePreferencesResponse> UpdatePreferences(string owner, string name, CheckSuitePreferences preferences);

/// <summary>
/// Updates Check Suites prefrences on a repository, such as disabling automatic creation when code is pushed
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#set-preferences-for-check-suites-on-a-repository">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="preferences">The check suite preferences</param>
IObservable<CheckSuitePreferencesResponse> UpdatePreferences(long repositoryId, CheckSuitePreferences preferences);

/// <summary>
/// Creates a new Check Suite
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#create-a-check-suite">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="newCheckSuite">Details of the Check Suite to create</param>
IObservable<CheckSuite> Create(string owner, string name, NewCheckSuite newCheckSuite);

/// <summary>
/// Creates a new Check Suite
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#create-a-check-suite">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="newCheckSuite">Details of the Check Suite to create</param>
IObservable<CheckSuite> Create(long repositoryId, NewCheckSuite newCheckSuite);

/// <summary>
/// Triggers GitHub to create a new check suite, without pushing new code to a repository
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#request-check-suites">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="request">Details of the Check Suite request</param>
IObservable<bool> Request(string owner, string name, CheckSuiteTriggerRequest request);

/// <summary>
/// Triggers GitHub to create a new check suite, without pushing new code to a repository
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/#request-check-suites">Check Suites API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="request">Details of the Check Suite request</param>
IObservable<bool> Request(long repositoryId, CheckSuiteTriggerRequest request);
}
}
19 changes: 19 additions & 0 deletions Octokit.Reactive/Clients/IObservableChecksClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Checks API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/">Checks API documentation</a> for more information.
/// </remarks>
public interface IObservableChecksClient
{
/// <summary>
/// A client for GitHub's Check Suites API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/suites/">Check Suites API documentation</a> for more information.
/// </remarks>
IObservableCheckSuitesClient Suite { get; }
}
}
Loading