From 4453dcebca54287e6c785e019f898ec267535426 Mon Sep 17 00:00:00 2001 From: "aspire-repo-bot[bot]" <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 05:35:11 +0000 Subject: [PATCH 1/3] Document Go AppHost init in existing Go repos --- .../src/content/docs/reference/cli/commands/aspire-init.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx index 29f7ac64be..e23eeec288 100644 --- a/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx @@ -36,7 +36,7 @@ The command adapts to the repo it finds: - **C# file-based AppHost** (when selected interactively) — creates `apphost.cs` with `#:sdk` and `#:package` directives for a lightweight single-file orchestrator. - **TypeScript AppHost** (when selected interactively) — creates `apphost.mts` with the generated `.aspire/modules/` folder. If the repo already has a root `package.json`, the AppHost is created as a nested `aspire-apphost/` package and the root `aspire.config.json` points to `aspire-apphost/apphost.mts`. -- **Go AppHost** (when selected interactively): creates `apphost.go`, a `go.mod` that points at the generated SDK, and the generated `.aspire/modules/` folder. +- **Go AppHost** (when selected interactively): creates `apphost.go`, a `go.mod` that points at the generated SDK, and the generated `.aspire/modules/` folder. If the repo already has a root `go.mod`, the existing module, `go.work`, and source files are left unchanged. The AppHost is created as a separate `aspire-apphost/` module with its own `go.work` (so an ancestor workspace that doesn't list it doesn't interfere), and the root `aspire.config.json` points to `aspire-apphost/apphost.go`. An explicit `GOWORK` environment variable override is respected. :::note When a `.sln` or `.slnx` is present, the C# option creates a **project-based AppHost** instead — an `AppHost.csproj` added to the solution with `ProjectReference` items and strongly-typed `AddProject()` calls. From 982041cb35467d7fefec417b67b93db2a7751b21 Mon Sep 17 00:00:00 2001 From: AJ Matthews Date: Tue, 10 Nov 2026 15:33:08 +0000 Subject: [PATCH 2/3] Minor rewording to improve clarity. --- .../src/content/docs/reference/cli/commands/aspire-init.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx index e23eeec288..ac396ea4fa 100644 --- a/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx @@ -36,7 +36,7 @@ The command adapts to the repo it finds: - **C# file-based AppHost** (when selected interactively) — creates `apphost.cs` with `#:sdk` and `#:package` directives for a lightweight single-file orchestrator. - **TypeScript AppHost** (when selected interactively) — creates `apphost.mts` with the generated `.aspire/modules/` folder. If the repo already has a root `package.json`, the AppHost is created as a nested `aspire-apphost/` package and the root `aspire.config.json` points to `aspire-apphost/apphost.mts`. -- **Go AppHost** (when selected interactively): creates `apphost.go`, a `go.mod` that points at the generated SDK, and the generated `.aspire/modules/` folder. If the repo already has a root `go.mod`, the existing module, `go.work`, and source files are left unchanged. The AppHost is created as a separate `aspire-apphost/` module with its own `go.work` (so an ancestor workspace that doesn't list it doesn't interfere), and the root `aspire.config.json` points to `aspire-apphost/apphost.go`. An explicit `GOWORK` environment variable override is respected. +- **Go AppHost** (when selected interactively) — creates `apphost.go`, a `go.mod` that points at the generated SDK, and the generated `.aspire/modules/` folder. If the repo already has a root `go.mod`, the existing module, `go.work`, and source files are left unchanged. The AppHost is created as a separate `aspire-apphost/` module with its own `go.work`, so that an ancestor workspace that doesn't list it doesn't interfere. The root `aspire.config.json` points to `aspire-apphost/apphost.go`. An explicit `GOWORK` environment variable override is respected. :::note When a `.sln` or `.slnx` is present, the C# option creates a **project-based AppHost** instead — an `AppHost.csproj` added to the solution with `ProjectReference` items and strongly-typed `AddProject()` calls. From cfc61fc70e1203447e247c6a847db4487618fe00 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 30 Oct 2026 05:59:23 -0700 Subject: [PATCH 3/3] Isolate Developer Hub E2E layout tests from the region-gated WCP banner (#1986) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary The Developer Hub E2E layout tests fail when a CI runner lands in a region where Microsoft's WCP cookie-consent script shows its banner. The banner is a fixed strip at the top of the page, and `wcp-consent.css` pushes `.page` down by its height. The Hub specs don't stub `wcpstatic.microsoft.com`, so in those regions eight layout assertions fail on every attempt. Example: [run 40999614344, mobile-chromium shard 1/2](https://github.com/microsoft/aspire.dev/actions/runs/40999614344/job/123883461177) on #1984. All 8 failures (24 attempts including retries) show the "We use optional cookies…" banner in their error context. The other five shards passed. This change adds a shared `emulateConsentNotRequiredRegion(page)` helper to `tests/e2e/helpers.ts` that: - aborts `wcpstatic.microsoft.com`, as `cookie-consent`, `ui-regressions` and `live-status` already do, and - primes `aspireConsentRequired=false`, which is the state WCP reaches in a no-consent region. The helper is applied to `dev-browse`, `dev-layout` and `dev-grain`. `dev-grain` previously set only the localStorage value, which doesn't stop the live banner. Assertions, timeouts and retries are unchanged. Banner behavior stays covered by `cookie-consent.spec.ts` and `cookie-dialog-layout.spec.ts`. ## Third-party links and affiliations None. ## Validation I reproduced the CI condition locally by serving a consent-required WCP stand-in on `wcpstatic.microsoft.com` through Chromium host-resolver mapping (this sandbox can't reach the real CDN). The stand-in's text, links and buttons match the banner captured in CI. Results are on mobile-chromium against `astro dev`: | Test | main + banner | this PR + banner | | --- | --- | --- | | `dev-browse` mobile filters (`:579`) | ❌ `box.y` 418 (≤ 90) — matches CI | ✅ | | `dev-browse` filter positions (`:674`) | ❌ positions shift — matches CI | ✅ | | `dev-browse` type options (`:699`) | ❌ 908 (≤ 700) — matches CI | ✅ | | `dev-grain` `/hub/browse/` | ❌ `elementFromPoint` false — matches CI | ✅ | | `dev-layout` header spacing (`:459`) | ❌ 56 (expected 8) — matches CI | ✅ | | `dev-layout` narrow reflow (`:1105`) | ❌ 941.5 (< 900) | ✅ | | `dev-browse` initial paint ×2 (`:131`) | ❌ 341 px offset (CI: 428) | ⚠️ 4 px | On main without the banner, the initial-paint cases also drift 4 px under `astro dev`. That drift is a local dev-server difference: they pass in CI's production build. With the fix, the stub received 0 requests. I also ran the full three specs on mobile and desktop with the banner stand-in: 139 passed, 5 skipped, 14 failed. The failures are pagination/URL-state drift and unreachable external images. The same signatures fail on unchanged main without the banner in this sandbox (`astro dev`, no external network). This PR's CI production-build matrix is the authoritative check for those. - `eslint . --max-warnings 0` (with `astro sync` and the skill-digest check) passes. - Prettier and `tsc` findings on `helpers.ts`/`dev-grain.spec.ts` are present on main too. **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/frontend/tests/e2e/dev-browse.spec.ts | 3 ++- src/frontend/tests/e2e/dev-grain.spec.ts | 3 ++- src/frontend/tests/e2e/dev-layout.spec.ts | 6 +++++- src/frontend/tests/e2e/helpers.ts | 8 ++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/frontend/tests/e2e/dev-browse.spec.ts b/src/frontend/tests/e2e/dev-browse.spec.ts index fceaa98814..b480231945 100644 --- a/src/frontend/tests/e2e/dev-browse.spec.ts +++ b/src/frontend/tests/e2e/dev-browse.spec.ts @@ -1,7 +1,7 @@ import { expect, test } from '@playwright/test'; import AxeBuilder from '@axe-core/playwright'; import blogPosts from '../../src/data/aspire-blog-posts.json' with { type: 'json' }; -import { getSiteNavigationLink } from './helpers'; +import { getSiteNavigationLink, emulateConsentNotRequiredRegion } from './helpers'; const results = (page: import('@playwright/test').Page) => page.locator('.browse-result:not([hidden])'); const openFacet = async (page: import('@playwright/test').Page, name: string) => { @@ -13,6 +13,7 @@ const openFacet = async (page: import('@playwright/test').Page, name: string) => }; test.beforeEach(async ({ page }) => { + await emulateConsentNotRequiredRegion(page); await page.emulateMedia({ reducedMotion: 'reduce' }); }); diff --git a/src/frontend/tests/e2e/dev-grain.spec.ts b/src/frontend/tests/e2e/dev-grain.spec.ts index c0e982131f..c18b5b95d1 100644 --- a/src/frontend/tests/e2e/dev-grain.spec.ts +++ b/src/frontend/tests/e2e/dev-grain.spec.ts @@ -1,9 +1,10 @@ import { expect, test } from '@playwright/test'; import sharp from 'sharp'; +import { emulateConsentNotRequiredRegion } from './helpers'; for (const route of ['/hub/browse/', '/hub/glossary/']) { test(`${route} controls container reuses passive static Hub grain`, async ({ page }) => { - await page.addInitScript(() => localStorage.setItem('aspireConsentRequired', 'false')); + await emulateConsentNotRequiredRegion(page); await page.goto(`${route}?q=zzzz-no-match&topic=foundations`); const empty = page.locator('.search-empty:visible'); const controls = page.locator('.browse-controls, .glossary-filter-panel'); diff --git a/src/frontend/tests/e2e/dev-layout.spec.ts b/src/frontend/tests/e2e/dev-layout.spec.ts index 90b99e8018..5bf3e2737f 100644 --- a/src/frontend/tests/e2e/dev-layout.spec.ts +++ b/src/frontend/tests/e2e/dev-layout.spec.ts @@ -1,6 +1,10 @@ import { expect, test } from '@playwright/test'; import AxeBuilder from '@axe-core/playwright'; -import { getSiteNavigationLink } from './helpers'; +import { getSiteNavigationLink, emulateConsentNotRequiredRegion } from './helpers'; + +test.beforeEach(async ({ page }) => { + await emulateConsentNotRequiredRegion(page); +}); test('production Dev Hub scripts, styles, and Pagefind load from static assets', async ({ page, request }) => { const pagefind = await request.get('/pagefind/pagefind.js'); diff --git a/src/frontend/tests/e2e/helpers.ts b/src/frontend/tests/e2e/helpers.ts index 4065e11511..6a59154443 100644 --- a/src/frontend/tests/e2e/helpers.ts +++ b/src/frontend/tests/e2e/helpers.ts @@ -16,6 +16,14 @@ export async function resetCookieConsentState(page: Page): Promise { await page.context().clearCookies(); } +// WCP decides per runner region whether to show its banner. When shown, the banner +// pushes `.page` down and reveals the cookie button, so layout assertions need the +// no-consent state. A cached `false` alone does not stop live WCP showing the banner. +export async function emulateConsentNotRequiredRegion(page: Page): Promise { + await page.route(/wcpstatic\.microsoft\.com/, (route) => route.abort()); + await page.addInitScript(() => localStorage.setItem('aspireConsentRequired', 'false')); +} + export async function dismissCookieConsentIfVisible(page: Page): Promise { const siteTourDismissButton = page.locator('[data-tour-action="dismiss"]'); if (await siteTourDismissButton.isVisible().catch(() => false)) {