Work around main polyglot channel collision#17948
Conversation
Use a run-scoped local channel for main CI native CLI archives and polyglot validation so the built CLI identity matches the local package hive without colliding with the built-in daily feed channel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17948Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17948" |
There was a problem hiding this comment.
Pull request overview
This PR attempts to unblock main-branch Polyglot SDK validation by avoiding the daily channel collision, switching main CI to a run-scoped channel (run-<id>) and using the same channel in polyglot validation so locally-built artifacts land in the correct local hive.
Changes:
- Update hive selection logic in
setup-local-cli.shto acceptrun-<id>as a non-PR channel. - Change Polyglot validation to use
run-${{ github.run_id }}instead ofdailyfor non-PR runs. - Change native CLI archive builds to bake
run-${{ github.run_id }}as the CLI channel onrefs/heads/main.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/polyglot-validation/setup-local-cli.sh | Allows run-<id> as a valid non-PR hive label fallback. |
| .github/workflows/polyglot-validation.yml | Switches non-PR validation channel from daily to run-<id>. |
| .github/workflows/build-cli-native-archives.yml | Switches main archive builds to bake run-<id> channel instead of daily. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
Allow run-<id> as a baked CLI identity channel and pass the archive-built channel into polyglot validation so the local package hive matches the built CLI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid introducing a new run-scoped CLI identity. Main CI now uses the existing local channel for the built CLI archive and polyglot package hive, while PRs keep pr-* and other non-release runs keep daily. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore test files to the pre-PR state so the local-channel workaround remains workflow-only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
❌ CLI E2E Tests failed — 112 passed, 1 failed, 2 unknown (commit ❌ Failed Tests
View all recordings
📹 Recordings uploaded automatically from CI run #27003183623 |
|
✅ No documentation update needed. docs_required → false positive signal / build_or_ci_only The only triggered signal was
No documentation update is needed on |
…ilename globs match nested paths Three automated PRs in the last 14d fired more tests than they needed to: #17672, #17263 [Automated] Update ATS API Surface Area #17534 Move repository skills to .agents They each touched only api/*.txt or only README/skill markdown, but were firing trigger_all or selective:integrations — burning the full ~25min CI critical path. Audit-replay over 161 merged PRs found them, plus a latent C# glob bug where bare-filename patterns silently ignored nested matches. Root causes — two independent bugs: 1. The category-trigger rescue logic in RescueCategoryTriggerFiles built a synthetic union of all category triggerPaths without consulting per-category excludePaths. An ignored file that textually matched some category's glob but was excluded from that category got rescued back to active and then hit fallback_unmatched (worse than staying ignored). For src/Aspire.Hosting.Foundry/api/*.txt this meant ATS-only PRs fired integrations even after `**/api/*.txt` was added to ignorePaths. 2. The four glob analyzers (CriticalFileDetector, IgnorePathFilter, CategoryMapper.CompiledCategory, ProjectMappingResolver.CompiledMapping) handed user-facing patterns directly to FileSystemGlobbing.Matcher. The Matcher anchors bare-filename patterns at the repo root, so `Directory.Build.props` matched only the root file, not `src/Directory.Build.props` or `tests/Directory.Build.props`. The Python audit-replay evaluator (eval_rules.py) already documented and applied a "prepend **/ to bare-filename patterns" rule; the C# analyzers did not, so the two evaluators silently disagreed on ~5 patterns across ignorePaths, triggerAllPaths, and sourceToTestMappings. The fix: - Rescue now passes config.Categories directly to CategoryMapper so CompiledCategory.Matches honors per-category excludes. A file is rescued only when at least one category would actually fire on it. - New PatternNormalization.NormalizeGlob prepends `**/` to any pattern without a path separator. Every glob entry point applies it: the four analyzers above plus ProjectMappingResolver's regex compiler. - Rules: integrations.excludePaths gains `tests/Aspire.Acquisition.Tests/**`, `tests/Infrastructure.Tests/**`, `**/*.md`, `**/api/*.txt`. The same `**/api/*.txt` exclude is added to every category so an ignored ATS file can't be rescued back by any category. ignorePaths gains `**/api/*.txt`. Acquisition mapping's source list gains the missing self-mapping `tests/Aspire.Acquisition.Tests/**` (Templates and Infrastructure mappings already had this; Acquisition was an oversight exposed only after the new exclude was added). Verification: - Audit replay over 161 merged PRs: 4 outcomes change (#17263, #17534, #17549, #17672 all move to `skip`); zero regressions; zero fallback_unmatched. - New AuditFixtureTests xUnit [Theory] replays 28 hand-validated PRs against the live audit rules. Each row is a separate test, so any future rule edit that changes a row's outcome shows up as a visible CI failure. Coverage includes templates (#16447), CLI native build (#17567), extension multi-category (#17881/17698/17772), Hosting-core trigger_all (#17879), polyglot (#17948), and the regression canaries for previous fallback_unmatched cases. - Per-component regression tests pin both bugs: two new tests in EndToEndEvaluationTests for rescue+excludes; two more for bare-filename matching at nested paths. - Three pre-existing analyzer tests had asserted the buggy bare-filename behavior as expected (e.g. `*.md` not matching `docs/guide.md`). Updated with comments explaining the user-intent rule. - Full TestSelector namespace: 290 tests, all pass. No collateral damage on the wider Infrastructure.Tests suite (5 pre-existing baseline failures unchanged). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
Work around the persistent main CI Polyglot SDK Validation failure by avoiding the
dailychannel name collision between the running CLI identity and the built-in daily feed channel.Polyglot validation is intended to use built bits from the same workflow run. Each language job downloads the built native CLI archive, built NuGet packages, and RID-specific NuGet packages. The validation container then runs
setup-local-cli.sh, which installs the downloadedaspirebinary into/root/.aspire/bin, runsaspire setupto extract the bundled payload, and copies the downloaded.nupkgfiles into/root/.aspire/hives/<channel>/packages. The Dockerfiles put/root/.aspire/binfirst onPATH, soaspire init,aspire add, andaspire runshould all use the just-built CLI and packages.The failure is main-specific because PR builds already use a
pr-<number>identity and hive label, and the CLI already treatspr-*as a local-build channel. Main builds useddailyfor both the built CLI identity and the local hive label, butdailyis also a built-in shared feed channel. The CLI resolveddailyas the shared feed channel instead of the just-populated local hive, so restore/package resolution missed the current build packages before they were available on the shared feed.This PR changes main CI native CLI archive builds and Polyglot validation to use the existing
localchannel instead ofdaily.localis already accepted as a baked CLI identity and already treated as a local-build channel, so this avoids product code changes while keeping the built CLI identity aligned with the local package hive. PR validation continues to usepr-<number>, and release branch archive builds continue to usestaging.This is intended as a narrow CI unblock while the longer-term channel/source resolution model is investigated separately.
Fixes # (issue)
Validation:
.github/workflows/polyglot-validation/setup-local-cli.sh.git diff --checkfor the PR diff.Checklist
<remarks />and<code />elements on your triple slash comments?