π Open Source Example: LocalStack.NET Client solution for dynamic package version and CI/CD test result badges using shields.io endpoint badges. This demonstrates how LocalStack.NET Client handles their two-track versioning strategy and CI/CD badge integration. Use this as inspiration for building your own badge infrastructure.
This project demonstrates LocalStack.NET Client's badge infrastructure for:
- π‘οΈ LocalStack.Client v1.x: Maintenance mode for AWS SDK v3 users (EOL: July 2026)
- π LocalStack.Client v2.0: Future-focused with native AWS SDK v4 support and Native AOT roadmap
- π§ͺ CI/CD Test Results: Multi-platform test status badges from LocalStack's test pipeline
- β NuGet Integration: Works for any NuGet package (general purpose)
- π GitHub Packages: Tailored specifically for LocalStack.NET Client organization packages
- π Test Result Badges: Pull from LocalStack.NET Client's specific CI/CD pipeline via Gist
Use this as inspiration for your own badge solutions rather than expecting to use LocalStack.NET Client's endpoints for your packages.
Base URL: https://yvfdbfas85.execute-api.eu-central-1.amazonaws.com/live/
GET /badge/packages/{package-name}?source={nuget|github}&[options]
Sources:
nuget
- Works for any NuGet packagegithub
- LocalStack.NET Client organization packages only
GET /badge/tests/{platform} # Returns badge JSON
GET /redirect/test-results/{platform} # Returns 302 redirect to test results
Platforms: linux
| windows
| macos
All badge endpoints return shields.io endpoint badge format:
{
"schemaVersion": 1,
"label": "localstack.client nuget",
"message": "1.2.3",
"color": "blue",
"namedLogo": "nuget"
}
# LocalStack.Client v1.x (maintenance track)
/badge/packages/localstack.client?source=nuget&track=1
# LocalStack.Client v2.x (future track with prereleases)
/badge/packages/localstack.client?source=nuget&track=2&include-prerelease=true
# Latest stable LocalStack.Client
/badge/packages/localstack.client?source=nuget
# LocalStack.Client from GitHub Packages (clean versions preferred)
/badge/packages/localstack.client?source=github&include-prerelease=true&prefer-clean=true
# Latest LocalStack GitHub package (may include timestamped builds)
/badge/packages/localstack.client?source=github&include-prerelease=true
# Any public NuGet package
/badge/packages/Newtonsoft.Json?source=nuget
# ASP.NET Core v8 track
/badge/packages/Microsoft.AspNetCore.App?source=nuget&track=8
# Include prereleases
/badge/packages/Microsoft.AspNetCore.App?source=nuget&include-prerelease=true
Note: These pull from LocalStack.NET Client's specific CI/CD pipeline. For your own project, you'd need to adapt the Gist integration.
# LocalStack.Client test results by platform
/badge/tests/linux # Linux test results
/badge/tests/windows # Windows test results
/badge/tests/macos # macOS test results
# Click to view LocalStack's GitHub Actions
/redirect/test-results/linux # β LocalStack CI/CD results
/redirect/test-results/windows # β LocalStack CI/CD results
/redirect/test-results/macos # β LocalStack CI/CD results
- β
All passed:
"153 passed"
(green) - β Some failed:
"2 failed, 150 passed"
(red) - βͺ Unavailable:
"unavailable"
(grey)
Parameter | Description | Example | Default |
---|---|---|---|
package |
Package name (in URL path) | localstack.client |
- |
source |
Package source | nuget , github |
Required |
track |
Major version to track | 1 , 2 , v2 , etc. |
Latest overall |
include-prerelease |
Include prerelease versions | true , false |
false |
prefer-clean |
GitHub only: Prefer manual tags over timestamped builds | true , false |
false |
gt , gte , lt , lte , eq |
Semver range filters | gt=1.0.0 , lte=2.5.0 |
None |
label |
Custom badge label | LocalStack%20v2 |
Auto-generated |
color |
Custom badge color | purple , %23ff0000 |
Smart color |
- π΅ Blue: Stable package releases
- π Orange: Prerelease package versions
- π’ Green: All tests passed
- π΄ Red: Some tests failed
- βͺ Light Grey: Not found / unavailable
<!-- LocalStack.Client two-track strategy -->


<!-- LocalStack CI/CD test matrix -->
[](https://yvfdbfas85.execute-api.eu-central-1.amazonaws.com/live/redirect/test-results/linux)
[](https://yvfdbfas85.execute-api.eu-central-1.amazonaws.com/live/redirect/test-results/windows)
[](https://yvfdbfas85.execute-api.eu-central-1.amazonaws.com/live/redirect/test-results/macos)
# LocalStack.Client versions >= 1.5.0
/badge/packages/localstack.client?source=nuget>e=1.5.0
# LocalStack v2 prereleases only
/badge/packages/localstack.client?source=nuget&track=2&include-prerelease=true<=2.0.0
# Include prereleases in range (requires -0 suffix)
/badge/packages/localstack.client?source=nuget>e=2.0.0-0<=3.0.0
LocalStack's GitHub Packages contain both manual tags and automated timestamped builds:
2.0.0-preview1
(manual tag)2.0.0-preview1-20250716-125702
(automated build)
# Without prefer-clean (standard semver - returns timestamped version)
/badge/packages/localstack.client?source=github&include-prerelease=true
# Result: 2.0.0-preview1-20250716-125702
# With prefer-clean (user-friendly - returns manual tag)
/badge/packages/localstack.client?source=github&include-prerelease=true&prefer-clean=true
# Result: 2.0.0-preview1
The API accepts multiple parameter name formats:
# All of these work for prerelease inclusion:
&include-prerelease=true
&includePrerelease=true
&includeprerelease=true
# All of these work for clean version preference:
&prefer-clean=true
&preferClean=true
- NuGet: Standard NuGet.org API (works for any package)
- GitHub Packages: LocalStack.NET Client organization packages only (
localstack-dotnet
org)
- Source: LocalStack.NET Client's GitHub Gist (
472c59b7c2a1898c48a29f3c88897c5a
) - Updates: LocalStack.NET Client's CI/CD pipeline updates test results after each run
- Format: Platform-specific JSON files (
test-results-{platform}.json
) - Caching: 5-minute TTL for optimal performance
{
"platform": "linux",
"passed": 150,
"failed": 2,
"skipped": 1,
"total": 153,
"url_html": "https://github.com/localstack/localstack-dotnet-client/actions/runs/123",
"timestamp": "2025-01-15T10:30:00Z"
}
- For NuGet: Verify the package name exists on nuget.org
- For GitHub: Only LocalStack.NET Client organization packages are supported
- Check if the package exists in the specified source
- Add
&prefer-clean=true
parameter for LocalStack.NET Client GitHub packages - This only affects LocalStack.NET Client's GitHub sources
- Check version filters (
track
,gte
,lt
) that might exclude newer versions - For prereleases, ensure
include-prerelease=true
is set - Verify the package has the version you expect
- These only work for LocalStack.NET Client's CI/CD pipeline
- For your own project, you'd need to adapt the Gist integration
- Check if LocalStack.NET Client's test pipeline is currently running
The API returns descriptive error messages:
400
: Invalid parameters or malformed semver ranges404
: Package not found or invalid route500
: API or network errors when fetching data
-
Package Sources: Modify
src/handlers/packageHandler.mjs
- Keep NuGet integration as-is (universal)
- Replace GitHub Packages logic with your organization
- Update authentication tokens and API endpoints
-
Test Data Source: Modify
src/services/gistService.mjs
- Replace Gist ID with your data source (Gist, database, API)
- Adapt JSON schema to your CI/CD output format
- Update caching strategy for your needs
-
Customization: Update
src/utils/common.mjs
- Change colors, labels, caching strategies
- Add your own validation logic
- Customize badge formatting
-
Deployment:
- Update AWS Lambda configuration
- Set your own API Gateway domain
- Configure environment variables for your APIs
- Node.js 18+
- npm/yarn
# Install dependencies
npm install
# Run comprehensive test suite (258 tests!)
npm run test:unit
# Run legacy tests
npm run test:legacy
src/
βββ index.mjs # Router + Lambda entry point
βββ handlers/ # Request handlers
β βββ packageHandler.mjs # Package version badges
β βββ testBadgeHandler.mjs # Test result badges
β βββ testRedirectHandler.mjs # Test result redirects
βββ services/ # External API integrations
β βββ gistService.mjs # GitHub Gist integration
βββ utils/ # Shared utilities
βββ common.mjs # Response builders, validation
tests/
βββ jest/unit/ # Unit tests (258 tests)
βββ jest/fixtures/ # Test data and mocks
βββ jest/helpers/ # Test utilities
# GitHub Packages (required for LocalStack.NET Client GitHub packages)
GITHUB_TOKEN=your_github_token_here
The comprehensive test suite (npm run test:unit
) validates:
- β Package badge generation: NuGet and GitHub package integration
- β Two-track strategy: LocalStack.NET Client v1.x maintenance & v2.x future
- β Parameter parsing: All variants and edge cases
- β Version filtering: Track, semver ranges, prerelease inclusion
- β GitHub features: prefer-clean parameter for timestamped builds
- β Test badge generation: Platform-specific test results
- β Test redirects: Navigation to GitHub Actions
- β Error handling: Invalid packages, malformed parameters, network issues
- β Caching: TTL behavior and cache invalidation
This is LocalStack.NET Client's specific implementation, but contributions for improvements are welcome:
- Fork the repository
- Create your feature branch
- Test your changes with
npm run test:unit
- Submit a pull request
Focus on:
- General improvements to the badge infrastructure
- Better error handling and resilience
- Performance optimizations
- Code quality improvements
MIT License - feel free to use this as inspiration for your own badge infrastructure!
π― Remember: This is LocalStack.NET Client's specific implementation. The GitHub Packages integration only works for LocalStack.NET Client packages, and test badges pull from LocalStack.NET Client's CI/CD. Use this as a reference for building your own badge solution!