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: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ updates:
- dependency-name: "Microsoft.AspNetCore.WebUtilities"
- dependency-name: "Microsoft.Bcl.AsyncInterfaces"
- dependency-name: "System.Text.Json"
# The following should not be bumped until we use .NET 9+, otherwise we'll get
# error CS8032: Could not load file or assembly 'System.Collections.Immutable, Version=9.0.0.0
- dependency-name: "Microsoft.CodeAnalysis.BannedApiAnalyzers"
- dependency-name: "Microsoft.CodeAnalysis.PublicApiAnalyzers"
# LibGit2Sharp 0.31.0+ no longer targets net6.0
- dependency-name: "LibGit2Sharp"
rebase-strategy: auto
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0 # Get all the history so MinGit can compute the version
- name: Set up latest .NET 8.0
- name: Set up latest .NET 10.0
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- run: dotnet pack NGitLab.sln --configuration Release --output ${{env.NuGetDirectory}} /bl
dotnet-version: "10.0.x"
- run: dotnet pack NGitLab.slnx --configuration Release --output ${{env.NuGetDirectory}} /bl
- uses: actions/upload-artifact@v6
with:
name: nuget
Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up latest .NET 8.0
- name: Set up latest .NET 10.0
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
dotnet-version: "10.0.x"
- name: Set artifact name
id: set-artifact-name
run: |
Expand Down Expand Up @@ -111,10 +111,10 @@ jobs:
with:
name: nuget
path: ${{env.NuGetDirectory}}
- name: Set up latest .NET 8.0
- name: Set up latest .NET 10.0
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
dotnet-version: "10.0.x"
- name: Publish NuGet packages
run: |
Write-Host "Current ref: $env:GITHUB_REF"
Expand Down
10 changes: 5 additions & 5 deletions NGitLab.Mock.Tests/GroupsMockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void Test_get_groups_with_top_level_only_ignores_subgroups()
var groups = client.Groups.GetAsync(new Models.GroupQuery { TopLevelOnly = true });

var expected = new string[] { "user1", "tlg" };
Assert.That(groups.Select(g => g.FullPath), Is.EquivalentTo(expected));
Assert.That(groups.AsEnumerable().Select(g => g.FullPath), Is.EquivalentTo(expected));
}

[Test]
Expand Down Expand Up @@ -174,7 +174,7 @@ public void Test_get_subgroups_descendants_by_fullpath()
var group = client.Groups.GetSubgroupsByFullPathAsync("tlg", new Models.SubgroupQuery { IncludeDescendants = true });

var expected = new string[] { "tlg/sg1", "tlg/sg1/sg1_1", "tlg/sg2", "tlg/sg2/sg2_1" };
Assert.That(group.Select(g => g.FullPath), Is.EquivalentTo(expected));
Assert.That(group.AsEnumerable().Select(g => g.FullPath), Is.EquivalentTo(expected));
}

[Test]
Expand All @@ -186,7 +186,7 @@ public void Test_get_subgroups_descendants_by_id()
var group = client.Groups.GetSubgroupsByIdAsync(1, new Models.SubgroupQuery { IncludeDescendants = true });

var expected = new string[] { "tlg/sg1", "tlg/sg1/sg1_1", "tlg/sg2", "tlg/sg2/sg2_1" };
Assert.That(group.Select(g => g.FullPath), Is.EquivalentTo(expected));
Assert.That(group.AsEnumerable().Select(g => g.FullPath), Is.EquivalentTo(expected));
}

[Test]
Expand All @@ -198,7 +198,7 @@ public void Test_get_subgroups_descendants_of_subgroup_by_fullpath()
var group = client.Groups.GetSubgroupsAsync("tlg/sg2", new Models.SubgroupQuery { IncludeDescendants = true });

var expected = new string[] { "tlg/sg2/sg2_1" };
Assert.That(group.Select(g => g.FullPath), Is.EquivalentTo(expected));
Assert.That(group.AsEnumerable().Select(g => g.FullPath), Is.EquivalentTo(expected));
}

[Test]
Expand All @@ -210,7 +210,7 @@ public void Test_get_subgroups_descendants_of_subgroup_by_id()
var group = client.Groups.GetSubgroupsAsync(2, new Models.SubgroupQuery { IncludeDescendants = true });

var expected = new string[] { "tlg/sg1/sg1_1" };
Assert.That(group.Select(g => g.FullPath), Is.EquivalentTo(expected));
Assert.That(group.AsEnumerable().Select(g => g.FullPath), Is.EquivalentTo(expected));
}

[Test]
Expand Down
8 changes: 4 additions & 4 deletions NGitLab.Mock.Tests/MembersMockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ public async Task Test_members_async_methods_simulate_gitlab_behavior()
// Does NOT search inherited permission by default...
AssertThrowsGitLabException(() => client.Members.GetMemberOfProjectAsync(projectId, user1.Id), System.Net.HttpStatusCode.NotFound);
AssertThrowsGitLabException(() => client.Members.GetMemberOfGroupAsync(groupId, user1.Id), System.Net.HttpStatusCode.NotFound);
Assert.That(client.Members.OfProjectAsync(projectId).Select(m => m.UserName), Is.Empty);
Assert.That(client.Members.OfGroupAsync(groupId).Select(m => m.UserName), Is.EquivalentTo([ownerName]));
Assert.That(client.Members.OfProjectAsync(projectId).AsEnumerable().Select(m => m.UserName), Is.Empty);
Assert.That(client.Members.OfGroupAsync(groupId).AsEnumerable().Select(m => m.UserName), Is.EquivalentTo([ownerName]));

// Does search inherited permission when asked...
Assert.That((await client.Members.GetMemberOfProjectAsync(projectId, user1.Id, includeInheritedMembers: true)).UserName, Is.EqualTo(user1Name));
Assert.That((await client.Members.GetMemberOfGroupAsync(groupId, user1.Id, includeInheritedMembers: true)).UserName, Is.EqualTo(user1Name));
Assert.That(client.Members.OfProjectAsync(projectId, includeInheritedMembers: true).Select(m => m.UserName), Is.EquivalentTo([ownerName, user1Name]));
Assert.That(client.Members.OfGroupAsync(groupId, includeInheritedMembers: true).Select(m => m.UserName), Is.EquivalentTo([ownerName, user1Name]));
Assert.That(client.Members.OfProjectAsync(projectId, includeInheritedMembers: true).AsEnumerable().Select(m => m.UserName), Is.EquivalentTo([ownerName, user1Name]));
Assert.That(client.Members.OfGroupAsync(groupId, includeInheritedMembers: true).AsEnumerable().Select(m => m.UserName), Is.EquivalentTo([ownerName, user1Name]));

// Cannot update non-existent membership...
AssertThrowsGitLabException(() => client.Members.UpdateMemberOfProjectAsync(projectId, new() { UserId = user1Id, AccessLevel = Models.AccessLevel.Owner }), System.Net.HttpStatusCode.NotFound);
Expand Down
4 changes: 3 additions & 1 deletion NGitLab.Mock.Tests/NGitLab.Mock.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<!-- Don't promote to errors assessments such as: Package 'System.Net.Http' 4.3.0 has a known high severity vulnerability -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1903</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NGitLab.Mock\NGitLab.Mock.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions NGitLab.Mock.Tests/TagTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void GetTaskAsync_CanSortByName([Values] bool useDefault)
var tags = tagClient.GetAsync(query);

// Assert
Assert.That(tags.Select(t => t.Name), Is.EqualTo(["0.0.1", "0.0.10", "0.0.2", "not-semver"]));
Assert.That(tags.AsEnumerable().Select(t => t.Name), Is.EqualTo(["0.0.1", "0.0.10", "0.0.2", "not-semver"]));
}

[Test]
Expand Down Expand Up @@ -86,6 +86,6 @@ public void GetTagAsync_CanSortByVersion()
var tags = tagClient.GetAsync(query);

// Assert
Assert.That(tags.Select(t => t.Name), Is.EqualTo(["not-semver", "0.0.1", "0.0.2", "0.0.10"]));
Assert.That(tags.AsEnumerable().Select(t => t.Name), Is.EqualTo(["not-semver", "0.0.1", "0.0.2", "0.0.10"]));
}
}
6 changes: 4 additions & 2 deletions NGitLab.Mock/NGitLab.Mock.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net10.0</TargetFrameworks>
<Description>GitLab REST API .NET Client Mock Library</Description>
<!-- Don't promote to errors assessments such as: Package 'System.Net.Http' 4.3.0 has a known high severity vulnerability -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1903</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NGitLab\NGitLab.csproj" />
Expand All @@ -15,4 +17,4 @@
<PackageReference Include="NeoSmart.AsyncLock" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>
</Project>
</Project>
8 changes: 4 additions & 4 deletions NGitLab.Tests/MembersClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ public async Task AsyncMethodsBehaveAsExpected()
// Does NOT search inherited permission by default...
AssertThrowsGitLabException(() => client.Members.GetMemberOfProjectAsync(projectId, user1.Id), System.Net.HttpStatusCode.NotFound);
AssertThrowsGitLabException(() => client.Members.GetMemberOfGroupAsync(groupId, user1.Id), System.Net.HttpStatusCode.NotFound);
Assert.That(client.Members.OfProjectAsync(projectId).Select(m => m.UserName), Is.Empty);
Assert.That(client.Members.OfGroupAsync(groupId).Select(m => m.UserName), Is.EquivalentTo(new[] { ownerName }));
Assert.That(client.Members.OfProjectAsync(projectId).AsEnumerable().Select(m => m.UserName), Is.Empty);
Assert.That(client.Members.OfGroupAsync(groupId).AsEnumerable().Select(m => m.UserName), Is.EquivalentTo(new[] { ownerName }));

// Does search inherited permission when asked...
await client.Members.GetMemberOfProjectAsync(projectId, user1.Id, includeInheritedMembers: true);
await client.Members.GetMemberOfGroupAsync(groupId, user1.Id, includeInheritedMembers: true);
Assert.That(client.Members.OfProjectAsync(projectId, includeInheritedMembers: true).Select(m => m.UserName), Is.EquivalentTo(new[] { ownerName, user1Name }));
Assert.That(client.Members.OfGroupAsync(groupId, includeInheritedMembers: true).Select(m => m.UserName), Is.EquivalentTo(new[] { ownerName, user1Name }));
Assert.That(client.Members.OfProjectAsync(projectId, includeInheritedMembers: true).AsEnumerable().Select(m => m.UserName), Is.EquivalentTo(new[] { ownerName, user1Name }));
Assert.That(client.Members.OfGroupAsync(groupId, includeInheritedMembers: true).AsEnumerable().Select(m => m.UserName), Is.EquivalentTo(new[] { ownerName, user1Name }));

// Cannot update non-existent membership...
AssertThrowsGitLabException(() => client.Members.UpdateMemberOfProjectAsync(projectId, new() { UserId = user1Id, AccessLevel = AccessLevel.Owner }), System.Net.HttpStatusCode.NotFound);
Expand Down
2 changes: 1 addition & 1 deletion NGitLab.Tests/NGitLab.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down
53 changes: 0 additions & 53 deletions NGitLab.sln

This file was deleted.

14 changes: 14 additions & 0 deletions NGitLab.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".github/dependabot.yml" />
<File Path=".github/workflows/ci.yml" />
<File Path="BannedSymbols.txt" />
<File Path="Directory.Build.props" />
<File Path="global.json" />
</Folder>
<Project Path="NGitLab.Mock.Tests/NGitLab.Mock.Tests.csproj" />
<Project Path="NGitLab.Mock/NGitLab.Mock.csproj" />
<Project Path="NGitLab.Tests/NGitLab.Tests.csproj" />
<Project Path="NGitLab/NGitLab.csproj" />
</Solution>
4 changes: 2 additions & 2 deletions NGitLab/NGitLab.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0;net8.0;net10.0</TargetFrameworks>
<!-- Keep "WebRequest is obsolete" as a warning -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);SYSLIB0014</WarningsNotAsErrors>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="PolySharp">
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 1 addition & 0 deletions NGitLab/PublicAPI/net10.0/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading