Skip to content

Commit af9a7dd

Browse files
committed
feat: migrate Locale and Bulk Operations to STJ, upgrade to .NET 10, update CHANGELOG
- Migrated Locale and Bulk Operations modules from Newtonsoft.Json to System.Text.Json - Re-enabled Stack.Locale() and Stack.BulkOperation() methods - Migrated all Bulk Operation services (Publish, Unpublish, Delete, AddItems, UpdateItems, ReleaseItems, WorkflowUpdate) to STJ - Migrated LocaleModel and BulkOperationModels to use System.Text.Json attributes - Commented out Release and Workflow setup in Bulk Operations (pending Release/Workflow STJ migration) - Upgraded target framework to .NET 10 and resolved all build warnings - Updated CHANGELOG.md for v1.0.0-beta.1
1 parent 7a5c1cd commit af9a7dd

127 files changed

Lines changed: 1277 additions & 1685 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@
1919
- Reduced Newtonsoft.Json dependency while maintaining backward compatibility for non-migrated functionality
2020
- Added comprehensive STJ migration testing and validation infrastructure
2121
- Added/updated unit and integration test coverage for all migrated modules including Client, User, Organization, Stack, ContentType, Assets, Environment, Global Field, Entry, Entry Variant, and Variant Group
22-
- **Note**: This is a beta release and APIs/modules may continue evolving during migration stabilization
22+
- Migrated Locale and Bulk Operations modules to System.Text.Json
23+
- Re-enabled `Stack.Locale()` and `Stack.BulkOperation()` methods
24+
- Migrated all Bulk Operation services (Publish, Unpublish, Delete, AddItems, UpdateItems, ReleaseItems, WorkflowUpdate) to STJ
25+
- Migrated `LocaleModel` and `BulkOperationModels` to use `System.Text.Json` attributes
26+
- Added/updated unit and integration test coverage for Locale and Bulk Operations
27+
- Upgraded target framework to .NET 10 and removed all build warnings
28+
- **Note**:
29+
- This is a beta release and APIs/modules may continue evolving during migration stabilization
30+
- Release and Workflow setup within Bulk Operations module are currently commented out and will be uncommented once the Release and Workflow modules are migrated to System.Text.Json
2331

2432
## [v0.10.0](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.9.0)
2533
- Feat

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
2525
<PackageReference Include="Moq" Version="4.20.72" />
2626
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
27-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
2827
</ItemGroup>
2928

3029
<ItemGroup>
@@ -54,10 +53,11 @@
5453

5554
<ItemGroup>
5655
<!-- Exclude out-of-scope integration tests (still use Newtonsoft or depend on excluded SDK types) -->
56+
<!-- Contentstack015 depends on Stack.Workflow() and Stack.Release() which are not yet migrated -->
57+
<!-- <Compile Remove="IntegrationTest\Contentstack015_BulkOperationTest.cs" /> -->
5758
<Compile Remove="IntegrationTest\Contentstack004_ReleaseTest.cs" />
5859
<Compile Remove="IntegrationTest\Contentstack012b_ContentTypeExpandedIntegrationTest.cs" />
5960

60-
<Compile Remove="IntegrationTest\Contentstack015_BulkOperationTest.cs" />
6161
<Compile Remove="IntegrationTest\Contentstack016_DeliveryTokenTest.cs" />
6262
<Compile Remove="IntegrationTest\Contentstack017_TaxonomyTest.cs" />
6363
<Compile Remove="IntegrationTest\Contentstack019_RoleTest.cs" />

Contentstack.Management.Core.Tests/IntegrationTest/Contentstack001_LoginTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ public void Test088_Should_Handle_TOTP_Token_Format_Variations_Sync()
15141514
{
15151515
client.Login(credentials, token);
15161516
}
1517-
catch (ArgumentException ex) when (token.Length != 6 || token.Any(c => !char.IsDigit(c)))
1517+
catch (ArgumentException) when (token.Length != 6 || token.Any(c => !char.IsDigit(c)))
15181518
{
15191519
AssertLogger.IsTrue(true, $"ArgumentException for invalid token format: '{token}'");
15201520
}

Contentstack.Management.Core.Tests/IntegrationTest/Contentstack003_StackTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ public void Test055_Should_Fail_UpdateUserRole_Empty_List_API()
983983
{
984984
AssertStackValidationError(ex, "Stack_UpdateUserRole_Empty");
985985
}
986-
catch (ArgumentException ex)
986+
catch (ArgumentException)
987987
{
988988
AssertLogger.IsTrue(true, "SDK or API rejected empty list", "Stack_UpdateUserRole_Empty_Argument");
989989
}

Contentstack.Management.Core.Tests/IntegrationTest/Contentstack013_AssetTest.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public async Task Test006_Should_Fetch_Asset()
476476
{
477477
if (string.IsNullOrEmpty(_testAssetUid))
478478
{
479-
Test005_Should_Create_Asset_Async();
479+
await Test005_Should_Create_Asset_Async();
480480
}
481481

482482
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -511,7 +511,7 @@ public async Task Test007_Should_Fetch_Asset_Async()
511511
{
512512
if (string.IsNullOrEmpty(_testAssetUid))
513513
{
514-
Test005_Should_Create_Asset_Async();
514+
await Test005_Should_Create_Asset_Async();
515515
}
516516

517517
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -546,7 +546,7 @@ public async Task Test008_Should_Update_Asset()
546546
{
547547
if (string.IsNullOrEmpty(_testAssetUid))
548548
{
549-
Test005_Should_Create_Asset_Async();
549+
await Test005_Should_Create_Asset_Async();
550550
}
551551

552552
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -584,7 +584,7 @@ public async Task Test009_Should_Update_Asset_Async()
584584
{
585585
if (string.IsNullOrEmpty(_testAssetUid))
586586
{
587-
Test005_Should_Create_Asset_Async();
587+
await Test005_Should_Create_Asset_Async();
588588
}
589589

590590
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -680,7 +680,7 @@ public async Task Test012_Should_Delete_Asset()
680680
{
681681
if (string.IsNullOrEmpty(_testAssetUid))
682682
{
683-
Test005_Should_Create_Asset_Async();
683+
await Test005_Should_Create_Asset_Async();
684684
}
685685

686686
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -791,7 +791,7 @@ public async Task Test015_Should_Create_Subfolder()
791791
{
792792
if (string.IsNullOrEmpty(_testFolderUid))
793793
{
794-
Test014_Should_Create_Folder();
794+
await Test014_Should_Create_Folder();
795795
}
796796

797797
if (!string.IsNullOrEmpty(_testFolderUid))
@@ -826,7 +826,7 @@ public async Task Test016_Should_Fetch_Folder()
826826
{
827827
if (string.IsNullOrEmpty(_testFolderUid))
828828
{
829-
Test014_Should_Create_Folder();
829+
await Test014_Should_Create_Folder();
830830
}
831831

832832
if (!string.IsNullOrEmpty(_testFolderUid))
@@ -861,7 +861,7 @@ public async Task Test017_Should_Fetch_Folder_Async()
861861
{
862862
if (string.IsNullOrEmpty(_testFolderUid))
863863
{
864-
Test014_Should_Create_Folder();
864+
await Test014_Should_Create_Folder();
865865
}
866866

867867
if (!string.IsNullOrEmpty(_testFolderUid))
@@ -896,7 +896,7 @@ public async Task Test018_Should_Update_Folder()
896896
{
897897
if (string.IsNullOrEmpty(_testFolderUid))
898898
{
899-
Test014_Should_Create_Folder();
899+
await Test014_Should_Create_Folder();
900900
}
901901

902902
if (!string.IsNullOrEmpty(_testFolderUid))
@@ -932,7 +932,7 @@ public async Task Test019_Should_Update_Folder_Async()
932932
// First create a folder if we don't have one
933933
if (string.IsNullOrEmpty(_testFolderUid))
934934
{
935-
Test014_Should_Create_Folder();
935+
await Test014_Should_Create_Folder();
936936
}
937937

938938
if (!string.IsNullOrEmpty(_testFolderUid))
@@ -968,7 +968,7 @@ public async Task Test022_Should_Delete_Folder()
968968
// First create a folder if we don't have one
969969
if (string.IsNullOrEmpty(_testFolderUid))
970970
{
971-
Test014_Should_Create_Folder();
971+
await Test014_Should_Create_Folder();
972972
}
973973

974974
if (!string.IsNullOrEmpty(_testFolderUid))
@@ -1236,7 +1236,7 @@ public async Task Test031_Should_Fetch_Asset_With_Locale_Parameter()
12361236
{
12371237
if (string.IsNullOrEmpty(_testAssetUid))
12381238
{
1239-
Test005_Should_Create_Asset_Async();
1239+
await Test005_Should_Create_Asset_Async();
12401240
}
12411241

12421242
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -1273,7 +1273,7 @@ public async Task Test032_Should_Fetch_Asset_Async_With_Locale_Parameter()
12731273
{
12741274
if (string.IsNullOrEmpty(_testAssetUid))
12751275
{
1276-
Test005_Should_Create_Asset_Async();
1276+
await Test005_Should_Create_Asset_Async();
12771277
}
12781278

12791279
if (!string.IsNullOrEmpty(_testAssetUid))
@@ -1343,7 +1343,7 @@ public async Task Test034_Should_Handle_Fetch_With_Invalid_Locale_Parameter()
13431343
{
13441344
if (string.IsNullOrEmpty(_testAssetUid))
13451345
{
1346-
Test005_Should_Create_Asset_Async();
1346+
await Test005_Should_Create_Asset_Async();
13471347
}
13481348

13491349
if (string.IsNullOrEmpty(_testAssetUid))

Contentstack.Management.Core.Tests/IntegrationTest/Contentstack014_EntryTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ public async Task Test021_Should_Fail_With_Invalid_Entry_UID_Formats()
924924
{
925925
Console.WriteLine($"✅ SDK validation caught malformed UID: {ex.Message}");
926926
}
927-
catch (System.Text.Json.JsonException ex)
927+
catch (System.Text.Json.JsonException)
928928
{
929929
// API returned HTML error page instead of JSON for path traversal/malicious UIDs
930930
Console.WriteLine($"✅ API blocked malicious entry UID with HTML response: {invalidUID}");
@@ -1118,7 +1118,7 @@ public async Task Test026_Should_Handle_Invalid_Content_Type_UIDs()
11181118
{
11191119
Console.WriteLine($"✅ SDK caught invalid content type: {ex.Message}");
11201120
}
1121-
catch (System.Text.Json.JsonException ex)
1121+
catch (System.Text.Json.JsonException)
11221122
{
11231123
// API returned HTML error page instead of JSON for special characters/malicious content types
11241124
Console.WriteLine($"✅ API blocked malicious content type UID with HTML response: {invalidContentType}");
@@ -2298,7 +2298,7 @@ public async Task Test049_Should_Block_Entry_Access_With_Malformed_Tokens()
22982298
{
22992299
Console.WriteLine($"✅ SDK caught malformed token: {ex.Message}");
23002300
}
2301-
catch (System.Text.Json.JsonException ex)
2301+
catch (System.Text.Json.JsonException)
23022302
{
23032303
// API returned HTML error page instead of JSON for malformed tokens
23042304
Console.WriteLine($"✅ API blocked malformed token with HTML response: {malformedToken.Substring(0, Math.Min(20, malformedToken.Length))}...");

0 commit comments

Comments
 (0)