Skip to content

docs(readmes): auto-sync version display via Maven Central badges#56

Closed
jlc488 wants to merge 1 commit into
mainfrom
feat/maven-central-badges
Closed

docs(readmes): auto-sync version display via Maven Central badges#56
jlc488 wants to merge 1 commit into
mainfrom
feat/maven-central-badges

Conversation

@jlc488
Copy link
Copy Markdown
Contributor

@jlc488 jlc488 commented May 23, 2026

Summary

Replaced hardcoded version strings in the 3 root-README tables (14 demo rows × 2 languages = 28 spots) with shields.io Maven Central badges that read the latest published version directly from Maven Central. No more manual sync on every release.

Before:

| [`easy-paging-sb4-demo`](easy-paging-sb4-demo/) | ... | [\`kr.devslab:easy-paging-spring-boot-starter:0.5.0\`](https://central.sonatype.com/artifact/kr.devslab/easy-paging-spring-boot-starter) |

After:

| [`easy-paging-sb4-demo`](easy-paging-sb4-demo/) | ... | [![Maven Central](https://img.shields.io/maven-central/v/kr.devslab/easy-paging-spring-boot-starter?label=kr.devslab%3Aeasy-paging-spring-boot-starter&versionPrefix=0.5)](https://central.sonatype.com/artifact/kr.devslab/easy-paging-spring-boot-starter) |

The badge renders as a clickable pill: `kr.devslab:easy-paging-spring-boot-starter | 0.5.0` and updates on its own whenever a new version hits Maven Central.

Why

We just merged #55 to fix 5 stale version refs that PR review missed. That was the second time in a week the same drift happened (the post-SB4 sweep was the first). Manual sync across 28 spots is the wrong model.

Design choices

Per-line filter with versionPrefix — The SB3 maintenance line (0.4.x) and the SB4 active line (0.5.x) need to display independent latest versions. Without the filter, the SB3 row's badge would jump to 0.5.0 the moment the SB4 release hit Maven Central. With ?versionPrefix=0.4 on SB3 rows and ?versionPrefix=0.5 on SB4 rows, each line shows its own latest patch.

Kept artifact ID in the badge label — `?label=kr.devslab%3Aeasy-paging-spring-boot-starter` so the badge reads `kr.devslab:easy-paging-spring-boot-starter | 0.5.0` instead of just `Maven Central | 0.5.0`. Still grep-able for the artifact ID; still informative at a glance.

Trade-off

Badges display "latest on Maven Central," not "what this demo pins in build.gradle.kts." There's a short mismatch window after a release (badge shows new version immediately; per-demo pin updates when Dependabot's PR lands minutes later). Accepted because:

  1. The window is short (Dependabot fires within minutes of a release)
  2. Per-demo READMEs still contain the actual pinned version in prose (`the only dep added is :X:Y:Z`)
  3. The column is titled "Maven Central" not "What this demo uses," matching the badge semantics

A CI mismatch check (Layer 1 from the earlier proposal) is a follow-up if the per-demo prose drifts again.

Not in this PR

  • Per-demo README "Files of interest" tables — kept as prose, copy-paste-friendly.
  • Org `.github` profile open-source list — separate PR on devslab-kr/.github, same pattern.

Test plan

  • CI green
  • Render the README on GitHub and confirm all 14 badges show the expected versions (4× `0.5.0` SB4 + 4× `0.4.0` SB3 + 6× `3.1.0` ssrf-guard family)
  • Click each badge — should land on the Maven Central artifact page
  • After the next starter release, verify the badges update without a doc commit

…entral badges

Manual version sync across 14 demo rows × 2 languages = 28 spots that
have to be hand-bumped on every starter release. The recent 5 stale-ref
slips (#55) proved this surface drifts in practice — and was the second
time it bit (after the post-SB4 sweep PR).

Replaced the "Maven Central coordinates" column in all three tables
(easy-paging SB4, easy-paging SB3 maintenance, ssrf-guard) with
shields.io badges that read directly from Maven Central:

  [![Maven Central](https://img.shields.io/maven-central/v/<group>/<artifact>?label=<group>%3A<artifact>)](https://central.sonatype.com/artifact/<group>/<artifact>)

For the SB3 maintenance demos, added &versionPrefix=0.4 so the badge
pins to the 0.4.x line (the SB4 0.5.x release on Maven Central would
otherwise overwrite the displayed version on the SB3 row). Same trick
on the SB4 row with &versionPrefix=0.5 keeps the lines independent if
the 0.4.x maintenance branch ever publishes a 0.4.1 patch.

Trade-off captured for posterity:
- Pro: zero manual sync; release publishes → README updates automatically.
- Con: badge reflects "latest on Maven Central," not "what this demo
  pins in build.gradle.kts." There's a short mismatch window between
  a release going out and Dependabot landing the per-demo pin bump.
  Acceptable because (a) the window is short — dependabot fires within
  minutes; (b) per-demo READMEs still contain the actual pinned version
  in prose ("the only dep added is :X:Y:Z"), so the literal pin is
  still grep-able; (c) the table column is titled "Maven Central" not
  "What this demo uses," matching the badge semantics.

Per-demo README prose was intentionally left as text — copy-paste
Gradle snippets need real version strings, and the recent fix (#55)
already aligned them with the build files. A CI mismatch check
(Layer 1) is a follow-up if the prose drifts again.

Excluded from this sweep:
- Per-demo README "Files of interest" tables — kept as prose.
- The `.github` profile open-source list — separate PR on the
  devslab-kr/.github repo, same badge pattern.
@jlc488
Copy link
Copy Markdown
Contributor Author

jlc488 commented May 23, 2026

Closing — superseded by the in-flight renumber work on easy-paging-versioning-policy-bump. The badge prefixes in this PR (versionPrefix=0.4 / versionPrefix=0.5) are now wrong after the Spring-major-aligned renumber (per VERSIONING.md) — should be versionPrefix=3 / versionPrefix=4. Will re-open as a separate PR off main once the renumber lands.

@jlc488 jlc488 closed this May 23, 2026
jlc488 added a commit that referenced this pull request May 23, 2026
…nded (#59)

Deferred from the earlier badge PR (#56, closed) — that one used the
pre-renumber prefixes (versionPrefix=0.4 / 0.5). After #57 landed
the renumber (easy-paging 0.4.0→3.0.0, 0.5.0→4.0.0), this PR finishes
the badge conversion with the correct post-renumber prefixes.

Changes per language (2 files, 40 lines each):

  Section headers — align with the renumber:
    "Spring Boot 4 (`0.5.x` line)"       → "(`4.x` line)"
    "Spring Boot 3 maintenance (`0.4.x` line)" → "(`3.x` line)"
    Korean equivalents.

  Maintenance branch link — the branch was renamed too:
    [`0.4.x` branch](.../tree/0.4.x) → [`3.x` branch](.../tree/3.x)

  Column header — slight tightening since the cell content is now a
    badge instead of a coordinate string:
    "Maven Central coordinates" → "Maven Central"

  14 rows — each "Maven Central coordinates" cell:
    [`kr.devslab:<artifact>:<version>`](sonatype-link)
      → [![Maven Central](shields.io/maven-central/v/...?...&versionPrefix=N)](sonatype-link)
    Where N = 4 for SB4 rows, N = 3 for SB3 rows. ssrf-guard rows
    use no prefix (single-line library; whatever's latest on Maven
    Central is what readers should pull).

The versionPrefix filter keeps the two easy-paging lines visually
independent — without it, the SB3 row's badge would jump to the latest
4.x patch the moment one ships.

Per-demo README "Files of interest" tables intentionally left as prose
(copy-paste-friendly Gradle snippets; #55 already aligned them with
the build files). A CI mismatch check is a follow-up if those drift
again.

Sibling PRs in the same badge sweep, already merged:
  - devslab-kr/.github#6  (org profile)
  - devslab-kr/api-log#3  (api-log doc surface for 3.0.0 renumber)

Maven Central propagation note: api-log v3.0.0 published 13:44Z,
profile badge picked it up within minutes — same auto-update behavior
will apply to these demos on the next easy-paging patch release.
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.

1 participant