Skip to content

Commit

Permalink
Enable pagination convention tests (#1659)
Browse files Browse the repository at this point in the history
* Unskip pagination convention tests and rework exclusion property names
Also exclude Obsolete methods from pagination convention tests

* Reaction APIs appear to support pagination, flag to exclude for now and mark a TODO that they need implementing

* Repository invitation APIs need pagination implemented

* Exclude methods that use an alternative pagination approach

* Migrations, Licenses and References all need pagination implemented

* Pagination not supported for these methods (determined by API doc and poking the API) so exclude them from convention tests

* These methods need renaming to GetAll

* Rename offending RepositoryTrafficClient GetReferrers and GetPaths to GetAllReferrers and GetAllPaths

* Rename offending RepositoryBranchesClient methods from Get to GetAll
  • Loading branch information
ryangribble authored Sep 3, 2017
1 parent f96d75f commit 1e474f8
Show file tree
Hide file tree
Showing 30 changed files with 700 additions and 164 deletions.
69 changes: 69 additions & 0 deletions Octokit.Reactive/Clients/IObservableRepositoryBranchesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public interface IObservableRepositoryBranchesClient
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
IObservable<string> GetRequiredStatusChecksContexts(string owner, string name, string branch);

/// <summary>
Expand All @@ -224,8 +225,30 @@ public interface IObservableRepositoryBranchesClient
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
IObservable<string> GetRequiredStatusChecksContexts(long repositoryId, string branch);

/// <summary>
/// Get the required status checks contexts for the specified branch
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<string> GetAllRequiredStatusChecksContexts(string owner, string name, string branch);

/// <summary>
/// Get the required status checks contexts for the specified branch
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<string> GetAllRequiredStatusChecksContexts(long repositoryId, string branch);

/// <summary>
/// Replace the required status checks contexts for the specified branch
/// </summary>
Expand Down Expand Up @@ -472,6 +495,7 @@ public interface IObservableRepositoryBranchesClient
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
IObservable<Team> GetProtectedBranchTeamRestrictions(string owner, string name, string branch);

/// <summary>
Expand All @@ -482,8 +506,30 @@ public interface IObservableRepositoryBranchesClient
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
IObservable<Team> GetProtectedBranchTeamRestrictions(long repositoryId, string branch);

/// <summary>
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<Team> GetAllProtectedBranchTeamRestrictions(string owner, string name, string branch);

/// <summary>
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<Team> GetAllProtectedBranchTeamRestrictions(long repositoryId, string branch);

/// <summary>
/// Replace team restrictions for the specified branch (applies only to Organization owned repositories)
/// </summary>
Expand Down Expand Up @@ -562,6 +608,7 @@ public interface IObservableRepositoryBranchesClient
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
IObservable<User> GetProtectedBranchUserRestrictions(string owner, string name, string branch);

/// <summary>
Expand All @@ -572,8 +619,30 @@ public interface IObservableRepositoryBranchesClient
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
IObservable<User> GetProtectedBranchUserRestrictions(long repositoryId, string branch);

/// <summary>
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<User> GetAllProtectedBranchUserRestrictions(string owner, string name, string branch);

/// <summary>
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<User> GetAllProtectedBranchUserRestrictions(long repositoryId, string branch);

/// <summary>
/// Replace user restrictions for the specified branch (applies only to Organization owned repositories)
/// </summary>
Expand Down
34 changes: 34 additions & 0 deletions Octokit.Reactive/Clients/IObservableRepositoryTrafficClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,64 @@ public interface IObservableRepositoryTrafficClient
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
[Obsolete("Please use GetAllReferrers instead")]
IObservable<RepositoryTrafficReferrer> GetReferrers(string owner, string name);

/// <summary>
/// List the top 10 referrers over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
/// <param name="repositoryId">The owner of the repository</param>
[Obsolete("Please use GetAllReferrers instead")]
IObservable<RepositoryTrafficReferrer> GetReferrers(long repositoryId);

/// <summary>
/// List the top 10 referrers over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
IObservable<RepositoryTrafficReferrer> GetAllReferrers(string owner, string name);

/// <summary>
/// List the top 10 referrers over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
/// <param name="repositoryId">The owner of the repository</param>
IObservable<RepositoryTrafficReferrer> GetAllReferrers(long repositoryId);

/// <summary>
/// List the top 10 popular contents over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
[Obsolete("Please use GetAllPaths instead")]
IObservable<RepositoryTrafficPath> GetPaths(string owner, string name);

/// <summary>
/// List the top 10 popular contents over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
/// <param name="repositoryId">The owner of the repository</param>
[Obsolete("Please use GetAllPaths instead")]
IObservable<RepositoryTrafficPath> GetPaths(long repositoryId);

/// <summary>
/// List the top 10 popular contents over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
IObservable<RepositoryTrafficPath> GetAllPaths(string owner, string name);

/// <summary>
/// List the top 10 popular contents over the last 14 days
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
/// <param name="repositoryId">The owner of the repository</param>
IObservable<RepositoryTrafficPath> GetAllPaths(long repositoryId);

/// <summary>
/// Get the total number of views and breakdown per day or week for the last 14 days
/// </summary>
Expand Down
Loading

0 comments on commit 1e474f8

Please sign in to comment.