Automate README integrations index generation and enforce drift checks on PRs#1464
Automate README integrations index generation and enforce drift checks on PRs#1464aaronpowell with Copilot wants to merge 6 commits into
Conversation
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
|
@copilot can you do it as a C# file-based app rather than Python? |
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Done in |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1464Or
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1464" |
There was a problem hiding this comment.
Pull request overview
This PR makes the root README.md integrations list reproducible by generating it from the src/**/CommunityToolkit.Aspire*.csproj set, and adds CI enforcement to prevent drift.
Changes:
- Replaced the hand-maintained README integrations rows with a bounded autogenerated region (BEGIN/END markers).
- Added a C# generator script to render the integrations table from project metadata (and flag deprecated integrations based on README text).
- Added a PR workflow to fail when the README’s generated table is stale.
Show a summary per file
| File | Description |
|---|---|
| README.md | Replaces manual integrations table with an autogenerated block controlled by BEGIN/END markers. |
| eng/scripts/generate-readme-integrations.cs | Adds generator/check script to render and/or validate the README integrations table. |
| .github/workflows/readme-integrations-check.yml | Adds PR-time drift detection by running the generator in --check mode. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Low
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Verify README integrations table is up to date | ||
| run: dotnet run eng/scripts/generate-readme-integrations.cs -- --check |
| - name: Verify README integrations table is up to date | ||
| run: dotnet run eng/scripts/generate-readme-integrations.cs -- --check |
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
|
| return null; | ||
| } | ||
|
|
||
| static string RenderTable(List<Integration> integrations) |
There was a problem hiding this comment.
suggestion: wouldn't all that be easier with a StringBuilder?
| const string TableStart = "<!-- BEGIN AUTOGENERATED INTEGRATIONS TABLE -->"; | ||
| const string TableEnd = "<!-- END AUTOGENERATED INTEGRATIONS TABLE -->"; | ||
|
|
||
| bool checkOnly = args.Contains("--check", StringComparer.OrdinalIgnoreCase); |
There was a problem hiding this comment.
suggestion: I would advise check being the default behavior and passing --write to write the new readme
| return string.Concat(content.AsSpan(0, tableStart), block, "\n", content.AsSpan(sectionStart)); | ||
| } | ||
|
|
||
| static string CreateDiff(string existing, string updated) |
There was a problem hiding this comment.
question: not sure to understand why you need git for.
The root README integrations list had drifted from the actual package set (e.g., missing SeaweedFS), and deprecated integrations were not consistently surfaced. This change makes the list generated from source projects and enforces freshness in PRs.
Autogenerated integrations table in
README.md<!-- BEGIN AUTOGENERATED INTEGRATIONS TABLE --><!-- END AUTOGENERATED INTEGRATIONS TABLE -->src/**/CommunityToolkit.Aspire*.csprojand sorted alphabetically by package ID.src/(hosting/client/extensions).Generator script for repeatable updates
eng/scripts/generate-readme-integrations.py.⚠️ **Deprecated** — ....PR-time drift detection workflow
.github/workflows/readme-integrations-check.yml.contents: read).