You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: BWFC013/014 analyzers, architecture guide, CI docs (#487)
* feat: Add BWFC013/014 analyzers, architecture guide, and CI docs
Analyzer Expansion:
- BWFC013: Detects Response.Write/WriteFile/Clear/Flush/End usage
- BWFC014: Detects Request.Form/Cookies/Headers/Files/QueryString access
- Both produce WARNING diagnostics with guidance-only code fixes (TODO comments)
- 21 new tests (111 total, all passing)
Documentation:
- dev-docs/ANALYZER-ARCHITECTURE.md: Contributor guide for building analyzers
- docs/Migration/Analyzers.md: BWFC013/014 entries, CI/CD integration section,
.editorconfig severity tuning, prioritization guide
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs(ai-team): Analyzer sprint 1 complete orchestration & decision logs merged
Session: 2026-03-20T14-18-05Z-analyzer-sprint1
Requested by: Scribe
Changes:
- Orchestration logs for Cyclops (BWFC013/014 analyzers, 6 files, 111 tests) and Beast (architecture guide, 579 lines)
- Session log for analyzer sprint 1 execution
- Merged 10 decision inbox files decisions.md (BWFC013/014 IDs, analyzer docs, deprecation guidance, ASHX/AXD middleware, RouteData fix, component audit, navigation UX, sample pages, middleware testing)
- Deleted all inbox files after merge
- Appended team updates to Cyclops, Beast, Forge, Jubilee, Rogue history.md files
- PR #487 opened on upstream targeting dev branch
* feat: bundle analyzers in main NuGet + add -Prescan switch to L1 script
Task 1: Added ProjectReference from BlazorWebFormsComponents to
BlazorWebFormsComponents.Analyzers with OutputItemType=Analyzer so
consumers get Roslyn analyzers automatically via the main NuGet package.
Task 2: Added -Prescan switch to bwfc-migrate.ps1 that scans source
.cs files for 9 BWFC analyzer patterns (BWFC001-005, 011-014) and
outputs a JSON summary report without performing any migration.
Includes human-readable breakdown via Write-Host.
Build: 0 errors, 111 analyzer tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: add Roslyn analyzer tests to build and squad-ci workflows
- build.yml: restore, build, run, upload, and publish analyzer test results
- squad-ci.yml: replace placeholder with dotnet restore/build/test for both suites
- Add setup-dotnet step to squad-ci.yml for .NET 10.0.x
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: use DetectEndOfLine() for cross-platform CI compatibility
All 4 code fix providers (BWFC001, BWFC004, BWFC013, BWFC014) used
hardcoded \r\n in SyntaxFactory.EndOfLine(), causing test failures
on Linux CI where source strings use \n.
- Add SyntaxExtensions.DetectEndOfLine() helper that reads line
endings from the existing syntax tree
- Replace hardcoded \r\n with root.DetectEndOfLine() in all 4
code fix providers
- Replace foreach+if with LINQ .Where() (CodeQL suggestion)
All 111 analyzer tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: use DetectEndOfLine() in MissingParameterAttributeCodeFixProvider
The using directive insertion used SyntaxFactory.CarriageReturnLineFeed
which hardcodes CRLF, failing on Linux CI where source uses LF.
Replace with newRoot.DetectEndOfLine() for cross-platform compatibility.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
echo "No build commands configured — update squad-ci.yml"
27
+
dotnet restore
28
+
dotnet build --configuration Release --no-restore
29
+
dotnet test src/BlazorWebFormsComponents.Test/BlazorWebFormsComponents.Test.csproj --configuration Release --no-build --verbosity normal
30
+
dotnet test src/BlazorWebFormsComponents.Analyzers.Test/BlazorWebFormsComponents.Analyzers.Test.csproj --configuration Release --no-build --verbosity normal
- Consistent with existing BWFC doc style (Deprecation Guidance, MigratingAshxHandlers)
540
+
541
+
**MkDocs verification:**
542
+
- Ran python -m mkdocs build --strict 0 errors, 54.08s build time
543
+
- Unshipped analyzer notes already present in AnalyzerReleases.Unshipped.md (BWFC013, BWFC014 added by Cyclops in advance)
544
+
- No documentation links or cross-references broken
545
+
546
+
**Design decisions:**
547
+
- ANALYZER-ARCHITECTURE.md placed in dev-docs/ (developer-only, not end-user docs) vs docs/ (migration user-facing)
548
+
- Prioritization guide ordered by business impact (blocking patterns first) vs alphabetical, with rationale for each phase
549
+
- CI/CD section emphasizes dotnet build + .editorconfig as the primary integration point, with note that detailed CI templates are "available separately"
550
+
- Request.Form[]@bind example is the most direct mapping; QueryString examples show both route parameters and NavigationManager.Uri approaches
Copy file name to clipboardExpand all lines: .squad/agents/cyclops/history.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -468,3 +468,35 @@ Team update: ModalPopupExtender and CollapsiblePanelExtender implemented by Cycl
468
468
3.**CS1503** in GridView/Selection.razor — SelectedIndexChanged handler took int but component expects EventCallback<GridViewSelectEventArgs>. Changed handler (and code example) to accept GridViewSelectEventArgs.
469
469
470
470
**Key insight:** Always check the base class parameter types — ImageButton inherits OnClick from ButtonBaseComponent which uses EventArgs, not MouseEventArgs. GridView's SelectedIndexChanged was recently changed to GridViewSelectEventArgs (matching Web Forms behavior).
**Summary:** Implemented two new Roslyn analyzers following established patterns (ResponseRedirect/Session as templates).
475
+
476
+
-**BWFC013 ResponseObjectUsageAnalyzer:** Detects Response.Write(), WriteFile(), Clear(), Flush(), End() via InvocationExpression + ImmutableHashSet method matching. Code fix replaces with TODO comment.
477
+
-**BWFC014 RequestObjectUsageAnalyzer:** Detects Request.Form/Cookies/Headers/QueryString/ServerVariables["key"] via ElementAccessExpression, and Request.Files via SimpleMemberAccessExpression. Code fix replaces with TODO comment.
478
+
- Both analyzers use xpressionText.EndsWith(".Response") / .EndsWith(".Request") pattern to match his.Response, HttpContext.Current.Response, and any *.Response prefix.
479
+
- 21 new tests (10 for BWFC013, 11 for BWFC014): 5+6 positive, 3+3 negative, 2+2 code fix tests.
480
+
- Updated AllAnalyzersIntegrationTests ExpectedIds and analyzer count (810).
481
+
- Updated AnalyzerReleases.Unshipped.md with both rules.
482
+
- All 111 tests pass (90 existing + 21 new).
483
+
484
+
**Key patterns:** Code fix uses EmptyStatement with SyntaxFactory.EndOfLine("\r\n") between comment trivia and semicolon. BWFC014 registers for both ElementAccessExpression (indexed properties) and SimpleMemberAccessExpression (direct properties like Files), with parent-check to avoid double-reporting.
485
+
486
+
487
+
**Team update (2026-03-20):** BWFC013/BWFC014 analyzers + architecture (6 files, 21 tests, 111 passing, commit b267b854). PR #487 opened on upstream. Next analyzer ID: BWFC015. decided by Cyclops
**Summary:** Two tasks completed on feature/analyzer-sprint1:
492
+
493
+
1.**NuGet Analyzer Integration** — Added ProjectReference from BlazorWebFormsComponents.csproj to BlazorWebFormsComponents.Analyzers.csproj with `PrivateAssets="all" ReferenceOutputAssembly="false" OutputItemType="Analyzer"`. Consumers now get Roslyn analyzers automatically when referencing the main NuGet package.
494
+
495
+
2.**L1/L2 Pipeline Pre-Scan** — Added `-Prescan` switch to `bwfc-migrate.ps1`. Scans source .cs files for 9 BWFC analyzer patterns (BWFC001-005, 011-014) and outputs JSON summary with file-level detail + human-readable breakdown. Early return — no migration transforms executed.
496
+
497
+
**Verification:** Build succeeds (0 errors), all 111 analyzer tests pass, prescan tested against src/ (1,092 matches across 176 files).
498
+
499
+
500
+
### CI Workflow: Analyzer Tests Added (2026-03-20)
501
+
502
+
**Summary:** Updated .github/workflows/build.yml to restore, build, run, upload, and publish analyzer test results alongside the existing unit tests. Also replaced the squad-ci.yml placeholder with real dotnet restore/build/test commands covering both test suites, including setup-dotnet for .NET 10. YAML validated with Python yaml parser.
Copy file name to clipboardExpand all lines: .squad/agents/forge/history.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,3 +430,7 @@ Jeff directed a design pivot: replace custom `[HandlerRoute]` attribute + `MapBl
430
430
**Impact:**~100 fewer lines of production code (400 vs 500). One fewer file (`HandlerRouteAttribute.cs` gone). Issue 2 (routing) shrinks from Size S to XS. Estimated timeline: 2-3 weeks (was 3-4). Adapter layer (`HttpHandlerContext`, `HttpHandlerResponse`, `HttpHandlerServer`) completely unchanged.
431
431
432
432
**Learning:** Original §7.3 rejected Minimal API because "they require completely different code structure." Wrong framing — Jeff's insight is to use Minimal API as *registration and dispatch infrastructure* while keeping the `HttpHandlerBase` class structure intact. The handler code developers write is nearly identical. Only the plumbing underneath changes.
0 commit comments