Skip to content

Commit a8cec12

Browse files
csharpfritzCopilot
andauthored
feat(cli): compile page code-behind safely (#545)
* feat(cli): compile page code-behind safely Merge the page runtime shim, emit compile-safe page code-behind into the generated app, and add explicit BWFC global usings for local project-reference scaffolds. Include focused test updates plus Wingtip run29-run31 reports documenting the benchmark progression. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): port NuGet asset extraction and EDMX conversion to native C# - Add NuGetStaticAssetExtractor service (replaces Migrate-NugetStaticAssets.ps1 shell-out) - Add EdmxToEfCoreConverter service (replaces Convert-EdmxToEfCore.ps1 shell-out) - Add MarkupReferencedMemberStubTransform and ValidatorGenericTypeTransform - Add deprecation warnings to all 4 PS1 scripts - Update CLI docs for direct adoption - CLI now has zero runtime PowerShell dependencies - 506 tests passing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: WingtipToys Run 32 benchmark output and sample improvements - Run 32 report and screenshots (25/25 tests passing) - AfterWingtipToys markup and code-behind fixes from gap analysis - Migration artifacts for WingtipToys Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): add ServerCodeBlockTransform and TemplateFieldChildComponentsTransform - ServerCodeBlockTransform (Order 510): converts <% if/else/foreach %> statement blocks to Razor @if/@foreach syntax; sanitizes raw <% %> inside @* *@ comments - TemplateFieldChildComponentsTransform (Order 620): wraps ItemStyle/HeaderStyle/ FooterStyle inside TemplateField with <ChildComponents> wrapper for BWFC compat - Both registered in Program.cs DI and TestHelpers.CreateDefaultPipeline() - 46 new tests (39 transform + 7 integration), 545 total CLI tests passing Closes Run 33 gaps #3 and #5. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: Run 33 benchmark report and gap analysis Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: WingtipToys migration Run 34 — 25/25 tests passing - L1 migration toolkit run with ServerCodeBlockTransform (Order 510) and TemplateFieldChildComponentsTransform (Order 620) — both confirmed working - Full repair cycle: 266 → 0 build errors - Implemented CartSessionStore (singleton) + CartService (scoped) with ASP.NET Core session-key architecture so cart state survives SSR→circuit transition - Added Minimal API endpoints /AddToCart and /RemoveFromCart as HTTP 302 round-trips, making cart mutations testable with Playwright NetworkIdle - Removed @page directive from AddToCart.razor to resolve ambiguous route conflict - Run report and 5 screenshots at dev-docs/migration-tests/wingtiptoys/run34/ - Bishop history.md updated with architectural learnings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Run 34 shim and transform gaps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add Run 35 gap transforms Implement CLI fixes for G1, G3, G8, and G10 by normalizing display expressions, rewriting EF6 DbContext constructors, extending ServerShim compatibility, and rewriting HttpUtility calls to WebUtility. Include transform registration updates, source-copy coverage, docs, and regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix DisplayExpressionTransform to emit idiomatic @expr for simple expressions Simple dotted identifiers (Item.ProductName) now emit @Item.ProductName Complex expressions (method calls, operators) still emit @(expr) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Run 37 gaps: G1 display-expr, G2 ScriptManager strip, G4 compile-surface stubs G1: Remove String.Format from DisplayExpressionTransform negative lookahead so format expressions become @(String.Format(...)) instead of leaking as raw <%#: G2: Add ScriptManagerStripTransform (Order 255) that removes asp:ScriptManager, webopt:bundlereference, and Scripts.Render PlaceHolder blocks from master pages G4: Add CompileSurfaceStubTransform that detects pages with Identity/external API references and emits build-safe stubs, preserving originals in migration-artifacts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Protect BWFC data control migrations Add explicit migration skill rules that forbid replacing BWFC data controls with manual HTML, and update the CLI migration pipeline to keep ListView, FormView, GridView, Repeater, and related templates on BWFC components. Preserve ItemType, add template Context="Item" normalization, and keep query-bound pages on SelectMethod wrappers so generated markup stays valid for BWFC controls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix FormView SSR first-render and SessionShim string round-trip - FormView: establish CurrentItem during OnParametersSet() so SSR renders item content on first request - SessionShim: handle raw string session values consistently for cross-request persistence Discovered during WingtipToys migration benchmark Run 39. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add WingtipToys migration benchmark Run 39 25/25 acceptance tests passing. BWFC data controls preserved: - ProductList uses ListView (not manual HTML) - ProductDetails uses FormView (not manual HTML) - ShoppingCart uses GridView (not manual HTML) Total time: 38:34. Gaps found: FormView SSR first-render, SessionShim string round-trip, acceptance-path runtime wiring. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add WingtipToys migration benchmark reports Run 35-38 Run 35: 25/25 tests, 17:34 total Run 36: 25/25 tests, 10:12 total (best time) Run 37: 25/25 tests, 18:39 total Run 38: 25/25 tests, 21:22 total Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add regression tests for FormView SSR and SessionShim round-trip - FormView: verify CurrentItem set during OnParametersSet for SSR - SessionShim: verify string and object values round-trip correctly Prevents regression of bugs discovered in WingtipToys Run 39. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add runtime scaffold detection for benchmark migrations RuntimeDetector scans source for EF contexts, session usage, and Identity pages. ProgramCsEmitter generates matching Program.cs service registrations and middleware. Reusable across all Web Forms migrations, not WingtipToys-specific. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Run Wingtip benchmark 40 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: log Run 40 benchmark results and merge decisions Session: Scribe memory consolidation (2026-05-07T12:43) Decisions merged: 19 inbox files (14026 bytes total) Orchestration log: bishop-run40 entry Session log: run40-benchmark entry Bishop history: summarized from 23915 → 2833 bytes Changes: - Created .squad/decisions/decisions.md (17503 bytes, all decisions consolidated) - Created .squad/orchestration-log/2026-05-07T12-43-bishop-run40.md (2125 bytes) - Created .squad/log/2026-05-07T12-43-run40-benchmark.md (1399 bytes) - Updated .squad/agents/bishop/history.md (summarized, 2833 bytes) - Updated .squad/agents/colossus/history.md (Run 40 team update appended) - Deleted .squad/decisions/inbox/* (19 files) - No deduplication conflicts found Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix BWFC data control template emission for ListView, FormView, GridView Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: log template emission fix session Session: 2026-05-07-template-emission-fix Requested by: Bishop (via Scribe) Changes: - Merged 1 inbox decision: GridView ItemType propagation + ListView context normalization - Created orchestration log: bishop-template-emission-fix - Created session log: template-emission-fix - Updated Bishop history with transform learnings - Updated Colossus history with cross-agent notification - CLI tests: 598 → 603 passing (+5 for template emission fixes) - Commit 1bdbb1f validated in orchestration log * Add CartSessionKeyTransform for stable cart persistence Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add compile-surface quarantine for non-migratable pages Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * WingtipToys migration benchmark Run 41 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix quarantine allowlist, static files, and antiforgery gaps from Run 41 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(ai-team): Scribe memory consolidation Session: 2026-05-07-scribe-memory-consolidation Requested by: Copilot CLI Changes: - Merged 4 inbox files to decisions.md - Deleted merged inbox files - Deduplicated team decisions - Created 4 orchestration log entries (bishop-23, bishop-22, bishop-21, rogue-1) - Updated 6 agent history files with team update - No history summarization needed (all < 15KB) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * WingtipToys migration benchmark Run 42 — 25/25, 22:00, 96% first-pass Run 42 validates quarantine allowlist, static file middleware, and SSR antiforgery fixes from Run 41. Key results: - 25/25 acceptance tests passing - 96% first-pass rate (24/25, only auth redirect needed repair) - 22:00 total time (54% faster than Run 41's 47:54) - Build: 87 initial errors → 0 in single repair round - Quarantine correctly scoped to Admin, Checkout, PayPal pages only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update copilot-instructions.md with CLI, migration toolkit, and migration rules Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add migration benchmark progression and sample complexity ordering - Reorder samples/ in project structure by increasing complexity - Mark WingtipToys as current benchmark focus - Add Migration Benchmark Progression table (WingtipToys → ContosoUniversity → DepartmentPortal) - Note that DepartmentPortal is the most sophisticated future target Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(ai-team): Merge Bishop spawn decisions and logs Session: 2026-05-08-g3-g4-fixes Requested by: Jeff Changes: - Merged inbox decision: Update Copilot migration instructions with CLI and toolkit guidance - Created orchestration log for Bishop spawn (G3/G4 CLI fixes) - Created session log for memory tracking - Cleared decisions/inbox/ * Fix G3 auth redirect scaffold and G4 validator type inference Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Run 43: 25/25 acceptance tests — G3+G4 validated, runtime fixes - G3: Auth redirect scaffold with POST-based LoginHandler/RegisterHandler - G4: RequiredFieldValidator type inference (TextBox→string) - Build repair: 86→0 errors in 2 rounds - Runtime fixes: SQL Server→SQLite, seed data, route aliasing, cart page - New gaps identified: G5 (db provider), G6 (route aliasing), G7 (redirect page quarantine) - 6 screenshots captured, full report at dev-docs/migration-tests/wingtiptoys/run43/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix G6 route aliasing and G7 quarantine bypass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: add FormView DataItem parameter + Content SSR fallback + Run 44 (23/25) - FormView: added DataItem parameter that wraps single item into Items collection, fixing empty rendering for single-record data binding - Content: added ShouldRenderInline fallback for SSR mode (no MasterPage) - Run 44 benchmark: 23/25 acceptance tests passing (92%) - All 2904 BWFC unit tests pass across net8.0/net9.0/net10.0 - Updated AfterWingtipToys sample with latest migration output Remaining failures: - UpdateCartQuantity: BoundField renders read-only (needs TemplateField) - RegisterAndLogin: Auth flow timeout (not BWFC-related) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(ai-team): Merge bishop TemplateField fix decisions; orchestration & session log Session: 2026-05-08-templatefield-fix Requested by: Copilot Changes: - Merged bishop-g3-g4-fixes.md, bishop-g6-g7-fixes.md into decisions.md (2 files) - Wrote orchestration log for CLI TemplateField transform fix (Run 44 regression) - Wrote brief session log for decision merge - decisions.md now 51,720 bytes (scheduled archival next session) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: WingtipToys Run 45 — 25/25 acceptance tests, TemplateField preserved - CLI correctly preserves TemplateField columns (verified: not a CLI bug) - L2 repair maintains TemplateField with editable inputs in ShoppingCart - All 3 TemplateField columns (Quantity/TextBox, Item Total/calc, Remove/CheckBox) intact - Added CLI TemplateField preservation tests (627 CLI tests passing) - 25/25 Playwright acceptance tests pass including cart quantity update - Total runtime: ~14 minutes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(ci): remove WingtipToys tests from CI integration tests WingtipToys acceptance tests require SQL Server and are benchmark tests, not CI tests. They should only run locally via src/WingtipToys.AcceptanceTests. - Remove ProjectReference to AfterWingtipToys from AfterBlazorServerSide.Tests.csproj - Remove WingtipToysAcceptanceTests.cs and WingtipToysPlaywrightFixture.cs - Keep standalone src/WingtipToys.AcceptanceTests/ for local benchmarks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: disable CodeQL on PRs/push, keep manual dispatch only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: disable Squad workflows, keep manual dispatch only All 11 Squad workflows (squad-ci, squad-docs, squad-heartbeat, squad-insider-release, squad-issue-assign, squad-label-enforce, squad-preview, squad-promote, squad-release, squad-triage, sync-squad-labels) now only trigger via workflow_dispatch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a28d88a commit a8cec12

390 files changed

Lines changed: 38158 additions & 4827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 146 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Both should render:
3939
## Technology Stack
4040

4141
- **.NET Version**: .NET 10.0 (see `global.json` for SDK version)
42-
- **Framework**: Blazor (Server-Side and WebAssembly)
42+
- **Framework**: Blazor (migration target is .NET 10 static SSR; samples also include Server-Side and WebAssembly)
4343
- **Project Type**: Razor Class Library (`Microsoft.NET.Sdk.Razor`)
4444
- **Testing Framework**: xUnit with bUnit for Blazor component testing
4545
- **Assertion Library**: Shouldly
@@ -51,14 +51,32 @@ Both should render:
5151

5252
```
5353
/docs -- User documentation (MkDocs)
54-
/samples -- Usage samples
54+
/samples -- Usage samples and migration benchmarks (ordered by complexity ↓)
5555
BeforeWebForms/ -- Original Web Forms sample (.NET Framework)
56-
AfterBlazorServerSide/ -- Blazor Server-Side samples
57-
AfterBlazorClientSide/ -- Blazor WebAssembly samples
56+
AfterBlazorServerSide/ -- Blazor Server-Side component samples
57+
AfterBlazorServerSide.Tests/ -- Playwright tests for the sample app
58+
AfterBlazorClientSide/ -- Blazor WebAssembly component samples
5859
SharedSampleObjects/ -- Shared models/data for samples
60+
WingtipToys/ -- ★ Current benchmark focus — e-commerce app (products, cart, checkout, identity)
61+
AfterWingtipToys/ -- Migrated WingtipToys output (cleared + regenerated each benchmark run)
62+
ContosoUniversity/ -- Next benchmark — university CRUD app (EF, master-detail, search)
63+
AfterContosoUniversity/ -- Migrated Contoso University output
64+
DepartmentPortal/ -- Most complex benchmark — multi-page portal (advanced data binding, nested controls)
65+
AfterDepartmentPortal/ -- Migrated DepartmentPortal output
5966
/src
6067
BlazorWebFormsComponents/ -- Main component library
6168
BlazorWebFormsComponents.Test/ -- Unit tests with bUnit
69+
BlazorWebFormsComponents.Analyzers/ -- Roslyn analyzers
70+
BlazorWebFormsComponents.Analyzers.Test/ -- Analyzer tests
71+
BlazorWebFormsComponents.Cli/ -- Web Forms to Blazor CLI pipeline and scaffolding
72+
BlazorAjaxToolkitComponents/ -- AJAX Toolkit component library
73+
WingtipToys.AcceptanceTests/ -- WingtipToys Playwright acceptance suite
74+
ContosoUniversity.AcceptanceTests/ -- ContosoUniversity Playwright acceptance suite
75+
/tests
76+
BlazorWebFormsComponents.Cli.Tests/ -- CLI transform and pipeline tests
77+
/migration-toolkit -- Wrapper scripts, skills, methodology, and benchmark helpers
78+
scripts/ -- bwfc-migrate.ps1, bwfc-scan.ps1, and compatibility wrappers
79+
skills/ -- bwfc-migration, bwfc-identity-migration, bwfc-data-migration, migration-standards, l3-performance-optimization
6280
```
6381

6482
## Component Architecture
@@ -288,6 +306,29 @@ When testing component properties or state, use `FindComponent<T>()`:
288306
5. **No ViewState**: Store state in private fields or session (ViewState property exists but is syntax-only)
289307
6. **PostBack Compatibility**: `WebFormsPageBase` provides `IsPostBack`, `PostBack` event, and `__doPostBack()` JS interop bridge
290308

309+
## Migration Rules
310+
311+
These are hard rules for migration work in this repository:
312+
313+
1. **Use the toolkit entry point**: Start project migrations with `migration-toolkit/scripts/bwfc-migrate.ps1` or the `webforms-to-blazor migrate` CLI it forwards to. Do not invent ad hoc regex converters or one-off migration scripts.
314+
2. **Always target Blazor static SSR**: Generated apps target .NET 10 static server-side rendering. Do not switch the whole app to interactive Blazor Server; only opt into interactive render modes deliberately and per page.
315+
3. **Trust the shims**: `WebFormsPageBase` preserves `Page.Request`, `Page.Response`, `Page.Session`, `Page.Server`, `Page.Cache`, `Page.ClientScript`, `IsPostBack`, and `ViewState`. Keep migrated code-behind compiling against those shims instead of rewriting to native ASP.NET Core services during Layer 1 or Layer 2 work.
316+
4. **Preserve BWFC data controls**: Never replace `ListView`, `FormView`, `GridView`, `DataList`, or `Repeater` with manual HTML tables or divs. Fix the generated BWFC markup, templates, item types, or child components instead.
317+
5. **Register transforms twice**: Every new CLI transform must be registered in both `src/BlazorWebFormsComponents.Cli/Program.cs` DI and `tests/BlazorWebFormsComponents.Cli.Tests/TestHelpers.cs` so the runtime pipeline and isolated test pipeline stay aligned.
318+
6. **Respect quarantine boundaries**: `PageQuarantineDetector` should quarantine non-essential `Account/`, `Admin/`, `Checkout/`, mobile, payment, or compile-surface blocker pages, but benchmark-critical home, about, contact, product, catalog, and cart flows stay on the runnable path whenever possible.
319+
320+
### Migration Benchmark Progression
321+
322+
The `samples/` folder contains benchmark apps ordered by increasing complexity. Each app exercises more of the CLI and BWFC component surface:
323+
324+
| Sample | Complexity | Key Challenges | Status |
325+
|--------|-----------|----------------|--------|
326+
| **WingtipToys** | ★★☆ | E-commerce: products, cart, checkout, identity, EF data binding | **Current focus** — active benchmark runs |
327+
| **ContosoUniversity** | ★★☆ | University CRUD: master-detail, search, EF migrations | Acceptance tests exist |
328+
| **DepartmentPortal** | ★★★ | Multi-page portal: advanced data binding, nested controls, complex layouts | Future target — most sophisticated |
329+
330+
Always complete the current benchmark focus before moving to the next. Improvements to the CLI and toolkit should be validated against the current focus app first, then regression-tested against simpler samples.
331+
291332
## Migration Shims
292333

293334
The library provides compile-compatibility shims on `WebFormsPageBase` so migrated code-behind compiles unchanged:
@@ -314,6 +355,81 @@ When adding new components:
314355
4. Add sample page in `/samples/AfterBlazorServerSide/Pages/ControlSamples/`
315356
5. Document in `/docs/` folder (see Documentation Requirements below)
316357

358+
## Migration CLI & Toolkit
359+
360+
### Primary Entry Points
361+
362+
- `src/BlazorWebFormsComponents.Cli/Program.cs` defines the `webforms-to-blazor` CLI entry point and command surface (`migrate`, `convert`, `prescan`, `scan`, `assets extract`, `edmx convert`).
363+
- `migration-toolkit/scripts/bwfc-migrate.ps1` is the supported migration-toolkit wrapper. It resolves the CLI project and forwards to `migrate` or `prescan` instead of maintaining a separate regex pipeline.
364+
- The migration-toolkit skill set currently includes `bwfc-migration`, `bwfc-identity-migration`, `bwfc-data-migration`, `migration-standards`, and `l3-performance-optimization`.
365+
366+
### Pipeline Overview
367+
368+
`MigrationPipeline` orchestrates the full migration sequence:
369+
370+
1. `ProjectScaffolder` generates the .NET 10 Blazor static SSR scaffold unless `--skip-scaffold` is used.
371+
2. `WebConfigTransformer` converts `Web.config` settings into `appsettings.json`.
372+
3. Ordered markup transforms run first.
373+
4. Ordered code-behind transforms run second.
374+
5. `SemanticPatternCatalog` applies higher-level page rewrites.
375+
6. `PageQuarantineDetector` performs a late compile-surface pass and writes `migration-artifacts/quarantine-manifest.json` when pages must be stubbed.
376+
7. Static assets, source files, App_Start artifacts, NuGet assets, EDMX output, and redirect annotations are copied or generated.
377+
378+
The CLI currently has **24 core markup transforms plus directive/infrastructure markup passes** and **27 code-behind transforms** wired through `Program.cs`.
379+
380+
### Transform Registration Pattern
381+
382+
When adding a transform:
383+
384+
1. Create the transform class in `src/BlazorWebFormsComponents.Cli/Transforms/`.
385+
2. Register it in `BuildServiceProvider()` in `src/BlazorWebFormsComponents.Cli/Program.cs`.
386+
3. Add it to `CreateDefaultPipeline()` in `tests/BlazorWebFormsComponents.Cli.Tests/TestHelpers.cs`.
387+
4. Add or update focused transform tests and pipeline coverage.
388+
389+
```csharp
390+
// Program.cs
391+
services.AddSingleton<IMarkupTransform, MyNewTransform>();
392+
393+
// TestHelpers.cs
394+
var markupTransforms = new List<IMarkupTransform>
395+
{
396+
new MyNewTransform(),
397+
};
398+
```
399+
400+
### Scaffolding System
401+
402+
- `RuntimeDetector` aggregates runtime signal detectors for Entity Framework, session, identity, and `Global.asax` usage.
403+
- `ProjectScaffolder` generates the project file, `_Imports.razor`, `Components/App.razor`, `Components/Routes.razor`, `Components/Layout/MainLayout.razor`, and launch settings.
404+
- `ProgramCsEmitter` generates `Program.cs` for .NET 10 static SSR, including `AddRazorComponents()`, `AddBlazorWebFormsComponents()`, `UseStaticFiles()`, and `UseAntiforgery()`.
405+
- `DatabaseProviderDetector` and `WebConfigTransformer` carry forward database provider and connection-string wiring.
406+
407+
### Quarantine System
408+
409+
- `PageQuarantineDetector` creates build-safe placeholder pages for compile-surface blockers and emits a manifest under `migration-artifacts/quarantine-manifest.json`.
410+
- Essential benchmark pages (home, about, contact, product, catalog, shopping cart, add-to-cart flows) are exempt from incidental quarantine signals.
411+
- Quarantined pages keep stub `.razor` and `.razor.cs` files plus the transformed original code-behind as an artifact for later Layer 2 or Layer 3 repair.
412+
413+
### Acceptance Test Suites
414+
415+
Use these suites as the migration quality gate for benchmark apps:
416+
417+
```bash
418+
# WingtipToys migrated app
419+
# Set WINGTIPTOYS_BASE_URL first if the app is not on https://localhost:5001
420+
421+
dotnet build src/WingtipToys.AcceptanceTests
422+
pwsh src/WingtipToys.AcceptanceTests/bin/Debug/net10.0/playwright.ps1 install chromium
423+
dotnet test src/WingtipToys.AcceptanceTests
424+
425+
# ContosoUniversity benchmark/original app
426+
# Set CONTOSO_BASE_URL first if the app is not on http://localhost:44380
427+
428+
dotnet build src/ContosoUniversity.AcceptanceTests
429+
pwsh src/ContosoUniversity.AcceptanceTests/bin/Debug/net10.0/playwright.ps1 install chromium
430+
dotnet test src/ContosoUniversity.AcceptanceTests
431+
```
432+
317433
## Documentation Requirements
318434

319435
**IMPORTANT**: All features, fixes, and new components MUST include documentation updates.
@@ -372,10 +488,33 @@ dotnet build
372488
# Run tests
373489
dotnet test
374490

491+
# Run CLI tests
492+
dotnet test tests/BlazorWebFormsComponents.Cli.Tests
493+
494+
# Prescan a Web Forms app
495+
dotnet run --project src/BlazorWebFormsComponents.Cli -- prescan -i samples/WingtipToys
496+
497+
# Run the migration CLI
498+
dotnet run --project src/BlazorWebFormsComponents.Cli -- migrate -i samples/WingtipToys -o samples/AfterWingtipToys
499+
375500
# Run server-side samples
376501
dotnet run --project samples/AfterBlazorServerSide
377502
```
378503

504+
### Acceptance Test Commands
505+
506+
```bash
507+
# WingtipToys migrated app (set WINGTIPTOYS_BASE_URL first if needed)
508+
dotnet build src/WingtipToys.AcceptanceTests
509+
pwsh src/WingtipToys.AcceptanceTests/bin/Debug/net10.0/playwright.ps1 install chromium
510+
dotnet test src/WingtipToys.AcceptanceTests
511+
512+
# ContosoUniversity benchmark/original app (set CONTOSO_BASE_URL first if needed)
513+
dotnet build src/ContosoUniversity.AcceptanceTests
514+
pwsh src/ContosoUniversity.AcceptanceTests/bin/Debug/net10.0/playwright.ps1 install chromium
515+
dotnet test src/ContosoUniversity.AcceptanceTests
516+
```
517+
379518
## Key Interfaces
380519

381520
- `IStyle` - Styling properties (BackColor, ForeColor, CssClass, etc.)
@@ -544,7 +683,9 @@ When making changes, ensure all related files are updated:
544683
| **Existing component modified** | Unit tests in `src/BlazorWebFormsComponents.Test/ComponentName/`, sample page if behavior changed, `docs/Category/ComponentName.md` if API changed |
545684
| **New migration shim added** | Shim class in `src/BlazorWebFormsComponents/`, register in `ServiceCollectionExtensions.cs` via `AddBlazorWebFormsComponents()`, update `docs/Migration/` guide, update `copilot-instructions.md` Migration Shims section |
546685
| **Base class changed** (`BaseWebFormsComponent`, `BaseStyledComponent`, `DataBoundComponent`) | Check all components inheriting from it — changes cascade to every component. Run full test suite. |
547-
| **CLI transform added** | Transform in `src/BlazorWebFormsComponents.Cli/`, test in `tests/BlazorWebFormsComponents.Cli.Tests/`, update `docs/cli/transforms.md`, update `docs/cli/index.md` transform count |
686+
| **CLI transform added** | Transform in `src/BlazorWebFormsComponents.Cli/Transforms/`, register it in `src/BlazorWebFormsComponents.Cli/Program.cs` and `tests/BlazorWebFormsComponents.Cli.Tests/TestHelpers.cs`, add or update transform tests, update `docs/cli/transforms.md`, update `docs/cli/index.md` transform count |
687+
| **CLI scaffolding/runtime changed** | Files in `src/BlazorWebFormsComponents.Cli/Scaffolding/` or `Pipeline/`, matching tests in `tests/BlazorWebFormsComponents.Cli.Tests/`, `migration-toolkit/README.md` or methodology docs if operator workflow changes, and `.github/copilot-instructions.md` if migration guidance changes |
688+
| **Migration toolkit wrapper or skill changed** | Matching files in `migration-toolkit/scripts/` or `migration-toolkit/skills/`, relevant `docs/Migration/` or `docs/cli/` pages, and `.github/copilot-instructions.md` when the recommended migration workflow changes |
548689
| **Analyzer rule added** | Rule in `src/BlazorWebFormsComponents.Analyzers/`, test in `src/BlazorWebFormsComponents.Analyzers.Test/`, update `docs/Analyzers/` |
549690
| **Target framework changed** | `Directory.Build.props` (version properties), all `.csproj` files (`TargetFrameworks`), `global.json`, `.github/workflows/build.yml` (dotnet-version), `.github/copilot-setup-steps.yml` |
550691
| **Documentation added/changed** | `docs/` markdown file, `mkdocs.yml` (`nav:` entry if new), verify local build passes with `docker run --rm -v "$(pwd):/docs" mkdocs build --strict` |

.github/skills/wingtip-migration-test/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Focus on:
128128

129129
- Keeping the generated project shape in `samples\AfterWingtipToys\`
130130
- Preserving Web Forms semantics through BWFC shims where available
131+
- **NEVER replace generated BWFC data controls (`ListView`, `FormView`, `GridView`, `DataList`, `Repeater`) with manual HTML. Fix the generated markup to work with the BWFC component instead.**
131132
- Fixing build errors iteratively until the app runs cleanly enough for acceptance validation
132133
- Treating the migration toolkit as the thing under test; manual fixes should be documented as toolkit gaps
133134

.github/workflows/codeql.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,6 @@
11
name: "CodeQL Security Scanning"
22

33
on:
4-
push:
5-
branches:
6-
- 'main'
7-
- 'dev'
8-
- 'v*'
9-
paths:
10-
- 'src/**'
11-
- 'samples/**'
12-
- 'tests/**'
13-
- '.github/workflows/codeql.yml'
14-
- 'global.json'
15-
- 'Directory.Build.props'
16-
- 'nuget.config'
17-
pull_request:
18-
branches:
19-
- 'main'
20-
- 'dev'
21-
- 'v*'
22-
paths:
23-
- 'src/**'
24-
- 'samples/**'
25-
- 'tests/**'
26-
- '.github/workflows/codeql.yml'
27-
- 'global.json'
28-
- 'Directory.Build.props'
29-
- 'nuget.config'
30-
schedule:
31-
# Run every Monday at 6:00 UTC
32-
- cron: '0 6 * * 1'
334
workflow_dispatch:
345

356
jobs:

.github/workflows/squad-ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@ name: Squad CI
22
# dotnet project — configure build/test commands below
33

44
on:
5-
pull_request:
6-
branches: [dev, preview, main, insider]
7-
types: [opened, synchronize, reopened]
8-
push:
9-
branches: [dev, insider]
10-
11-
permissions:
12-
contents: read
5+
workflow_dispatch:
136

147
jobs:
158
test:

.github/workflows/squad-docs.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@ name: Squad Docs — Build & Deploy
33

44
on:
55
workflow_dispatch:
6-
push:
7-
branches: [preview]
8-
paths:
9-
- 'docs/**'
10-
- '.github/workflows/squad-docs.yml'
11-
12-
permissions:
13-
contents: read
14-
pages: write
15-
id-token: write
166

177
jobs:
188
build:

.github/workflows/squad-heartbeat.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,8 @@ name: Squad Heartbeat (Ralph)
77
# Run 'squad upgrade' to sync installed copies from source templates.
88

99
on:
10-
# React to completed work or new squad work
11-
issues:
12-
types: [closed, labeled]
13-
pull_request:
14-
types: [closed]
15-
16-
# Manual trigger
1710
workflow_dispatch:
1811

19-
permissions:
20-
issues: write
21-
contents: read
22-
pull-requests: read
23-
2412
jobs:
2513
heartbeat:
2614
runs-on: ubuntu-latest

.github/workflows/squad-insider-release.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ name: Squad Insider Release
22
# dotnet project — configure build, test, and insider release commands below
33

44
on:
5-
push:
6-
branches: [insider]
7-
8-
permissions:
9-
contents: write
5+
workflow_dispatch:
106

117
jobs:
128
release:

.github/workflows/squad-issue-assign.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: Squad Issue Assign
22

33
on:
4-
issues:
5-
types: [labeled]
6-
7-
permissions:
8-
issues: write
9-
contents: read
4+
workflow_dispatch:
105

116
jobs:
127
assign-work:

.github/workflows/squad-label-enforce.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: Squad Label Enforce
22

33
on:
4-
issues:
5-
types: [labeled]
6-
7-
permissions:
8-
issues: write
9-
contents: read
4+
workflow_dispatch:
105

116
jobs:
127
enforce:

.github/workflows/squad-preview.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ name: Squad Preview Validation
22
# dotnet project — configure build, test, and validation commands below
33

44
on:
5-
push:
6-
branches: [preview]
7-
8-
permissions:
9-
contents: read
5+
workflow_dispatch:
106

117
jobs:
128
validate:

0 commit comments

Comments
 (0)