ci(api-docs): read package versions from MSBuild, not a .csproj scrape - #106
Conversation
Every package in the generated reference is currently labelled `vunknown`. The version lookup scrapes `<Version>`/`<VersionPrefix>` out of the .csproj and returns "unknown" when neither is present -- and since this repo moved to MinVer, no project carries a literal version by design. The scrape therefore misses on all of them. This replaces that step with the version already fixed upstream in resq-software/docs#133: ask MSBuild via `-t:GetAssemblyVersion -getProperty:Version`. GetAssemblyVersion is a stock SDK target, so MinVer runs and reports the tag-derived value; the .csproj scrape is kept as a fallback for SDKs older than 8.0.200, which have no -getProperty. The file is taken verbatim from the upstream template, so the next template sync is a no-op here instead of a revert. Verified locally against this tree at e727403 (full history, tags present, after restore): ResQ.Storage unknown -> 0.6.1-alpha.0.42 ResQ.Core unknown -> 0.6.1-alpha.0.42 Note the repo contains two ResQ.Core.csproj files -- the real `ResQ.Core/` in the solution, and an orphaned `resq-core/` copy that is not. The orphan is never restored, so MSBuild reports the SDK default 1.0.0 for it. The upstream logic already handles this: it skips any candidate whose value equals the SDK default and only falls back to it last, so the real 0.6.1-alpha.0.42 wins. Confirmed by replaying the selection over both candidates.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe API documentation workflow now fetches full Git history and tags. Its index-generation step resolves project versions through MSBuild, literal project-file values, and SDK defaults in a stable order. ChangesAPI documentation versioning
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The workflow improves generated API documentation version labels through full-history and MSBuild-based resolution; no merge-blocking risk remains identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Audit PassedThe audit of the changes in this pull request found no security vulnerabilities, logic bugs, or performance issues. Key Observations:
The audit is complete and the changes are approved from a security and logic perspective. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Every package in this repo's generated API reference is currently labelled
vunknown.Why
The version lookup scrapes
<Version>/<VersionPrefix>out of each.csprojand returns"unknown"when neither is found. Since this repo adopted MinVer (#104), no project carries a literal version string by design — that was the whole point, since a literal in the tree is something an inbound sync can revert. So the scrape misses on every package.This is not a hypothetical. Measured against this tree at
e727403, with full history and tags, after restore:ResQ.Storageunknown0.6.1-alpha.0.42ResQ.Coreunknown0.6.1-alpha.0.42The fix
Ask MSBuild instead of parsing XML:
-getPropertyalone only evaluates the project, which returns the SDK default before MinVer has run.GetAssemblyVersionis a stock SDK target, so invoking it forces MinVer to execute and report the tag-derived version. The.csprojscrape is retained as a fallback for SDKs older than 8.0.200, which have no-getProperty.This was already fixed upstream in resq-software/docs#133. The file here is taken verbatim from that template, so the next template sync is a no-op against this repo rather than a revert.
One thing worth knowing
This repo contains two
ResQ.Core.csprojfiles:ResQ.Core/ResQ.Core.csproj— the real one, referenced byResQ.Sdk.slnresq-core/ResQ.Core.csproj— an orphan, not in the solution, whoseProtobuf Includepoints at../../protocols/core.proto, a path outside the repoThe orphan is never restored, so MinVer's targets are never imported for it and MSBuild reports the SDK default
1.0.0. That is a plausible-looking wrong answer, so it matters which candidate wins.The upstream logic already handles it:
read_versionsorts candidates, skips any whose value equals the SDK default, and only falls back to that value if nothing better exists. I replayed the selection across both candidates to confirm the real0.6.1-alpha.0.42wins and the orphan's1.0.0is discarded.The orphan itself arrived via an inbound sync from the internal monorepo and looks like debris rather than anything live. Cleaning it up is out of scope here — flagging it as a separate item.
Verification
actionlintclean.1.0.0for everything.Summary by CodeRabbit