Skip to content

Commit ae505ca

Browse files
csharpfritzCopilot
andauthored
feat(cli): migration benchmark speedups — reduce L2 repair time (FritzAndFriends#553)
* feat(cli): migration benchmark speedups — reduce L2 repair time Five CLI improvements targeting the biggest L2 time sinks identified in WTT Run 87 and CU Run 24: 1. Fix quarantine over-triggering: Remove System.Configuration from LegacyHelperStubTransform trigger regex. BWFC provides a ConfigurationManager shim, so files using it should not be stubbed. 2. ConfigurationManager ambiguity: Use a using alias to disambiguate between BlazorWebFormsComponents.ConfigurationManager and Microsoft.Extensions.Configuration.ConfigurationManager in .NET 10. Strip comments before detecting usage to avoid matching TODO text. 3. AJAX Toolkit auto-wiring: Add AjaxToolkitRuntimeSignalDetector that detects <ajaxToolkit: prefixes, adds project reference to BlazorAjaxToolkitComponents, injects @using into _Imports.razor, and adds using directive to code-behind for component ref fields. 4. GridView paging EventArgs mapping: Map GridViewPageEventArgs, DetailsViewPageEventArgs, FormViewPageEventArgs, and ListViewPageEventArgs to BWFC's PageChangedEventArgs. 5. System.Data.SqlClient detection: Add SqlClientRuntimeSignalDetector that adds the System.Data.SqlClient NuGet package when usage is detected in source files. Test results: 841 passing, 0 failing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): Add CU migration automation transforms and home page detection - DataSourceParameterBindingTransform: Detects ref?.DataSource = expr pattern in OnInitializedAsync, refactors to backing field + markup parameter binding - StaticItemsParameterBindingTransform: Detects ref?.StaticItems.Add() in OnInit, refactors to ListItemCollection backing field + parameter binding - DefaultPageRuntimeSignalDetector: Detects Default/Home/Index.aspx for root redirect (skips redirect when PageDirectiveTransform already adds @page '/') - PageDirectiveTransform: Add /Home to home page detection (joins Default/Index) - DbContextInstantiationTransform: Preserve original variable names instead of generating _camelCase names from type (minimizes code rewrites) - ProgramCsEmitter: Emit app.MapGet('/') redirect for non-standard home pages - Update tests to match new variable name preservation behavior All 841 CLI tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: per-page WebFormsForm wrapping and Button type=button default - Add PageFormWrapperTransform (Order 930) that wraps all page content in <WebFormsForm> to replicate Web Forms form behavior - Change Button.UseSubmitBehavior default from true to false so buttons don't accidentally submit forms (type='button' instead of 'submit') - Update ActionPagesSemanticPattern to handle AntiforgeryToken in inert-markup detection - Update all component tests for new Button default type - Regenerate L1 expected test data with WebFormsForm wrapping Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: handle null DataSource gracefully and add EnableCaching to AutoCompleteExtender - DataBoundComponent.GetDataSource() now returns empty collection for null instead of throwing InvalidOperationException - AutoCompleteExtender gains EnableCaching parameter (real AJAX Toolkit property) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: add name attribute to DropDownList for form POST support DropDownList now renders a 'name' attribute on the <select> element, matching TextBox behavior. Uses the FormNamingContext cascading parameter for proper Web Forms-compatible UniqueID generation within GridView rows. This enables DropDownList values to be submitted via standard HTML form POST, which is required for static SSR scenarios. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): CU L2 repair — form POST for Add/Delete, StaticItems binding Students page: - Replaced WebFormsForm with native <form> for static SSR form handling - Added ID to TextBox components for name attribute generation - Added ID to DropDownList for form POST of selected course - Replaced CommandField Delete with TemplateField submit buttons - Added [SupplyParameterFromForm] properties for insert/delete POST data - Insert and Delete now work via standard form POST (no JS/interactivity) Other pages: - Removed lowercase id= from BWFC components (CLI bug workaround) - Added StaticItems parameter binding for Courses/Students dropdowns - Added @page /Home dual route and PageTitle - Fixed DbContext constructor and EF model configurations Result: 37/40 acceptance tests pass (3 About page failures are pre-existing data issue with duplicate enrollment date dictionary key) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): WTT Run 91 L2 repairs — 26/26 acceptance tests pass Fixes applied after L1 migration (647 transforms, 0 errors): - Added missing 'using WingtipToys.Logic' to Account pages and PayPalFunctions - Fixed stale 'actions' variable reference in ShoppingCart.razor.cs - Fixed ExceptionUtility.cs static method using instance field Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): CU Run 28 L2 repairs — 35/40 acceptance tests pass L1 migration: 5 files, 139 transforms, 0 errors. L2 repairs: - Removed duplicate Enrollmet_Logic from Models/ (kept BLL version) - Passed injected DbContext to BLL constructors - Converted Students/About GridViews from SelectMethod to Items binding - Fixed AutoCompleteExtender ID attribute (component doesn't support it) - Fixed About page duplicate dictionary key on enrollment dates - Converted Students form to native POST with SupplyParameterFromForm - Added Clear button as form submit action - Added database seed data for initial population - Fixed DropDownList StaticItems binding for courses - Added /Home dual route Remaining 5 failures: Students GridView data join (needs enrollments in DB), AddNewStudent form, Clear button, DetailsView search, About GridView columns. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: update L1 transform test expectations for new transforms Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): CU Run 29 L2 repairs — 40/40 acceptance tests pass Fixes: - Fix DetailsView search to support single-word queries (search by first OR last name contains, not just exact first+last match) - Fix form field names: SupplyParameterFromForm names now match rendered name attributes with tabAddStud$ prefix from naming container - Remove premature _studentData_DataSource = null that wiped search results - Add second department (Mathematics) to seed data for dropdown test - Fix Enrollmet_Logic to use client-side evaluation for GroupBy query (prevents EF Core translation issues with ToShortDateString) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * benchmark: WTT Run 92 (26/26) + CU Run 29 (40/40) — both 100% pass WingtipToys Run 92: - L1: 24s, 647 transforms, 0 errors - L2: 3 fixes (missing usings, variable name, static field) - Result: 26/26 acceptance tests pass ContosoUniversity Run 29: - L1: 7s, 139 transforms, 0 errors - L2: Build repair (19 errors) + runtime fixes (form POST, seed, search) - Result: 40/40 acceptance tests pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): add ServiceConstructorWiring + ButtonToSubmit transforms - ServiceConstructorWiringTransform (Order 108): converts new BllClass() instantiations in page code-behind to [Inject] DI properties - ButtonToSubmitTransform (Order 945): converts <Button> to <input submit> inside plain <form method=post> (excludes WebFormsForm pages) - Registered in both Program.cs and TestHelpers.cs - All 841 CLI tests pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): CU Run 30 + WTT Run 93 — both 100% pass CU: 40/40 tests (L1 6.3s, 143 transforms, 1 build error after L1) WTT: 26/26 tests (L1 9.3s, 647 transforms, 4 build errors after L1) New ServiceConstructorWiringTransform eliminated BLL constructor manual fixes — classes auto-injected via DI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): reduce L2 errors — fix Include scoping, duplicate classes, dead code, namespace usings - EagerLoadNavigationTransform: add 'Key' to NonNavPropertyNames exclusion list, scope Strategy 3 (LINQ query syntax) includes to only nav props actually accessed in the specific query statement (prevents spurious .Include(x => x.Student) on unrelated DbSets) - SourceFileCopier: detect same-name classes across different namespaces (Models/ vs BLL/) and skip the Models copy to prevent CS0104 ambiguity - EventHandlerSignatureTransform: fix call sites when method signature changes from (object sender, EventArgs e) to (EventArgs e) — updates internal calls too - DeadControlTreeCodeTransform (NEW, Order 710): comments out Web Forms control-tree access patterns (Table.Rows, TableRow.Cells, Controls[]) that can't compile in Blazor - ItemsAddToDataSourceTransform (NEW, Order 715): converts foreach+Items.Add() loops to DataSource assignment pattern - ProjectNamespaceUsingTransform (NEW, Order 102): adds using directives for project sub-namespaces (Logic/, BLL/, Services/) to source files - ProjectScaffolder: auto-detect sub-namespace directories and add @using to _Imports.razor - DbContextInstantiationTransform: replace references to removed variable names with the injected field name (fixes 'actions' → 'usersShoppingCart' rename) Results: CU builds with 0 errors from CLI (was 14). WTT down to 1 error (was 4). All 841 CLI tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: Add Wizard component for multi-step navigation Implements the ASP.NET Web Forms Wizard control as a Blazor component: - Wizard and WizardStep components with table-based HTML output - WizardStepType enum (Auto, Start, Step, Finish, Complete) - WizardNavigationEventArgs with Cancel support - Navigation buttons auto-determined by step position - Sidebar with step titles and clickable navigation - AllowReturn support (skips steps on Previous) - FinishDestinationPageUrl/CancelDestinationPageUrl - Style properties: NavigationButtonStyle, SideBarStyle, HeaderStyle, StepStyle - Templates: HeaderTemplate, SideBarTemplate - Events: OnNextButtonClick, OnPreviousButtonClick, OnFinishButtonClick, OnCancelButtonClick, OnActiveStepChanged, OnSideBarButtonClick - bUnit tests covering navigation, events, and visibility - Sample page and MkDocs documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: Enhance Wizard documentation and expand live sample page - Expand docs/NavigationControls/Wizard.md with full property tables, events reference, WizardStepType enum details, navigation behavior, AllowReturn mechanics, and 5 progressive usage examples - Expand sample page with 6 demo scenarios: basic wizard, no sidebar, AllowReturn restriction, cancel button, custom button text, and header template - Add Wizard to ComponentList.razor and ComponentCatalog.cs for navigation discovery Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(tests): update Playwright selectors for Button type='button' default The Button component's UseSubmitBehavior was changed to default to false (commit db21ba2), rendering <input type='button'> instead of <input type='submit'>. Update all Playwright test selectors to match both type='button' and type='submit' to fix 5 CI failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b5b813e commit ae505ca

262 files changed

Lines changed: 7470 additions & 2843 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.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ There are a significant number of controls in ASP.NET Web Forms, and we will foc
138138
- [Menu](docs/NavigationControls/Menu.md)
139139
- [SiteMapPath](docs/NavigationControls/SiteMapPath.md)
140140
- [TreeView](docs/NavigationControls/TreeView.md)
141+
- [Wizard](docs/NavigationControls/Wizard.md)
141142
- Login Controls
142143
- [ChangePassword](docs/LoginControls/ChangePassword.md)
143144
- [CreateUserWizard](docs/LoginControls/CreateUserWizard.md)
1.18 MB
Loading
1.77 MB
Loading
1.17 MB
Loading
1.25 MB
Loading
1.23 MB
Loading
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# ContosoUniversity Migration Test — Run 25
2+
3+
## Run Metadata
4+
5+
| Field | Value |
6+
|-------|-------|
7+
| Date | 2026-05-18 |
8+
| Branch | `feature/migration-benchmark-speedups` |
9+
| Operator | Copilot CLI |
10+
| Goal | ≤ 4 minutes total migration time |
11+
12+
## Paths
13+
14+
| Item | Path |
15+
|------|------|
16+
| Web Forms source | `samples/ContosoUniversity/` |
17+
| Blazor output | `samples/AfterContosoUniversity/` |
18+
| Toolkit entry point | `migration-toolkit/scripts/bwfc-migrate.ps1` |
19+
| Acceptance tests | `src/ContosoUniversity.AcceptanceTests/` |
20+
21+
## Results Summary
22+
23+
| Metric | Result |
24+
|--------|--------|
25+
| **Total wall-clock** | ~29 min (includes investigation) |
26+
| **L1 duration** | ~23s |
27+
| **L2 manual fixes** | ~28 min |
28+
| **Final build** | ✅ Succeeded (0 errors) |
29+
| **Acceptance tests** | **38/40 passed** (95%) |
30+
| **Failed tests** | 2 (interactive form mutation — static SSR limitation) |
31+
32+
## Phase 1: Layer 1 — Toolkit Run
33+
34+
```
35+
Files written: 53
36+
Transforms applied: 127
37+
Errors: 0
38+
Duration: ~23 seconds
39+
```
40+
41+
L1 produced a clean scaffold with all pages, BLL classes, models, and static assets. No quarantine issues thanks to the fix in this branch (LegacyHelperStubTransform no longer stubs BLL files).
42+
43+
## Phase 2: Layer 2 — Skill-Guided Repair
44+
45+
### Build Errors Resolved
46+
47+
| Category | Count | Fix |
48+
|----------|-------|-----|
49+
| `contextObj``_contosoUniversityEntities` | 16 | BLL classes used wrong variable name |
50+
| BLL constructor params | 4 | Missing DB context parameter |
51+
| Duplicate `Enrollmet_Logic` class | 1 | Deleted Models copy, kept BLL version |
52+
| `btnSearchCourse_Click` signature | 1 | Changed from 2 args to 1 `EventArgs` |
53+
| `Table.Rows/Cells` pattern | 1 | Replaced with direct field resets |
54+
| `Items.Add``StaticItems.Add` | 2 | BWFC DropDownList uses StaticItems |
55+
| Missing `[Inject]` + using | 2 | About.razor.cs and Instructors.razor.cs |
56+
| Unsupported AutoCompleteExtender attrs | 4 | Removed `id`, `EnableCaching`, `CompletionSetCount`, `ShowOnlyCurrentWordInCompletionListItem` |
57+
| Duplicate dictionary key | 1 | Added ContainsKey check in Enrollmet_Logic |
58+
59+
### Runtime/Test Fixes
60+
61+
| Issue | Fix |
62+
|-------|-----|
63+
| No root "/" page | Added `MapGet("/", () => Results.Redirect("/Home"))` |
64+
| Missing `<title>` | Added to `Components/App.razor` |
65+
| Empty Instructors GridView | Moved data to backing field + `DataSource` parameter binding |
66+
| Empty Courses dropdown | Used `ListItemCollection` bound via `StaticItems` parameter |
67+
| No seed data | Added seed block in Program.cs (Departments, Instructors, Students, Courses, Enrollments) |
68+
| Port mismatch | Changed launchSettings to 44380/44381 (matching acceptance tests) |
69+
70+
## Phase 3: Acceptance Test Results
71+
72+
```
73+
Total tests: 40
74+
Passed: 38
75+
Failed: 2
76+
```
77+
78+
### Passing Test Categories (38/40)
79+
80+
- ✅ Navigation (10/10): All pages return 200, all nav links work
81+
- ✅ Home (4/4): Branding, footer, welcome text
82+
- ✅ About (5/5): GridView with enrollment statistics
83+
- ✅ Instructors (5/5): GridView, columns, sorting, data display
84+
- ✅ Courses (5/6): Loads, dropdown, grid columns, search, pagination, department filter
85+
- ✅ Students (6/8): Loads, grid data, columns, search, clear, edit, details
86+
87+
### Failed Tests (2/40) — Static SSR Limitation
88+
89+
| Test | Reason |
90+
|------|--------|
91+
| `StudentsPage_AddNewStudentFormWorks` | Button click fires but TextBox.Text is null in static SSR (no two-way binding without form POST) |
92+
| `StudentsPage_DeleteStudentWorks` | CommandField delete requires interactive render mode |
93+
94+
These tests require server-side event handlers that mutate data. In static SSR, BWFC Button components render as submit buttons but without a `<form>` wrapping mechanism, the click doesn't trigger a server roundtrip. This is a known limitation that would be resolved by wrapping the form in `<WebFormsForm>` with interactive render mode on a per-page basis.
95+
96+
## What Worked Well
97+
98+
1. **LegacyHelperStubTransform fix** — BLL files no longer stubbed, saving major L2 repair time
99+
2. **ConfigurationManager using alias** — Compiles cleanly without manual intervention
100+
3. **SqlClient package auto-detection**`Microsoft.Data.SqlClient` added to project automatically
101+
4. **EDMX-to-EF scaffolding** — Models and DbContext generated correctly
102+
5. **Master page → layout migration** — Nav structure preserved perfectly
103+
6. **Static asset copying** — CSS, JS, jQuery files all in place
104+
7. **GridView with BoundField columns** — Renders correctly with DataSource binding
105+
8. **AutoCompleteExtender** — Basic functionality works (search by name)
106+
9. **Sorting via GridView events**`OnSorting` works with ViewState-based direction toggling
107+
108+
## What Did Not Work Well (CLI Gaps)
109+
110+
1. **`@ref` DataSource assignment in OnInitializedAsync** — Component refs are null during initialization; CLI should generate DataSource as parameter binding in markup or use backing fields
111+
2. **DropDownList StaticItems population** — Code-behind pattern `this.dropdown?.StaticItems.Add()` doesn't work in OnInitializedAsync; should use `StaticItems` parameter binding
112+
3. **Variable naming** — CLI generates `_contosoUniversityEntities` but BLL code uses `contextObj`; naming should match original
113+
4. **Duplicate class detection**`Enrollmet_Logic` existed in both `Models/` and `BLL/`; CLI should detect and skip duplicates
114+
5. **Seed data** — App requires seed data to function; CLI could detect INSERT scripts or suggest seed patterns
115+
6. **Root URL handling** — No page at "/" causes 404; CLI should generate a redirect to the default page
116+
7. **LaunchSettings port** — Generated ports don't match acceptance test expectations
117+
8. **Interactive form operations** — Add/Delete require interactive mode; CLI could wrap mutation forms in `<WebFormsForm>` automatically
118+
119+
## Screenshots
120+
121+
### Home Page
122+
![Home](images/01-home.png)
123+
124+
### Students Page
125+
![Students](images/02-students.png)
126+
127+
### Courses Page
128+
![Courses](images/03-courses.png)
129+
130+
### Instructors Page
131+
![Instructors](images/04-instructors.png)
132+
133+
### About Page
134+
![About](images/05-about.png)
135+
136+
## Comparison to Previous Run
137+
138+
| Metric | Run 24 | Run 25 | Delta |
139+
|--------|--------|--------|-------|
140+
| L1 time | ~25s | ~23s | -2s |
141+
| L2 errors | 45+ | 32 | -13 |
142+
| Tests passing | 21/40 | 38/40 | +17 |
143+
| Total time | ~13 min | ~29 min* ||
144+
145+
*Run 25 total time is higher due to debugging the `@ref` null pattern and dropdown binding, which are now documented as CLI gaps for future improvement. With these patterns automated in the CLI, subsequent runs should achieve the 4-minute target.
146+
147+
## Recommendations for Next Iteration
148+
149+
1. **Generate DataSource as parameter binding** — Instead of `this.grid?.DataSource = data`, emit `DataSource="@_data"` in markup with a backing field
150+
2. **Generate ListItemCollection binding** — For DropDownList population, emit `StaticItems="@_items"` pattern
151+
3. **Detect BLL variable names** — Match generated DI field names to what BLL classes actually use
152+
4. **Add root redirect** — Auto-generate `MapGet("/")` redirect when a default page exists
153+
5. **Dedup class detection** — Warn or skip when the same class appears in multiple folders
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ContosoUniversity Migration - Run 26
2+
3+
## Summary
4+
5+
| Metric | Value |
6+
|--------|-------|
7+
| Date | 2026-05-18 |
8+
| Branch | `feature/migration-benchmark-speedups` |
9+
| Total Runtime | ~8 min |
10+
| Build Result | ✅ 0 errors (after L2 repair) |
11+
| Acceptance Tests | **36/40 pass** |
12+
13+
## What Worked Well
14+
15+
- L1 produced 53 files with 129 transforms and 0 errors
16+
- DbContextInstantiationTransform correctly injected BLL classes with constructor DI
17+
- Duplicate class detection worked (skipped `StudentsListLogic` duplicate)
18+
- PageDirectiveTransform now handles Home.aspx → `@page "/"`
19+
- About page, Instructors page, navigation tests all pass
20+
21+
## L2 Repairs Required
22+
23+
1. **BLL classes instantiated with `new()` in pages** — Pages still did `new Courses_Logic()` instead of using DI injection. Fixed by adding `[Inject]` properties.
24+
2. **Enrollmet_Logic duplicate** — File existed in both BLL/ and Models/ namespaces. Deleted Models copy.
25+
3. **DropDownList StaticItems via @ref**`ref?.Items.Add()` pattern fails in static SSR. Converted to ListItemCollection backing field + markup binding.
26+
4. **Invalid EF `.Include(x => x.Key)` calls** — Spurious navigation property includes in StudentsListLogic. Removed.
27+
5. **AutoCompleteExtender `id` and `EnableCaching` attributes** — Component doesn't support these. Removed.
28+
6. **DetailsView DataSource null** — Initialized to empty list instead of null.
29+
7. **MapGet("/") ambiguity** — Removed redundant redirect (now fixed in CLI source).
30+
8. **Table.Rows/Cells access** — Stubbed out (BWFC Table doesn't support programmatic cell access).
31+
32+
## Failing Tests (4)
33+
34+
All 4 failures are in `StudentsPageTests` and require interactive form submissions:
35+
36+
| Test | Reason |
37+
|------|--------|
38+
| `AddNewStudentFormWorks` | Form post needs interactive render mode |
39+
| `DeleteStudentWorks` | Form post needs interactive render mode |
40+
| `ClearButtonResetsForm` | Button handler needs interactive render mode |
41+
| `DetailsViewShowsStudentDetails` | Search form post needs interactive render mode |
42+
43+
These are fundamental static SSR limitations — the Students page has complex form interactions that require `@rendermode InteractiveServer` or `<form>` with named handlers.
44+
45+
## CLI Gaps Identified (for future improvement)
46+
47+
1. **BLL `new()` calls not converted to DI** — Pages that instantiate BLL classes need automatic conversion to `[Inject]` properties
48+
2. **`id` attribute on BWFC/AjaxToolkit components** — CLI should strip `id` from non-HTML components (they don't support it as a parameter)
49+
3. **`EnableCaching` attribute on AutoCompleteExtender** — CLI should strip unsupported attributes from AjaxToolkit components
50+
4. **DetailsView DataSource null safety** — When DataSource is set to null, should default to empty collection
51+
5. **Invalid EF Include() from EDMX**`.Include(x => x.Key)` patterns from bad EDMX output should be detected and removed
52+
53+
## Comparison to Previous Run
54+
55+
| Run | Tests Passing | Build Errors at L1 | L2 Time |
56+
|-----|--------------|--------------------|---------|
57+
| Run 25 | 38/40 | 32 | ~10 min |
58+
| Run 26 | 36/40 | 20 | ~5 min |
59+
60+
Build errors reduced from 32 → 20 (38% fewer). L2 repair time reduced from ~10min to ~5min. 2 fewer tests pass vs Run 25 because ClearButton and DetailsView tests require form interactivity that wasn't set up in this fresh run.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# ContosoUniversity Migration Test - Run 29
2+
3+
**Date:** 2026-05-19 08:35 EDT
4+
**Branch:** `feature/migration-benchmark-speedups`
5+
**Operator:** Copilot
6+
**Requested by:** @csharpfritz
7+
8+
---
9+
10+
## Summary
11+
12+
| Metric | Value |
13+
|--------|-------|
14+
| Source project | `samples/ContosoUniversity/ContosoUniversity` |
15+
| Output project | `samples/AfterContosoUniversity` |
16+
| Toolkit entry point | `migration-toolkit/scripts/bwfc-migrate.ps1` |
17+
| Report folder | `dev-docs/migration-tests/contosouniversity/run29` |
18+
| Total wall-clock time | ~20 min |
19+
| Build result | 0 errors |
20+
| Acceptance tests | **40/40 passed** |
21+
| Final status | **SUCCESS** |
22+
23+
## Executive Summary
24+
25+
ContosoUniversity migrated from scratch with L1 producing 53 files (139 transforms, 0 errors) in 7 seconds. L2 repair addressed ~19 build errors (namespace conflicts, BLL constructor wiring, LINQ issues) plus runtime fixes for static SSR form handling, database seeding, and search support. All 40 acceptance tests pass.
26+
27+
## Timing
28+
29+
| Phase | Duration | Notes |
30+
|-------|----------|-------|
31+
| Preparation | ~5s | Clear output, create report folder |
32+
| Layer 1 toolkit migration | 7s | 5 files processed, 139 transforms, 0 errors |
33+
| Layer 2 build repair | ~5 min | 19 errors: namespace conflicts, BLL constructors, LINQ .Key |
34+
| Layer 2 runtime fixes | ~16 min | Form POST handling, seed data, search, GridView Items binding |
35+
| Build validation | 4s | Clean build |
36+
| Acceptance tests | 45s | 40/40 passed |
37+
| **Total** | ~20 min | |
38+
39+
## Layer 1 Results
40+
41+
```
42+
Files processed: 5
43+
Files written: 53
44+
Transforms applied: 139
45+
Semantic patterns: 1
46+
Scaffold files: 9
47+
Static files: 18
48+
Manual items: 9
49+
Errors: 0
50+
```
51+
52+
## Layer 2 Fixes Required
53+
54+
### Build Fixes
55+
| # | Issue | Fix |
56+
|---|-------|-----|
57+
| 1 | Duplicate `Enrollmet_Logic` class (Models/ vs BLL/) | Deleted Models copy |
58+
| 2 | BLL constructors need `ContosoUniversityEntities` param | Passed injected context |
59+
| 3 | `.Key` LINQ references on entity objects | Replaced with `StudentID`/`CourseID` |
60+
| 4 | `DropDownList` items `.Add()` on `IEnumerable<object>` | Changed to `List<ListItem>` |
61+
| 5 | `btnSearchCourse_Click` signature mismatch | Fixed to parameterless |
62+
| 6 | Dead `grv_RowUpdating` code using `Table.Rows`/`Cells` | Removed dead code |
63+
64+
### Runtime Fixes
65+
| # | Issue | Fix |
66+
|---|-------|-----|
67+
| 1 | No seed data → empty GridViews | Added full seed in Program.cs |
68+
| 2 | Form POST not handled in static SSR | Added SupplyParameterFromForm + action dispatch |
69+
| 3 | TextBox names have naming-container prefix | Used `tabAddStud$fieldName` in form binding |
70+
| 4 | Single-word search fails | Added Contains-based fallback in GetStudents |
71+
| 5 | About page GroupBy fails in EF Core | Switched to client-side evaluation |
72+
| 6 | GridView SelectMethod not working | Converted to Items binding |
73+
| 7 | Buttons don't work in static SSR | Replaced with `<input type="submit">` |
74+
75+
## What Worked Well
76+
77+
- L1 produced correct page structure and routing
78+
- Markup transforms handled control conversion cleanly
79+
- WebFormsForm wrapping generated correct form structure
80+
- BLL business logic preserved without rewriting
81+
82+
## What Did Not Work Well
83+
84+
- Duplicate source file copy (Enrollmet_Logic in two locations)
85+
- BLL constructor wiring not automated
86+
- Static SSR form handling requires significant manual work
87+
- GridView SelectMethod→Items conversion not automated
88+
- Database seeding is entirely manual
89+
90+
## Toolkit Gaps
91+
92+
1. **BLL constructor DI wiring** — CLI should detect constructor params and wire injected context
93+
2. **Static SSR form POST automation** — Button→submit conversion and SupplyParameterFromForm generation should be a CLI transform
94+
3. **Naming container prefix detection** — Form field names include parent container IDs
95+
4. **SelectMethod→Items conversion** — Should be automated when SelectMethod pattern is detected
96+
5. **Duplicate source detection** — Same class in multiple locations should be deduplicated
67.1 KB
Loading

0 commit comments

Comments
 (0)