Skip to content

Publish documentation and rule status with DocFX on GitHub Pages - #4218

Merged
AArnott merged 5 commits into
masterfrom
aarnott-docfx-documentation-migration
Oct 10, 2026
Merged

AArnott merged 5 commits into
masterfrom
aarnott-docfx-documentation-migration

Conversation

@AArnott

@AArnott AArnott commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

The rule documentation currently lives in GitHub Markdown, and the existing Pages status page depends on a retired AppVeyor report endpoint. This brings both into a single DocFX site with consistent navigation and reliable build-generated status data.

Approach

  • Pin DocFX as a local .NET tool and compile the existing documentation with warnings treated as errors. Use a compact header and a left sidebar containing the rule categories and individual rules.
  • Embed the status content through a small Markdown [!INCLUDE] page using DocFX's full-width layout. Keep the shared header, footer, theme controls, accessible status icons, and links to local rule documentation. Redirect the previous /status/index.html URL to /RuleStatus.html.
  • Modernize the status generator to .NET 10 and current Roslyn workspaces, honor the build configuration, and reject empty reports. Publish its JSON beside the site instead of requesting it from AppVeyor.
  • Build the site in the existing GitHub workflow and deploy a single Pages artifact only for pushes to master, after the build, generated-file checks, status-page tests, and analyzer tests succeed.
  • Point analyzer help links, XML references, release tables, and package documentation to the published site. Centralize shipping help-link generation by diagnostic ID; keep an independent test helper for URL assertions. Links within the documentation remain relative.

Migration notes

Repository Settings > Pages > Source must be changed from branch publishing to GitHub Actions, and the github-pages environment must allow deployment from master. The site root becomes the documentation overview rather than the old status page.

The status repair adapts commit 7787b2d27ca2cab119d103fe83792151a97776da from aarnott-status-page-repair for this combined deployment. Local build and preview instructions are in CONTRIBUTING.md.

Analyzer registrations and analysis callbacks are unchanged. Help-link strings are generated once during static initialization, not during analysis.

Validation

  • DocFX builds with zero warnings and errors.
  • Analyzer, code-fix, status-generator, and base test-project builds completed with zero warnings and errors.
  • All 195 targeted help-link, analyzer-extension, and exclusion tests passed on net472.
  • All 10 status-page regression tests passed; the imported repair tests first reproduced the broken endpoint and missing error handling before the fix.
  • Generated a real report containing 182 configurable rule statuses and checked the published help-link targets against the generated HTML pages.
  • Browser checks confirmed populated status rows, shared DocFX framing, working icons, desktop full-width layout, and bounded horizontal table scrolling on mobile.

Full CI validation is pending; this PR is a draft.

AArnott and others added 5 commits October 10, 2026 08:15
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adapt the status page and generator repair from commit 7787b2d27ca2cab119d103fe83792151a97776da on aarnott-status-page-repair for the combined documentation site.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Embed the status fragment in a full-width DocFX page with shared navigation, accessible status icons, and a redirect from the previous URL.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AArnott
AArnott marked this pull request as ready for review October 10, 2026 14:56
@AArnott
AArnott requested a balanced review from Copilot October 10, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The DocFX tool manifest must be moved to .config/dotnet-tools.json so the documented and CI restore commands can discover it.

1 open finding
What changed in this PR

Builds and publishes unified DocFX documentation and rule-status pages, while redirecting analyzer help links to the deployed site.

Changes:

  • Adds DocFX configuration, navigation, status rendering, and Pages deployment.
  • Modernizes the status generator and adds failure handling and regression tests.
  • Centralizes analyzer documentation URLs.
File Description
toc.yml Adds top-level site navigation.
docfx.json Configures the DocFX build.
dotnet-tools.json Pins DocFX; currently placed where local-tool discovery cannot find it.
.github/​workflows/​build.yml Builds and deploys the documentation site.
.gitignore Ignores generated documentation and status output.
CONTRIBUTING.md Documents site build and preview steps.
README.md Points users to published documentation.
build/​status-page.test.cjs Adds status-page regression tests.
docs/​index.html Redirects the legacy status URL.
docs/​status.md Implements the embedded status page.
documentation/​index.md Adds the documentation landing page.
documentation/​RuleStatus.md Hosts the status fragment in DocFX.
documentation/​SA1500.md Corrects its local anchor link.
documentation/​SA1633.md Makes its configuration link local.
documentation/​SA1636.md Makes its configuration link local.
documentation/​SA1641.md Makes its configuration link local.
StyleCop.Analyzers/​StyleCop.Analyzers/​HelpLinkHelper.cs Centralizes published help URLs.
StyleCop.Analyzers/​StyleCop.Analyzers/​AnalyzerReleases.Unshipped.md Updates release-table documentation links.
StyleCop.Analyzers/​StyleCop.Analyzers.Test/​Helpers/​HelpLinkHelper.cs Adds independent expected-URL generation.
StyleCop.Analyzers/​StyleCop.Analyzers.Test/​Helpers/​ExclusionTestAnalyzer.cs Updates the test diagnostic URL.
StyleCop.Analyzers/​StyleCop.Analyzers.Test/​AnalyzerExtensionsTests.cs Updates test analyzer help links.
StyleCop.Analyzers/​StyleCop.Analyzers.Test/​AnalyzerConfigurationUnitTests.cs Verifies centralized help-link formatting.
StyleCop.Analyzers/​StyleCop.Analyzers.Status.Generator/​StyleCop.Analyzers.Status.Generator.csproj Modernizes the generator runtime and dependencies.
StyleCop.Analyzers/​StyleCop.Analyzers.Status.Generator/​SolutionReader.cs Honors the selected build configuration.
StyleCop.Analyzers/​StyleCop.Analyzers.Status.Generator/​Program.cs Rejects empty reports.
StyleCop.Analyzers/​StyleCop.Analyzers.CodeFixes/​Settings/​SettingsFileCodeFixProvider.cs Updates configuration guidance URL.
StyleCop.Analyzers/​StyleCop.Analyzers.CodeFixes/​PackageReadme.md Updates package documentation links.
StyleCop.Analyzers/​StyleCop.Analyzers/​{SpecialRules,SpacingRules,ReadabilityRules,OrderingRules,NamingRules,MaintainabilityRules,LayoutRules,DocumentationRules}/​*.cs Migrates analyzer descriptors and related XML references to the centralized published help URLs.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dotnet-tools.json Resolved
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.57%. Comparing base (0931d70) to head (0501bcd).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #4218    +/-   ##
========================================
  Coverage   97.57%   97.57%            
========================================
  Files        1276     1278     +2     
  Lines      135692   135876   +184     
  Branches     4383     4383            
========================================
+ Hits       132397   132583   +186     
+ Misses       2135     2134     -1     
+ Partials     1160     1159     -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AArnott
AArnott merged commit f305314 into master Oct 10, 2026
29 checks passed
@AArnott
AArnott deleted the aarnott-docfx-documentation-migration branch October 10, 2026 15:06
This was referenced Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants