Skip to content

Commit 411b1bd

Browse files
authored
Merge pull request #67 from contentstack/staging
DX | 24-02-2025 | Release
2 parents 061c832 + 370c57a commit 411b1bd

15 files changed

Lines changed: 135 additions & 54 deletions

File tree

.github/workflows/check-branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Comment PR
11-
if: github.base_ref == 'main' && github.head_ref != 'next'
11+
if: github.base_ref == 'main' && github.head_ref != 'staging'
1212
uses: thollander/actions-comment-pull-request@v2
1313
with:
1414
message: |
1515
We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch.
1616
- name: Check branch
17-
if: github.base_ref == 'main' && github.head_ref != 'next'
17+
if: github.base_ref == 'main' && github.head_ref != 'staging'
1818
run: |
1919
echo "ERROR: We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch."
2020
exit 1

.github/workflows/nuget-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: windows-latest
1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v1
13+
uses: actions/checkout@v4.2.2
1414
- name: Setup .NET Core @ Latest
15-
uses: actions/setup-dotnet@v3
15+
uses: actions/setup-dotnet@v4.3.0
1616
env:
1717
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
1818
- name: Build solution and generate NuGet package
@@ -28,9 +28,9 @@ jobs:
2828
runs-on: windows-latest
2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@v1
31+
uses: actions/checkout@v4.2.2
3232
- name: Setup .NET Core @ Latest
33-
uses: actions/setup-dotnet@v3
33+
uses: actions/setup-dotnet@v4.3.0
3434
with:
3535
source-url: https://nuget.pkg.github.com/Contentstack/index.json
3636
env:

.github/workflows/sast-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ jobs:
66
security-sast:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4.2.2
1010
- name: Semgrep Scan
1111
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:/src" returntocorp/semgrep semgrep scan --config auto

.github/workflows/sca-scan.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ jobs:
66
security-sca:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@master
9+
- name: Checkout repository
10+
uses: actions/checkout@master
11+
- name: Run Dotnet Restore
12+
run: |
13+
dotnet restore
1014
- name: Run Snyk to check for vulnerabilities
1115
uses: snyk/actions/dotnet@master
1216
env:
1317
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
1418
with:
15-
args: --fail-on=all
19+
args: --file=Contentstack.Management.Core/obj/project.assets.json --fail-on=all

.github/workflows/unit-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
runs-on: windows-latest
99
steps:
1010
- name: Checkout repository
11-
uses: actions/checkout@v1
11+
uses: actions/checkout@v4.2.2
1212
- name: Setup .NET Core @ Latest
13-
uses: actions/setup-dotnet@v1
13+
uses: actions/setup-dotnet@v4.3.0
1414
- name: Build solution and run unit test
1515
run: sh ./Scripts/run-unit-test-case.sh
1616
- name: Test Report

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [v0.1.11](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.11)
4+
- Feat
5+
- Add support for custom Http client and IHttpClientFactory
6+
37
## [v0.1.10](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.10)
48
- Feat
59
- Add support for apiVersion in bulk publish unpublish methods

Contentstack.Management.ASPNETCore/ServiceCollectionExtensions.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-

2-
using System.Collections.Generic;
3-
using System.Text;
4-
using Microsoft.Extensions.DependencyInjection;
5-
using Microsoft.Extensions.DependencyInjection.Extensions;
6-
using Microsoft.Extensions.Configuration;
7-
using Contentstack.Management.Core;
1+
using Contentstack.Management.Core;
82
using System.Net.Http;
3+
using System;
4+
95
namespace Microsoft.Extensions.DependencyInjection
106
{
117
public static class ServiceCollectionExtensions
@@ -17,7 +13,7 @@ public static class ServiceCollectionExtensions
1713
/// <param name="services">The IServiceCollection.</param>
1814
/// <param name="configuration">The ContentstackClientOptions used to retrieve configuration from.</param>
1915
/// <returns>The IServiceCollection.</returns>
20-
public static IServiceCollection AddContentstackClien(this IServiceCollection services, ContentstackClientOptions configuration)
16+
public static IServiceCollection AddContentstackClient(this IServiceCollection services, ContentstackClientOptions configuration)
2117
{
2218

2319
return services;
@@ -34,5 +30,12 @@ public static IServiceCollection TryAddContentstackClient(this IServiceCollectio
3430

3531
return services;
3632
}
33+
34+
public static IServiceCollection AddContentstackClient(this IServiceCollection services, Action<HttpClient> configureClient)
35+
{
36+
services.AddHttpClient<ContentstackClient>(configureClient);
37+
38+
return services;
39+
}
3740
}
3841
}

Contentstack.Management.ASPNETCore/contentstack.management.aspnetcore.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Description>.NET SDK for the Contentstack Content Management API.</Description>
1616
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1717
<PackageTags>v$(Version)</PackageTags>
18-
<ReleaseVersion>$(Version)</ReleaseVersion>
18+
<ReleaseVersion>0.1.3</ReleaseVersion>
1919
<RootNamespace>Contentstack.Management.ASPNETCore</RootNamespace>
2020
</PropertyGroup>
2121

@@ -26,8 +26,9 @@
2626
<None Include="LICENSE.txt" Pack="true" PackagePath="LICENSE.txt" />
2727
</ItemGroup>
2828
<ItemGroup>
29-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
30-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
31-
<PackageReference Include="contentstack.management.csharp" Version="0.1.8" />
29+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.2" />
30+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.2" />
31+
<PackageReference Include="contentstack.management.csharp" Version="0.1.10" />
32+
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.2" />
3233
</ItemGroup>
3334
</Project>

Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>0.1.10</ReleaseVersion>
7+
<ReleaseVersion>$(Version)</ReleaseVersion>
88

99
<SignAssembly>true</SignAssembly>
1010
<AssemblyOriginatorKeyFile>../CSManagementSDK.snk</AssemblyOriginatorKeyFile>
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
15-
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
16-
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
17-
<PackageReference Include="coverlet.collector" Version="3.2.0"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
15+
<PackageReference Include="MSTest.TestAdapter" Version="3.8.2" />
16+
<PackageReference Include="MSTest.TestFramework" Version="3.8.2" />
17+
<PackageReference Include="coverlet.collector" Version="6.0.4"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
<PrivateAssets>all</PrivateAssets>
1919
</PackageReference>
20-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
21-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
22-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.3" />
23-
<PackageReference Include="AutoFixture" Version="4.18.0" />
24-
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.0" />
25-
<PackageReference Include="Moq" Version="4.18.4" />
26-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
20+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.2" />
21+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.2" />
22+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.2" />
23+
<PackageReference Include="AutoFixture" Version="4.18.1" />
24+
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
25+
<PackageReference Include="Moq" Version="4.20.72" />
26+
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>$(Version)</ReleaseVersion>
7+
<ReleaseVersion>0.1.3</ReleaseVersion>
88
<SignAssembly>true</SignAssembly>
99
<AssemblyOriginatorKeyFile>../CSManagementSDK.snk</AssemblyOriginatorKeyFile>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
14-
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
15-
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
16-
<PackageReference Include="coverlet.collector" Version="3.2.0"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
14+
<PackageReference Include="MSTest.TestAdapter" Version="3.8.2" />
15+
<PackageReference Include="MSTest.TestFramework" Version="3.8.2" />
16+
<PackageReference Include="coverlet.collector" Version="6.0.4"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
<PrivateAssets>all</PrivateAssets>
1818
</PackageReference>
19-
<PackageReference Include="AutoFixture" Version="4.18.0" />
20-
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.0" />
21-
<PackageReference Include="Moq" Version="4.18.4" />
22-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
19+
<PackageReference Include="AutoFixture" Version="4.18.1" />
20+
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
21+
<PackageReference Include="Moq" Version="4.20.72" />
22+
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

0 commit comments

Comments
 (0)