Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ csharp_style_conditional_delegate_call = true:error
csharp_style_expression_bodied_accessors = true:warning

# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_constructors
csharp_style_expression_bodied_constructors = true:warning
csharp_style_expression_bodied_constructors = true:suggestion

# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_indexers
csharp_style_expression_bodied_indexers = true:error
Expand All @@ -154,7 +154,7 @@ csharp_style_expression_bodied_indexers = true:error
csharp_style_expression_bodied_methods = true

# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_operators
csharp_style_expression_bodied_operators = true:error
csharp_style_expression_bodied_operators = true:suggestion

# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_properties
csharp_style_expression_bodied_properties = true:error
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,20 @@ jobs:
name: Test
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup dotnet 3.1
uses: actions/setup-dotnet@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '3.1'
- name: Setup dotnet 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0'

- run: dotnet tool install -g Codecov.Tool
dotnet-version: '8.0'

- run: dotnet tool install -g GitVersion.Tool

Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ jobs:
runs-on: ubuntu-latest
name: Format
steps:
- uses: actions/checkout@v2

- run: dotnet tool install -g dotnet-format

- name: Add dotnet-format problem matcher
uses: xt0rted/dotnet-format-problem-matcher@v1
- uses: actions/checkout@v4

- name: Run dotnet format
uses: xt0rted/dotnet-format@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
run: |
dotnet format --verify-no-changes
3 changes: 2 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mode: ContinuousDeployment
branches:
master:
tag: beta
regex: ^master$
label: beta
11 changes: 1 addition & 10 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ if ($dockerOSType -ieq 'linux') {
& dotnet test --filter Category!=LinuxIntegration --verbosity normal --settings coverletArgs.runsettings --no-build --no-restore
}

$exitWithError = $LastExitCode -ne 0

$openCoverFile = Get-ChildItem -Path "test/*/coverage.opencover.xml" -Recurse | Sort-Object LastWriteTime | Select-Object -last 1
if (Test-Path "$openCoverFile") {
Write-Host "Uploading coverage file"
& codecov -f "$openCoverFile" -t bda1c835-c4a2-4a1a-8d38-999b9a8ea80b
$exitWithError = $exitWithError -or $LastExitCode -ne 0
}

if ($exitWithError) {
if ($LastExitCode -ne 0) {
exit 1
}
12 changes: 6 additions & 6 deletions test/GitLabApiClient.Test/GroupsClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace GitLabApiClient.Test
public class GroupsClientTest
{
private readonly List<int> _groupIdsToClean = new List<int>();
private List<int> MilestoneIdsToClean { get; } = new List<int>();
private List<long> MilestoneIdsToClean { get; } = new List<long>();
private List<string> VariableIdsToClean { get; } = new List<string>();

private readonly GroupsClient _sut = new GroupsClient(
Expand Down Expand Up @@ -86,7 +86,7 @@ public async Task GroupMilestonesCanBeRetrieved()

//act
var milestones = await _sut.GetMilestonesAsync(TestGroupId);
var milestone = await _sut.GetMilestoneAsync(TestGroupId, createdMilestone.Id);
var milestone = await _sut.GetMilestoneAsync(TestGroupId, (int)createdMilestone.Id);

//assert
milestones.Should().NotBeEmpty();
Expand Down Expand Up @@ -207,7 +207,7 @@ public async Task CreatedGroupMilestoneCanBeUpdated()
MilestoneIdsToClean.Add(createdMilestone.Id);

//act
var updatedMilestone = await _sut.UpdateMilestoneAsync(TestGroupTextId, createdMilestone.Id, new UpdateGroupMilestoneRequest()
var updatedMilestone = await _sut.UpdateMilestoneAsync(TestGroupTextId, (int)createdMilestone.Id, new UpdateGroupMilestoneRequest()
{
Title = "milestone22",
StartDate = "2018-11-05",
Expand Down Expand Up @@ -237,7 +237,7 @@ public async Task CreatedGroupMilestoneCanBeClosed()
MilestoneIdsToClean.Add(createdMilestone.Id);

//act
var updatedMilestone = await _sut.UpdateMilestoneAsync(TestGroupTextId, createdMilestone.Id, new UpdateGroupMilestoneRequest()
var updatedMilestone = await _sut.UpdateMilestoneAsync(TestGroupTextId, (int)createdMilestone.Id, new UpdateGroupMilestoneRequest()
{
State = UpdatedMilestoneState.Close
});
Expand Down Expand Up @@ -353,8 +353,8 @@ public Task DisposeAsync()

private async Task CleanupGroups()
{
foreach (int milestoneId in MilestoneIdsToClean)
await _sut.DeleteMilestoneAsync(TestGroupId, milestoneId);
foreach (long milestoneId in MilestoneIdsToClean)
await _sut.DeleteMilestoneAsync(TestGroupId, (int)milestoneId);

foreach (int groupId in _groupIdsToClean)
await _sut.DeleteAsync(groupId.ToString());
Expand Down
12 changes: 6 additions & 6 deletions test/GitLabApiClient.Test/IssuesClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task CreatedIssueCanBeUpdated()
});

//act
var updatedIssue = await _sut.UpdateAsync(TestProjectTextId, createdIssue.Iid, new UpdateIssueRequest()
var updatedIssue = await _sut.UpdateAsync(TestProjectTextId, (int)createdIssue.Iid, new UpdateIssueRequest()
{
Assignees = new List<int> { 11 },
Confidential = false,
Expand All @@ -63,7 +63,7 @@ public async Task CreatedIssueCanBeClosed()
var createdIssue = await _sut.CreateAsync(TestProjectTextId, new CreateIssueRequest("Title1"));

//act
var updatedIssue = await _sut.UpdateAsync(TestProjectTextId, createdIssue.Iid, new UpdateIssueRequest()
var updatedIssue = await _sut.UpdateAsync(TestProjectTextId, (int)createdIssue.Iid, new UpdateIssueRequest()
{
State = UpdatedIssueState.Close
});
Expand Down Expand Up @@ -104,8 +104,8 @@ public async Task CreatedIssueCanBeRetrieved()
});

//act
var issueById = await _sut.GetAsync(TestProjectId, issue.Iid);
var issueByProjectId = (await _sut.GetAllAsync(options: o => o.IssueIds = new[] { issue.Iid })).FirstOrDefault(i => i.Title == title);
var issueById = await _sut.GetAsync(TestProjectId, (int)issue.Iid);
var issueByProjectId = (await _sut.GetAllAsync(options: o => o.IssueIds = new[] { (int)issue.Iid })).FirstOrDefault(i => i.Title == title);
var ownedIssue = (await _sut.GetAllAsync(options: o => o.Scope = Scope.CreatedByMe)).FirstOrDefault(i => i.Title == title);

//assert
Expand Down Expand Up @@ -136,7 +136,7 @@ public async Task CreatedIssueNoteCanBeRetrieved()
CreatedAt = DateTime.Now
});
var issueNotes = (await _sut.GetNotesAsync(TestProjectId, issue.Iid)).FirstOrDefault(i => i.Body == body);
var issueNote = await _sut.GetNoteAsync(TestProjectId, issue.Iid, note.Id);
var issueNote = await _sut.GetNoteAsync(TestProjectId, (int)issue.Iid, (int)note.Id);

//assert
note.Should().Match<Note>(n =>
Expand All @@ -157,7 +157,7 @@ public async Task CreatedIssueNoteCanBeUpdated()
var createdIssueNote = await _sut.CreateNoteAsync(TestProjectTextId, createdIssue.Iid, new CreateIssueNoteRequest("comment2"));

//act
var updatedIssueNote = await _sut.UpdateNoteAsync(TestProjectTextId, createdIssue.Iid, createdIssueNote.Id, new UpdateIssueNoteRequest("comment22"));
var updatedIssueNote = await _sut.UpdateNoteAsync(TestProjectTextId, (int)createdIssue.Iid, (int)createdIssueNote.Id, new UpdateIssueNoteRequest("comment22"));

//assert
updatedIssueNote.Should().Match<Note>(n =>
Expand Down
4 changes: 2 additions & 2 deletions test/GitLabApiClient.Test/MergeRequestClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public async Task MergeRequestWithoutCommitsCannotBeAccepted()
});

Func<Task<MergeRequest>> acceptAction = () =>
_sut.AcceptAsync(GitLabApiHelper.TestProjectTextId, createdMergeRequest.Iid, new AcceptMergeRequest());
_sut.AcceptAsync(GitLabApiHelper.TestProjectTextId, (int)createdMergeRequest.Iid, new AcceptMergeRequest());

acceptAction.Should().Throw<GitLabException>().
WithMessage("{\"message\":\"405 Method Not Allowed\"}").
Expand Down Expand Up @@ -124,7 +124,7 @@ private async Task DeleteAllMergeRequests()
{
var mergeRequests = await _sut.GetAsync(GitLabApiHelper.TestProjectId);
await Task.WhenAll(mergeRequests.Select(
m => _sut.DeleteAsync(GitLabApiHelper.TestProjectId, m.Iid)));
m => _sut.DeleteAsync(GitLabApiHelper.TestProjectId, (int)m.Iid)));
}
}
}
12 changes: 6 additions & 6 deletions test/GitLabApiClient.Test/ProjectsClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace GitLabApiClient.Test
public class ProjectsClientTest : IAsyncLifetime
{
private List<int> ProjectIdsToClean { get; } = new List<int>();
private List<int> MilestoneIdsToClean { get; } = new List<int>();
private List<long> MilestoneIdsToClean { get; } = new List<long>();
private List<string> VariableIdsToClean { get; } = new List<string>();

private readonly ProjectsClient _sut = new ProjectsClient(
Expand Down Expand Up @@ -76,7 +76,7 @@ public async Task ProjectMilestonesRetrieved()

//act
var milestones = await _sut.GetMilestonesAsync(GitLabApiHelper.TestProjectId);
var milestone = await _sut.GetMilestoneAsync(GitLabApiHelper.TestProjectId, createdMilestone.Id);
var milestone = await _sut.GetMilestoneAsync(GitLabApiHelper.TestProjectId, (int)createdMilestone.Id);

//assert
milestones.Should().NotBeEmpty();
Expand Down Expand Up @@ -286,7 +286,7 @@ public async Task CreatedProjectMilestoneCanBeUpdated()
MilestoneIdsToClean.Add(createdMilestone.Id);

//act
var updatedMilestone = await _sut.UpdateMilestoneAsync(GitLabApiHelper.TestProjectTextId, createdMilestone.Id, new UpdateProjectMilestoneRequest()
var updatedMilestone = await _sut.UpdateMilestoneAsync(GitLabApiHelper.TestProjectTextId, (int)createdMilestone.Id, new UpdateProjectMilestoneRequest()
{
Title = "milestone23",
StartDate = "2018-11-05",
Expand Down Expand Up @@ -353,7 +353,7 @@ public async Task CreatedProjectMilestoneCanBeClosed()
MilestoneIdsToClean.Add(createdMilestone.Id);

//act
var updatedMilestone = await _sut.UpdateMilestoneAsync(GitLabApiHelper.TestProjectTextId, createdMilestone.Id, new UpdateProjectMilestoneRequest()
var updatedMilestone = await _sut.UpdateMilestoneAsync(GitLabApiHelper.TestProjectTextId, (int)createdMilestone.Id, new UpdateProjectMilestoneRequest()
{
State = UpdatedMilestoneState.Close
});
Expand Down Expand Up @@ -411,8 +411,8 @@ public async Task ExportImportProject()
private async Task CleanupProjects()
{

foreach (int milestoneId in MilestoneIdsToClean)
await _sut.DeleteMilestoneAsync(GitLabApiHelper.TestProjectId, milestoneId);
foreach (long milestoneId in MilestoneIdsToClean)
await _sut.DeleteMilestoneAsync(GitLabApiHelper.TestProjectId, (int)milestoneId);

foreach (int projectId in ProjectIdsToClean)
await _sut.DeleteAsync(projectId);
Expand Down
2 changes: 1 addition & 1 deletion test/GitLabApiClient.Test/ToDoListClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private async Task DeleteAllMergeRequests()
{
var mergeRequests = await mergeRequestsClient.GetAsync(GitLabApiHelper.TestProjectId);
await Task.WhenAll(mergeRequests.Select(
m => mergeRequestsClient.DeleteAsync(GitLabApiHelper.TestProjectId, m.Iid)));
m => mergeRequestsClient.DeleteAsync(GitLabApiHelper.TestProjectId, (int)m.Iid)));
}
}
}
Loading