Skip to content

fix(csharp): add NuGet badges to GitHub release body#90

Merged
konard merged 3 commits into
mainfrom
issue-88-ba6db304f470
May 12, 2026
Merged

fix(csharp): add NuGet badges to GitHub release body#90
konard merged 3 commits into
mainfrom
issue-88-ba6db304f470

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented May 12, 2026

Summary

Closes follow-up on #88"Still no NuGet badges in C# GitHub releases."

The C# release script (csharp/scripts/create-github-release.mjs) used to write the changelog notes straight into the GitHub release body with no badges, while the Rust release script already injected Crates.io + Docs.rs shields.io badges that link to the specific package version. As a result, every C# release page (e.g. csharp-v2.4.0) was missing the NuGet version + downloads badges that the Rust release pages have.

This PR mirrors the Rust pattern for C#:

  • buildNugetBadges(packageId, version) emits [![NuGet](…/nuget/v/<id>)](nuget.org/packages/<id>/<version>) [![NuGet Downloads](…/nuget/dt/<id>)](nuget.org/packages/<id>/<version>).
  • prependNugetBadges(notes, packageId, version) injects the badges above the changelog/Package footer and is a no-op when the badges are already present or --package-id is omitted.
  • buildReleasePayload(...) wires the badge logic into the release API payload so that every future C# release published by CI carries the badges.
  • Refactored the script for testability (gated CLI execution behind isCliEntryPoint()) so the helpers can be unit-tested.

The existing csharp-v2.4.0 release body was backfilled via gh release edit so the fix is visible immediately, not only on the next release. See docs/case-studies/issue-88/github-data/csharp-v2.4.0-release-after-fix.json for the post-fix snapshot.

Template comparison

The upstream csharp-ai-driven-development-pipeline-template/create-github-release.mjs already implements buildNuGetBadge and appendNuGetBadgeIfMissing — link-cli had drifted from it. Snapshot kept under docs/case-studies/issue-88/templates/ for evidence. Nothing to report upstream.

Test plan

  • node --test csharp/scripts/release-scripts.test.mjs — 22/22 pass (16 prior + 6 new badge tests).
  • --dry-run payload contains both img.shields.io/nuget/v/clink and img.shields.io/nuget/dt/clink linking to nuget.org/packages/clink/<version>.
  • prependNugetBadges skips when badges already present (idempotent re-run safe).
  • prependNugetBadges is a no-op when --package-id is empty (CLI usability preserved).
  • Backfilled csharp-v2.4.0 release body verified on github.com.

Fixes #88

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #88
@konard konard self-assigned this May 12, 2026
konard added 2 commits May 12, 2026 22:47
The C# release script now prepends version + downloads shields.io NuGet
badges (linking to the specific package version) before the changelog
notes, mirroring how the Rust release script emits Crates.io + Docs.rs
badges. Refactor the script for testability and cover badge generation,
existing-badge detection, package-id encoding, and payload assembly with
unit tests.

Closes follow-up on #88.
Update issue-88 case study to cover both layers: the README badge fix
shipped in #89 and the C# release body NuGet badges shipped here in
#90. Snapshot the upstream csharp template and post-fix release data
for evidence.
@konard konard changed the title [WIP] C# release has no badge to its specific version fix(csharp): add NuGet badges to GitHub release body May 12, 2026
@konard konard marked this pull request as ready for review May 12, 2026 22:48
@konard
Copy link
Copy Markdown
Member Author

konard commented May 12, 2026

Working session summary

PR 90 finalized: #90

  • Title updated, draft cleared, ready for review.
  • 2 commits pushed: fix(csharp): add NuGet badges to GitHub release body + docs(case-study): document NuGet badge follow-up.
  • .gitkeep placeholder removed.
  • All CI checks green (Lint, Tests on macOS/Ubuntu/Windows, Build Package).
  • 22/22 unit tests pass; csharp-v2.4.0 release body already backfilled with NuGet badges.

This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 12, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $5.067205

📊 Context and tokens usage:

Claude Opus 4.7: (2 sub-sessions)

  1. 114.3K / 1M (11%) input tokens, 27.0K / 128K (21%) output tokens
  2. 42.5K / 1M (4%) input tokens, 3.8K / 128K (3%) output tokens

Total: (10.7K new + 144.5K cache writes + 6.4M cache reads) input tokens, 37.3K output tokens, $5.067205 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (2339KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 5a0b56d into main May 12, 2026
9 checks passed
@konard
Copy link
Copy Markdown
Member Author

konard commented May 12, 2026

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

C# release has no badge to its specific version

1 participant