Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ jobs:
# 2. Runs the subset of Aspire.Cli.Tests classes that exercise version/channel/template
# version pinning logic against the stably-built CLI assemblies. These are the code
# paths most likely to behave differently when the CLI's own version label is stable.
# 3. Runs a small `aspire new aspire-empty` + `aspire restore` smoke script that
# exercises the user-visible CLI flow against the locally-built stable feed,
# 3. Runs C#, Go, and Java template scaffolding + `aspire restore` smoke checks that
# exercise the user-visible CLI flow against the locally-built stable feed,
# which is the scenario that has historically broken on stabilization branches.
#
# The job is gated to enabled PRs only. Push CI (including push to release branches with
Expand All @@ -150,8 +150,8 @@ jobs:

- name: Build + pack with StabilizePackageVersion=true
# SkipNativeBuild=true keeps this job fast (~5min): pack-time NU5104 detection
# doesn't need NativeAOT CLI binaries, and the moderate smoke below invokes the
# CLI via `dotnet run --project src/Aspire.Cli/Aspire.Cli.csproj`.
# doesn't need NativeAOT CLI binaries. The consumer smoke separately publishes
# a Release bundled driver so guest restores cannot substitute source projects.
run: |
./build.sh -restore -build -ci -pack \
-p:StabilizePackageVersion=true \
Expand Down
46 changes: 42 additions & 4 deletions .github/workflows/cli-starter-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
if: ${{ github.repository == 'microsoft/aspire' }}
runs-on: ${{ inputs.runner }}
# Shared budget for every caller of this reusable workflow. The validation script can spend
# up to four startup waits (run + start for two templates) and three resource waits, which is
# 27 minutes on the current Windows ARM64 input set before template creation, package add, log
# up to six startup waits (run + start for three templates) and five resource waits, which is
# 42 minutes on the current Windows ARM64 input set before template creation, package add, log
# collection, and artifact upload. Keep the job timeout above that aggregate budget.
timeout-minutes: 45
timeout-minutes: 60
env:
GH_TOKEN: ${{ github.token }}
steps:
Expand All @@ -63,6 +63,44 @@ jobs:
with:
node-version: '22'

- name: Setup Go
shell: pwsh
# Download the official toolchain directly so this lane needs no additional action pin.
# Verify the archive using the checksum published by https://go.dev/dl/?mode=json.
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
$os = switch ('${{ runner.os }}') {
'Windows' { 'windows' }
'macOS' { 'darwin' }
'Linux' { 'linux' }
default { throw 'Unsupported runner OS' }
}
$arch = switch ('${{ runner.arch }}') {
'X64' { 'amd64' }
'ARM64' { 'arm64' }
default { throw 'Unsupported runner architecture' }
}
$releases = Invoke-RestMethod 'https://go.dev/dl/?mode=json&include=all'
$release = $releases | Where-Object version -EQ 'go1.26.10'
$archive = @($release.files | Where-Object { $_.os -eq $os -and $_.arch -eq $arch -and $_.kind -eq 'archive' })
if ($archive.Count -ne 1) { throw "Expected one Go archive for $os/$arch" }
$download = Join-Path $env:RUNNER_TEMP $archive[0].filename
Invoke-WebRequest "https://go.dev/dl/$($archive[0].filename)" -OutFile $download
if ((Get-FileHash $download -Algorithm SHA256).Hash -ne $archive[0].sha256) {
throw 'Go archive checksum mismatch'
}
$destination = Join-Path $env:RUNNER_TEMP 'starter-go'
New-Item -ItemType Directory -Path $destination -Force | Out-Null
if ($os -eq 'windows') {
Expand-Archive $download -DestinationPath $destination
} else {
tar -xzf $download -C $destination
}
$goBin = Join-Path $destination 'go/bin'
$goBin >> $env:GITHUB_PATH
& (Join-Path $goBin 'go') version

- name: Install Aspire CLI from PR dogfood script
shell: pwsh
env:
Expand All @@ -79,7 +117,7 @@ jobs:
- name: Create starter app and validate startup
# Leave headroom above the script's aggregate wait budget so slower runs can still finish
# template creation, aspire add, and cleanup instead of being cancelled mid-validation.
timeout-minutes: 40
timeout-minutes: 55
shell: pwsh
env:
PR_NUMBER: ${{ inputs.prNumber }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/polyglot-validation/test-go-playground.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Polyglot SDK Validation - Go validation AppHosts
# Iterates all Go validation AppHosts under tests/PolyglotAppHosts/*/Go,
# runs 'aspire restore --apphost' to regenerate the per-integration .aspire/modules/ SDK, and
# compile-checks each AppHost with 'go build ./...' to verify the generated API surface.
# builds and vets each AppHost against its own generated API surface.
set -euo pipefail

echo "=== Go Validation AppHost Codegen Validation ==="
Expand Down Expand Up @@ -85,6 +85,14 @@ for app_dir in "${APP_DIRS[@]}"; do
continue
fi

echo " → go vet ./..."
if ! go vet ./... 2>&1; then
echo " ❌ go vet failed for $integration_name"
FAILED+=("$integration_name (go vet)")
echo ""
continue
fi

echo " ✅ $integration_name passed"
PASSED+=("$integration_name")
echo ""
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/polyglot-validation/test-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,23 @@ if grep -q "builder.Build()" apphost.go; then
print "\tif missingValue != nil {"
print "\t\tlog.Fatalf(\"Expected missing configuration key to return nil, got %q\", *missingValue)"
print "\t}"
print "\tchildren, err := builder.GetConfiguration().GetChildren()"
print "\tif err != nil {"
print "\t\tlog.Fatalf(\"Failed to decode configuration children: %v\", err)"
print "\t}"
print "\tfoundSection := false"
print "\tfor _, child := range children {"
print "\t\tkey, err := child.Key()"
print "\t\tif err != nil {"
print "\t\t\tlog.Fatalf(\"Failed to read configuration child key: %v\", err)"
print "\t\t}"
print "\t\tif key == \"PolyglotTest\" {"
print "\t\t\tfoundSection = true"
print "\t\t}"
print "\t}"
print "\tif !foundSection {"
print "\t\tlog.Fatal(\"Configuration children did not include PolyglotTest\")"
print "\t}"
print ""
print "\t// Add Redis cache resource"
print "\tredis := builder.AddRedis(\"cache\", &aspire.AddRedisOptions{Port: aspire.Float64Ptr(0)}).WithImageRegistry(\"netaspireci.azurecr.io\")"
Expand Down
9 changes: 9 additions & 0 deletions docs/ci/test-trigger-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ still select their normal validation.
| `ALL` | every selector target; PR CI runs the full PR test matrix and all PR-gated jobs, while independently scheduled, dispatched, or outerloop targets remain advisory |
| `<GROUP_NAME>` | a named group (see `groups:`) expanding **recursively** to its `test:`/`job:` members |

Starter validation runs C#, TypeScript, and Go starters on all six native runner
platforms. The Go scenario waits for the API on every platform and Redis on Linux.
Containerless macOS/Windows runners use `--use-redis-cache false`; the default
Redis-enabled starter remains covered by Linux runners and Docker CLI E2E tests.
Changes to their hosting/code-generation packages select this lane through runtime consumer rules.
The stabilization smoke separately scaffolds and restores Go and Java starters
against the isolated local stable feed; it runs only when the stabilization gate
is enabled, not through the test selector.

Unconditional baseline builds are not selector targets. Gated reusable
workflows are routed to the target they implement or serve.

Expand Down
5 changes: 4 additions & 1 deletion eng/github-ci/test-trigger-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,11 @@ affected_project_rules:
- Aspire.Hosting.Dotnet
- Aspire.Hosting.CodeGeneration.TypeScript
- Aspire.Hosting.JavaScript
- Aspire.Hosting.CodeGeneration.Go
- Aspire.Hosting.Go
- Aspire.Hosting.Redis
targets: [job:cli-starter-validation]
reason: direct executables, SDK, and hosting/code-generation packages used by the C# and TypeScript starter scenarios
reason: direct executables, SDK, and hosting/code-generation packages used by the C#, TypeScript, and Go starter scenarios
- projects: [Aspire.Hosting.Dotnet]
targets: [test:Aspire.Cli.EndToEnd.Tests, test:Aspire.Templates.Tests]
reason: generated C# AppHosts use AddDotnetProject through a runtime-only package reference
Expand Down
14 changes: 13 additions & 1 deletion eng/scripts/cli-starter-validation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ $templates = @(
TemplateId = 'aspire-starter'
ProjectName = 'AspireCliCsStarterSmoke'
ExpectedResources = @('apiservice')
},
@{
TemplateId = 'aspire-go-starter'
ProjectName = 'AspireCliGoStarterSmoke'
# Hosted macOS/Windows runners have no Linux container runtime. Keep full Redis
# readiness on Linux; the other runners exercise the supported cache-free starter.
ExpectedResources = $(if ($IsLinux) { @('api', 'cache') } else { @('api') })
}
)

Expand Down Expand Up @@ -279,7 +286,12 @@ foreach ($template in $templates)
{
$newStartedAt = Get-Date
Write-DiagnosticMessage "${templateId}: invoking aspire new."
aspire new $templateId --name $projectName --output $projectRoot --channel "pr-$PRNumber" --non-interactive --nologo --suppress-agent-init
$templateArguments = @()
if ($templateId -eq 'aspire-go-starter' -and -not $IsLinux)
{
$templateArguments = @('--use-redis-cache', 'false')
}
aspire new $templateId --name $projectName --output $projectRoot --channel "pr-$PRNumber" --non-interactive --nologo --suppress-agent-init @templateArguments
Write-DiagnosticMessage "${templateId}: aspire new returned after $([math]::Round(((Get-Date) - $newStartedAt).TotalSeconds, 1)) seconds."

Push-Location $projectRoot
Expand Down
Loading
Loading