Skip to content

build: promote CountryService .NET 10 validation#38

Merged
natthapolvanasrivilai merged 222 commits into
mainfrom
codex/country-main-promotion
Jul 18, 2026
Merged

build: promote CountryService .NET 10 validation#38
natthapolvanasrivilai merged 222 commits into
mainfrom
codex/country-main-promotion

Conversation

@natthapolvanasrivilai

Copy link
Copy Markdown
Contributor

Outcome

Promotes the already-developed CountryService Clean Architecture migration to main with deterministic public-source dependencies and validation-only CI.

Runtime and contracts

  • .NET 10 Clean Architecture with PostgreSQL/Npgsql and real PostgreSQL/Redis/RabbitMQ Testcontainers
  • OpenAPI + Scalar at /country/openapi/v1.json and /country/scalar
  • exact existing versioned routes, DTOs, JSON behavior, permission policies, service-token exchange, and PostgreSQL model snapshot preserved
  • administrative and bulk-import endpoints retain the stricter shared write rate-limit policy
  • no EF migration or production schema change

Supply chain and CI

  • pins public Maliev.Aspire source to 25a5c3b2d3d6b5ce8ed485d2d44a28f4dc4c9b51
  • pins public Maliev.MessagingContracts source to 559a00db0c7920a5247fdff60d4476ad23a9a501
  • removes GitHub Packages credentials and floating shared-package versions
  • uses NuGet.org-only locked restore, pinned GitHub Actions, format/audit/gitleaks gates, local image build, metadata validation, and Trivy
  • removes every unconditional GCP authentication, image push, and GitOps mutation path
  • preserves grouped Dependabot limits from main: NuGet 10, Docker 5, Actions 5

Validation

  • Release build: 0 warnings, 0 errors
  • full suite: 263/263 passing
  • strict OpenAPI/Scalar, auth/route/rate-policy, model-integrity, and repository-governance contracts passing
  • dotnet format --verify-no-changes, transitive vulnerability audit, actionlint, gitleaks clean
  • local Linux image build passed; runtime user app; entrypoint dotnet Maliev.CountryService.Api.dll

No image publication, deployment, GKE/IAM/secrets/GitOps mutation, or database operation was performed. Production remains pending owner Aspire review.

Tracks MALIEV-Co-Ltd/Maliev.Workflows#12.

natthapolvanasrivilai and others added 30 commits September 10, 2025 15:23
- Add missing service registrations (IMemoryCache, CacheOptions, ICountryService)
- Fix authentication issues with TestAuthenticationSchemeHandler
- Use shared database names to fix database scope issues
- Add proper using statements for service interfaces
- Implement database cleanup between tests
- Update test setup to match production service dependencies

Test results: 20/23 tests passing (87% success rate)
Remaining issues: 3 tests have CacheOptions dependency resolution conflicts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove SizeLimit from MemoryCache configuration in integration tests
- Fix InvalidOperationException: Cache entry must specify a value for Size when SizeLimit is set
- This resolves the primary blocker that was causing CI/CD pipeline failures
- Tests now run without cache exceptions, improving from failing builds to 20/23 passing

The remaining 3 test failures are unrelated to this cache issue and can be addressed separately.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add MemoryCacheEntryOptions with Size property to all cache.Set() calls
- Implement logical sizing: countries=1, search results=item count, continents=count
- This resolves the InvalidOperationException: Cache entry must specify value for Size
- All cache operations now properly specify entry sizes when SizeLimit is configured

Results: 23/23 tests passing (100% success rate)
This completely resolves the CI/CD pipeline failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change SwaggerEndpoint from absolute path `/swagger/` to relative path `./`
- Ensures Swagger UI works correctly behind ingress with `/countries` prefix
- Enables access to https://dev.api.maliev.com/countries/swagger

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Swagger UI URL for development: https://dev.api.maliev.com/countries/swagger
- Clarify API base URL structure for development environment
- Reflects recent ingress routing configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add custom RouteTemplate to UseSwagger for countries/swagger path
- Update SwaggerEndpoint to use absolute paths for ingress compatibility
- Enables proper Swagger JSON access behind Kubernetes ingress
- Fixes /swagger/v1.0/swagger.json 404 errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed JWT variable naming conflicts that caused CI build failures
- Removed all secrets from appsettings.json (moved to Google Secret Manager)
- Updated Program.cs to use shared JWT configuration pattern
- Fixed CountryService class JWT dependency injection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add universal deploy-migration.ps1 script for consistent deployments
- Remove obsolete initial-schema.sql file (replaced by EF migrations)
- Enhance migration documentation and patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
natthapolvanasrivilai and others added 24 commits March 6, 2026 15:24
- Add Authorization folder for centralized IAM
- Update csproj packages
…o 10.0.7

Microsoft.AspNetCore.DataProtection.StackExchangeRedis 10.0.7 (added to
Maliev.Aspire.ServiceDefaults for shared SSO cookie key ring) transitively
requires Microsoft.Extensions.Configuration.Abstractions >= 10.0.7 and
Microsoft.Extensions.Logging.Abstractions >= 10.0.7. Application-layer
projects that explicitly referenced 10.0.5 triggered NU1605 downgrades.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…xchange

feat(auth): migrate CountryService to central token exchange
…omotion

# Conflicts:
#	.github/dependabot.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant