Skip to content

feat: CI hardening, plugin contract validation, and developer task runner - #3

Merged
rian-be merged 3 commits into
developmentfrom
dev/github-workflows
Aug 27, 2026
Merged

rian-be merged 3 commits into
developmentfrom
dev/github-workflows

Conversation

@rian-be

@rian-be rian-be commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This PR adds CI pipelines, plugin contract validator, and local task runner so that
plugin and image changes are verified automatically and consistently before they reach
main.

  • adds three GitHub workflows: security.yml, docker.yml, and plugin-validation.yml
  • adds the PluginContractValidator tool that verifies the IAuthKitPlugin contract
  • adds Taskfile.yml (with a Taskfile.docker.yml include) wrapping all local checks
  • documents the validator and extends .gitignore

Security Workflow (security.yml)

  • runs on main, development, PRs, and a weekly schedule
  • light scans on every branch/PR: NuGet audit, CodeQL (security extended), TruffleHog secret scan, dotnet format check
  • release only jobs on main: license compliance, SBOM generation + attestation, Trivy container scan
  • uploads SARIF to GitHub code scanning where applicable

Docker Workflow (docker.yml)

  • triggers only on release: published and v* tags (never on every PR)
  • three stage pipeline: build -> smoke test (container starts, HTTP check) -> publish
  • pushes ghcr.io/authkits/authkit.server with semver + latest tags, multi-arch (linux/amd64, linux/arm64)
  • image is built with embedded provenance and SBOM

Plugin Contract Validation (plugin-validation.yml + tools/PluginContractValidator)

  • publishes every plugin and runs the contract validator on development/main PRs and tags
  • the validator loads plugins with the same isolation model as the host (AssemblyDependencyResolver + AssemblyLoadContext.Default) and asserts:
    • metadata - non empty Name, SemVer Version
    • registration - ConfigureServices does not throw and the IServiceProvider builds
    • security schemes - GetSecuritySchemes() keys match descriptor names
    • middleware - MiddlewareType follows the ASP.NET Core convention
    • health - CheckHealthAsync does not throw
  • follows: IPluginLoader / IPluginContractRule / ContractValidator with one rule per concern new rules are added without touching the validator
  • ships with tools/PluginContractValidator/README.md

Developer Task Runner (Taskfile.yml)

  • includes a Taskfile.docker.yml for image tasks
  • orchestrates restore -> build -> test → format -> plugins:validate via deps
  • uses preconditions, prompt (before push), watch (test loop), sources / generates (incremental), aliases (ci ↔ precommit), and platforms (cross platform clean)
  • task plugins:validate reproduces the CI contract check locally

Other

  • .gitignore now ignores /out/ (generated by plugins:publish)

Result

  • plugin and image changes are gated by automated contract, security, and build checks
  • contributors can run the full local CI with single task ci (or task precommit)
  • releasing produces a scanned, attested, multi arch image in GHCR without manual steps

@rian-be rian-be self-assigned this Aug 27, 2026
@rian-be
rian-be merged commit 00852fc into development Aug 27, 2026
1 check passed
@rian-be
rian-be deleted the dev/github-workflows branch September 9, 2026 09:06
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