Skip to content

Release: pre-release badges actually track pre-releases (#145)#146

Merged
ptr727 merged 1 commit into
mainfrom
develop
May 13, 2026
Merged

Release: pre-release badges actually track pre-releases (#145)#146
ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727
Copy link
Copy Markdown
Owner

@ptr727 ptr727 commented May 13, 2026

Summary

Brings develop forward into main. Net effect on main's content is README.md only — the badge fixes from #145:

  • prereleaseversion-shield URL gains &filter=*-g* so the GitHub Pre-Release badge filters to Nerdbank's -g<short-sha> pre-release tags instead of converging to the latest stable after every release.
  • The NuGet Pre-Release badge (usage and link-reference) is dropped — shields' NuGet endpoint doesn't support filtering and no clean fix exists.

git diff origin/main..origin/develop --stat:

 README.md | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Why this release

After #144 landed today, the "GitHub Pre-Release" badge displayed v1.2.42 (the full release from #144) while the actual latest pre-release was 1.2.40-g0f69a1b0a0. Same for the NuGet badge. Root cause: include_prereleases and vpre mean include pre-releases as candidates, not show pre-releases only — so Nerdbank's monotonically-increasing height makes the stable always win after a release merge.

The upstream template carries the same bug; tracked at ptr727/ProjectTemplate#83 with the full fix recipe.

Test plan

  • Copilot review on the current head — no factual / phrasing pushback.
  • Check pull request workflow status green.
  • After this release publishes (full release on main), the GitHub Pre-Release badge stays on the latest develop-side -g<sha> tag rather than converging to the new stable.

## Summary

- Adds `&filter=*-g*` to the `prereleaseversion-shield` URL in
[README.md](./README.md) so the **GitHub Pre-Release** badge filters to
tags with the Nerdbank `-g<short-sha>` suffix only.
- Drops the **NuGet Pre-Release** badge entirely (both the in-body usage
and the link-reference definition). Shields' NuGet endpoint does not
accept a filter; no clean fix exists.

## Why

Observed after [#144](#144)
merged: the **GitHub Pre-Release** badge displayed `v1.2.42` (a full
release), even though the actual latest pre-release at the time was
`1.2.40-g0f69a1b0a0`. Same for the **NuGet Pre-Release** badge.

Root cause is shields.io semantics:

- `github/v/release/...?include_prereleases` and `nuget/vpre/...` both
mean *"include pre-releases as candidates and return the latest by
published date / highest version"* — not *"show pre-releases only"*.
- After every develop → main release merge, Nerdbank.GitVersioning
publishes a full release with a height higher than any preceding
pre-release, so both pre-release badges converge to their release-only
siblings within seconds.

For GitHub there's a clean fix: shields.io's `github/v/release` endpoint
accepts a `filter` glob. The Nerdbank short-sha suffix `-g<10hex>` only
appears on pre-release tags, so `filter=*-g*` cleanly selects
pre-releases.

For NuGet there isn't:

- The NuGet shield ignores `filter` silently.
- The `dynamic/json` shield rejects JSONPath filter predicates (`query
not supported`).
- NuGet's flat-container index is semver-sorted (pre-releases ahead of
their stable counterparts), so `$.versions[-1]` lands on the same
stable.

No way to filter to pre-releases only without a custom hosted endpoint.
Dropping it is cleaner than carrying a redundant badge — the GitHub
Pre-Release badge now carries the develop-side signal on its own.

## Verification

Hit the new shield URLs directly:

- GitHub Pre-Release with `filter=*-g*` → `v1.2.40-g0f69a1b0a0` ✓
- GitHub Release (unchanged) → `v1.2.42` ✓

## Upstream

The upstream `ptr727/ProjectTemplate` README likely carries the same
badge pattern and the same bug. A separate issue will be filed there
with details for replication.

## Test plan

- [ ] Copilot review on the current head — no factual / phrasing
pushback.
- [ ] `Check pull request workflow status` green.
- [ ] After the next pre-release publish on develop, the GitHub
Pre-Release badge updates to the new pre-release tag (not the latest
stable).
Copilot AI review requested due to automatic review settings May 13, 2026 19:22
@ptr727 ptr727 enabled auto-merge May 13, 2026 19:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates README release badges so the pre-release signal tracks Nerdbank-generated pre-release tags instead of drifting to stable releases.

Changes:

  • Adds a filter=*-g* query parameter to the GitHub Pre-Release shields.io badge.
  • Removes the NuGet Pre-Release badge and its unused link reference.

@ptr727 ptr727 merged commit e1f0a7a into main May 13, 2026
18 checks passed
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