Skip to content

V2.0.0/service update - #1

Merged
gimlichael merged 25 commits into
mainfrom
v2.0.0/service-update
Aug 9, 2026
Merged

V2.0.0/service update#1
gimlichael merged 25 commits into
mainfrom
v2.0.0/service-update

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request introduces foundational improvements to repository standards, automation, and documentation for the Static Content Provider project. It adds comprehensive contributing and agent guides, enforces code style and engineering rules, and implements a suite of reusable GitHub Actions for Docker image lifecycle management and SBOM/provenance attestations. Automated dependency updates are also configured.

Key changes include:

Documentation and Engineering Standards

  • Added .github/CONTRIBUTING.md with clear contribution, code, and PR guidelines.
  • Introduced AGENTS.md with durable engineering principles, project structure, and testing conventions for all contributors.

Repository and Code Quality Automation

  • Added .editorconfig to enforce .NET and C# code style, file-scoped namespaces, and formatting rules.
  • Set up .github/dependabot.yml to automate dependency updates for NuGet, GitHub Actions, and Dockerfiles.

Reusable GitHub Actions for Docker and Supply Chain Security

  • Implemented composite actions for Docker image build, save, load, push, login, and tagging (SemVer and TrunkVer), as well as SBOM generation and SBOM/provenance attestations. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Docker Build Context Optimization

  • Refined .dockerignore to minimize build context size and avoid including unnecessary files and directories in Docker builds.

Migrate to .NET 9+ .slnx solution format with centralized Directory.Build.props and Directory.Packages.props. Add .editorconfig for project-wide consistency. Remove legacy .sln files.
Refactor to ASP.NET Core minimal hosting model using WebApplication directly in Program.cs. Remove legacy Startup class and related extension methods. Update Dockerfile and Docker ignore patterns for .NET 10. Modernize launch settings and add application configuration files (appsettings.json, appsettings.Development.json).
Introduce structured configuration options for the CDN origin application: cache control settings, compression, CORS policy, content types, health checks, and origin-level configuration validation.
Implement ASP.NET Core hosting extensions and services for CDN origin: application builder extensions, service collection configuration, cache policy resolution, CORS and compression configuration, content-root validation, health checks, and content-type provider factory.
Add unit test project (Codebelt.Cdn.Origin.Tests) covering configuration validation, cache policies, content-root validation, and content-type resolution. Add functional test project (Codebelt.Cdn.Origin.FunctionalTests) covering HTTP caching, CORS, compression, health checks, static content serving, and startup validation.
Introduce GitHub Actions workflows for continuous integration: build and test validation, code quality analysis, and automated testing on pull requests.
Add comprehensive repository documentation: AGENTS.md for engineering rules and governance, CHANGELOG.md for version history, and a completely rewritten README.md with deployment scenarios, architecture overview, HTTP capabilities matrix, configuration reference, security considerations, and migration guidance from v1.4.0 to v2.0.0.
Document complete version history with Keep a Changelog 1.1.0 format. Include release highlights, SemVer classifications (major/minor/patch), and curated change summaries for all seven releases from initial 1.0.0 release through major 2.0.0 modernization. Add compare links for all versions.
Introduce CaseInsensitivePhysicalFileProvider as a framework-only decorator around PhysicalFileProvider. This preserves the historical case-insensitive URL contract on both case-sensitive and case-insensitive file systems, while rejecting ambiguous case-only matches. Includes comprehensive unit and functional tests.
Document the case-insensitive path lookup feature in both CHANGELOG and README. Update the v2.0.0 section to reflect that case-insensitive path support has been retained through the new decorator provider, with improved correctness and security properties.
Extend the CI test matrix to validate the application across multiple operating systems: Ubuntu 24.04, Windows 2025, and macOS 26. Tests run in both Debug and Release configurations on each platform.
Add testEnvironments.json to configure VS Code test environments for running tests in Docker containers using the official .NET SDK image. This enables consistent test execution across different development environments.
Migrate from WebApplicationFactory to modern Codebelt.Extensions.Xunit patterns with WebApplication-based test server. Update test infrastructure to use Codebelt.Extensions.Xunit.App 11.2.0 and Microsoft.NET.Test.Sdk 18.8.1 to support improved test isolation and framework-native hosting for .NET 10.
Update Program.cs to inherit from Codebelt.Bootstrapper.Web MinimalWebProgram base class, replacing direct WebApplication.CreateBuilder() pattern. Simplifies startup configuration and aligns with framework-first design patterns for .NET 10 applications.
Introduce 8 new GitHub composite actions under .github/actions/ to support containerized build workflows: docker-login, docker-build, docker-load, docker-save, docker-push for image lifecycle management, plus container-sbom, container-attest-sbom, and container-attest-provenance for supply-chain security and attestation. Enables modular container CI/CD pipeline reusability across projects.
Significantly enhance ci-pipeline.yml with: (1) init job to calculate build matrix variables and validate container registry inputs; (2) multi-architecture support (X64 and ARM64) using matrix strategy; (3) expanded workflow_dispatch inputs for on-demand mac testing, image publishing, and registry configuration; (4) updated build strategy with per-architecture runners. Update Dockerfile and Codebelt.Cdn.Origin.csproj to support container publishing workflow. Enables independent deployment paths and cross-platform container image builds.
Add section to README explaining the CI and container promotion workflow: PR builds run test matrices and generate SBOM artifacts without registry access. Manual dispatch with publish_image=true triggers promotion job that loads the saved image, logs into registry, and pushes it. Attestation job publishes provenance and SBOM artifacts. Clarifies registry selection and secret requirements for production deployments.
Introduce docker-tag-semver and docker-tag-trunkver composite actions for consistent image versioning across registries. Enhance docker-save action to accept optional additional-images parameter, enabling multiple images to be archived in a single tarball. Supports Docker Hub promotion workflow with SemVer and TrunkVer tagging strategies.
Extend ci-pipeline.yml with multi-registry Docker promotion capability. Add promote_dockerhub and dockerhub_repository workflow dispatch inputs. Introduce promotion job that publishes verified Staging images to Docker Hub with gated Production environment approval. Implement docker-tag-semver and docker-tag-trunkver tagging for consistent versioning across jcr.codebelt.net and docker.io registries. Add attestation jobs for build-provenance and SBOM artifacts on both registries.
Update README with detailed explanation of Docker Hub promotion workflow. Clarify SemVer and TrunkVer tagging strategy, removing leading 'v' for Docker Hub compatibility. Document Staging and Production environment separation with approval gates. Explain artifact immutability: the same docker save tarball is loaded and retagged for each registry without rebuilding. Specify required secrets for Staging (JCR_USERNAME/PASSWORD) and Production (DOCKERHUB_USERNAME/TOKEN) environments. Note that digest gates verify tag consistency within and across registries.
@gimlichael gimlichael self-assigned this Aug 9, 2026
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

The PR updates the static-content service and introduces repository standards, CI automation, container publication, and supply-chain attestations.

  • Adds reusable Docker build, tagging, save/load, push, SBOM, and attestation actions.
  • Adds a multi-stage CI pipeline with testing, analysis, container publication, and promotion gates.
  • Updates application configuration, content-root validation, cache handling, documentation, and test coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/Codebelt.Cdn.Origin/Hosting/CachePolicyResolver.cs Uses case-insensitive immutable-prefix matching, resolving the previously reported cache-policy inconsistency.
src/Codebelt.Cdn.Origin/Hosting/ContentRootValidator.cs Resolves symbolic links and junctions to final targets before checking whether a content root exposes application files.
.github/workflows/ci-pipeline.yml Adds gated build, test, analysis, container publication, attestation, and promotion jobs.
.dockerignore Reduces the repository-root Docker build context by excluding development and build artifacts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Source[Source and configuration] --> Build[Build and test]
  Build --> Quality[Quality gates]
  Quality --> Image[Build and save container]
  Image --> Staging[Publish to staging]
  Staging --> Attest[SBOM and provenance attestations]
  Attest --> Production[Promote to Docker Hub]
Loading

Reviews (4): Last reviewed commit: "📝 update 2.0.0 changelog" | Re-trigger Greptile

Comment thread src/Codebelt.Cdn.Origin/Hosting/CachePolicyResolver.cs Outdated
Comment thread src/Codebelt.Cdn.Origin/Hosting/ContentRootValidator.cs Outdated
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

aicia-bot and others added 4 commits August 9, 2026 20:45
Resolve symbolic links and junctions in path validation to prevent traversal-based bypasses. Make cache prefix matching case-insensitive for robustness on case-insensitive filesystems. Add comprehensive test coverage for both behaviors.
@gimlichael
gimlichael merged commit 4f693b4 into main Aug 9, 2026
26 checks passed
@gimlichael
gimlichael deleted the v2.0.0/service-update branch August 9, 2026 21:46
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.

3 participants