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

Some Issue Fixing, Add missing Stats values(additions, deletions, total) to CommitResponse, Add .net5 Support #186

Merged
merged 21 commits into from
Feb 28, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Setup dotnet
- name: Setup dotnet 3.1
MypowerHD marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1'
- name: Setup dotnet 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100-rc.2.20479.15'

- run: dotnet tool install -g Codecov.Tool

Expand Down
1 change: 0 additions & 1 deletion src/GitLabApiClient/FilesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Internal.Utilities;
using GitLabApiClient.Models.Files.Responses;
using GitLabApiClient.Models.Projects.Responses;

namespace GitLabApiClient
{
Expand Down
4 changes: 2 additions & 2 deletions src/GitLabApiClient/GitLabApiClient.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net48;netcoreapp3.1;net5.0</TargetFrameworks>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Copyright />
<Description>GitLabApiClient is a .NET rest client for GitLab API v4.</Description>
Expand Down
2 changes: 0 additions & 2 deletions src/GitLabApiClient/GitLabClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
using GitLabApiClient.Internal.Http.Serialization;
using GitLabApiClient.Internal.Queries;
using GitLabApiClient.Internal.Utilities;
using GitLabApiClient.Models.Job.Requests;
using GitLabApiClient.Models.Oauth.Requests;
using GitLabApiClient.Models.Oauth.Responses;
using GitLabApiClient.Models.Pipelines.Requests;

namespace GitLabApiClient
{
Expand Down
2 changes: 0 additions & 2 deletions src/GitLabApiClient/IBranchClient.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitLabApiClient.Internal.Http;
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Internal.Queries;
using GitLabApiClient.Models.Branches.Requests;
using GitLabApiClient.Models.Branches.Responses;
using GitLabApiClient.Models.Projects.Responses;
Expand Down
2 changes: 0 additions & 2 deletions src/GitLabApiClient/ICommitsClient.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitLabApiClient.Internal.Http;
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Internal.Queries;
using GitLabApiClient.Models.Commits.Requests;
using GitLabApiClient.Models.Commits.Responses;
using GitLabApiClient.Models.Projects.Responses;
Expand Down
1 change: 0 additions & 1 deletion src/GitLabApiClient/IGroupsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using GitLabApiClient.Models.Milestones.Requests;
using GitLabApiClient.Models.Milestones.Responses;
using GitLabApiClient.Models.Projects.Responses;
using GitLabApiClient.Models.Runners.Requests;
using GitLabApiClient.Models.Runners.Responses;

namespace GitLabApiClient
Expand Down
3 changes: 0 additions & 3 deletions src/GitLabApiClient/IReleaseClient.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitLabApiClient.Internal.Http;
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Internal.Queries;
using GitLabApiClient.Internal.Utilities;
using GitLabApiClient.Models.Projects.Responses;
using GitLabApiClient.Models.Releases.Requests;
using GitLabApiClient.Models.Releases.Responses;
Expand Down
2 changes: 0 additions & 2 deletions src/GitLabApiClient/ITagClient.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitLabApiClient.Internal.Http;
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Internal.Queries;
using GitLabApiClient.Models.Projects.Responses;
using GitLabApiClient.Models.Tags.Requests;
using GitLabApiClient.Models.Tags.Responses;
Expand Down
2 changes: 0 additions & 2 deletions src/GitLabApiClient/IWebhookClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitLabApiClient.Internal.Http;
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Models.Projects.Responses;
using GitLabApiClient.Models.Webhooks.Requests;
Expand Down
1 change: 0 additions & 1 deletion src/GitLabApiClient/Internal/Http/GitlabApiRequestor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down
4 changes: 0 additions & 4 deletions src/GitLabApiClient/Internal/Queries/CommitQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Internal.Utilities;
using GitLabApiClient.Models.Commits.Requests;
using GitLabApiClient.Models.Tags.Requests;

namespace GitLabApiClient.Internal.Queries
{
Expand Down
3 changes: 0 additions & 3 deletions src/GitLabApiClient/Internal/Queries/ReleaseQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Releases.Requests;

namespace GitLabApiClient.Internal.Queries
Expand Down
4 changes: 0 additions & 4 deletions src/GitLabApiClient/Internal/Queries/ReleasesQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GitLabApiClient.Internal.Queries
{
class ReleasesQueryBuilder
Expand Down
3 changes: 0 additions & 3 deletions src/GitLabApiClient/Internal/Queries/TagQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Tags.Requests;

namespace GitLabApiClient.Internal.Queries
Expand Down
4 changes: 0 additions & 4 deletions src/GitLabApiClient/Internal/Queries/TreeQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Tags.Requests;
using GitLabApiClient.Models.Trees.Requests;

namespace GitLabApiClient.Internal.Queries
Expand Down
2 changes: 0 additions & 2 deletions src/GitLabApiClient/Models/AccessLevel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace GitLabApiClient.Models
{
public enum AccessLevel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GitLabApiClient.Models.Branches.Requests
{
public sealed class BranchQueryOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Internal.Utilities;
using GitLabApiClient.Models.Branches.Responses;
using Newtonsoft.Json;
Expand All @@ -22,9 +19,9 @@ public sealed class ProtectBranchRequest
/// <param name="unprotectAccessLevel">Access levels allowed to unprotect.</param>
public ProtectBranchRequest(
string name,
ProtectedRefAccessLevels? pushAccessLevel = ProtectedRefAccessLevels.MAINTAINER_ACCESS,
ProtectedRefAccessLevels? mergeAccessLevel = ProtectedRefAccessLevels.MAINTAINER_ACCESS,
ProtectedRefAccessLevels? unprotectAccessLevel = ProtectedRefAccessLevels.MAINTAINER_ACCESS)
ProtectedRefAccessLevels? pushAccessLevel = ProtectedRefAccessLevels.MaintainerAccess,
ProtectedRefAccessLevels? mergeAccessLevel = ProtectedRefAccessLevels.MaintainerAccess,
ProtectedRefAccessLevels? unprotectAccessLevel = ProtectedRefAccessLevels.MaintainerAccess)
{
Guard.NotEmpty(name, nameof(name));

Expand Down
3 changes: 0 additions & 3 deletions src/GitLabApiClient/Models/Branches/Responses/Branch.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Releases.Responses;
using Newtonsoft.Json;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Branches.Responses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GitLabApiClient.Models.Branches.Responses
{
public enum ProtectedRefAccessLevels
{
NO_ACCESS = 0,
DEVELOPER_ACCESS = 30,
MAINTAINER_ACCESS = 40,
ADMIN_ACCESS = 60
NoAccess = 0,
DeveloperAccess = 30,
MaintainerAccess = 40,
AdminAccess = 60
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Branches.Responses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GitLabApiClient.Models.Commits.Requests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GitLabApiClient.Models.Commits.Requests
{
public sealed class CommitStatusesQueryOptions
Expand Down
4 changes: 2 additions & 2 deletions src/GitLabApiClient/Models/Commits/Responses/Commit.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Releases.Responses;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Commits.Responses
Expand Down Expand Up @@ -34,6 +32,8 @@ public sealed class Commit
public List<string> ParentIds { get; } = new List<string>();
[JsonProperty("web_url")]
public string WebUrl { get; set; }
[JsonProperty("stats")]
public CommitStats CommitStats { get; set; }

}
}
14 changes: 14 additions & 0 deletions src/GitLabApiClient/Models/Commits/Responses/CommitStats.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Commits.Responses
{
public class CommitStats
{
[JsonProperty("additions")]
public int Additions { get; set; }
[JsonProperty("deletions")]
public int Deletions { get; set; }
[JsonProperty("total")]
public int Total { get; set; }
}
}
13 changes: 5 additions & 8 deletions src/GitLabApiClient/Models/Commits/Responses/CommitStatuses.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Releases.Responses;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Commits.Responses
Expand All @@ -19,17 +16,17 @@ public sealed class CommitStatuses
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("target_url")]
public string Target_url { get; set; }
public string TargetUrl { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("created_at")]
public DateTime Created_at { get; set; }
public DateTime CreatedAt { get; set; }
[JsonProperty("started_at")]
public DateTime Started_at { get; set; }
public DateTime StartedAt { get; set; }
[JsonProperty("finished_at")]
public DateTime Finished_at { get; set; }
public DateTime FinishedAt { get; set; }
[JsonProperty("allow_failure")]
public bool Allow_failure { get; set; }
public bool AllowFailure { get; set; }
[JsonProperty("coverage")]
public float Coverage { get; set; }
[JsonProperty("author")]
Expand Down
4 changes: 0 additions & 4 deletions src/GitLabApiClient/Models/Commits/Responses/Diff.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Releases.Responses;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Commits.Responses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GitLabApiClient.Internal.Paths;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Groups.Requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using GitLabApiClient.Internal.Utilities;
using GitLabApiClient.Models.Milestones.Requests;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Groups.Requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using GitLabApiClient.Internal.Http.Serialization;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

Expand Down
3 changes: 0 additions & 3 deletions src/GitLabApiClient/Models/Issues/Responses/ClosedBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Issues.Responses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

Expand Down
3 changes: 0 additions & 3 deletions src/GitLabApiClient/Models/Markdown/Response/Markdown.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Markdown.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.MergeRequests.Requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using GitLabApiClient.Internal.Http.Serialization;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.MergeRequests.Requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Notes.Requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Notes.Requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using GitLabApiClient.Models.Users.Responses;
using Newtonsoft.Json;

namespace GitLabApiClient.Models.Pipelines.Responses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using GitLabApiClient.Internal.Utilities;
using Newtonsoft.Json;

Expand Down
Loading