Skip to content

ci(artifacthub): structured changelog with link on major - #1925

Open
mloiseleur wants to merge 3 commits into
traefik:masterfrom
mloiseleur:ci/artifacthub
Open

ci(artifacthub): structured changelog with link on major#1925
mloiseleur wants to merge 3 commits into
traefik:masterfrom
mloiseleur:ci/artifacthub

Conversation

@mloiseleur

Copy link
Copy Markdown
Member

What does this PR do?

Emit the structured artifacthub.io/changes annotation from hack/changelog.sh:

  • Patch/minor → per-kind entries (feat→added, fix→fixed, else changed), gitmoji stripped.
  • Major (X.0.0) → single changed entry linking to the release Upgrade Notes.
Generated output — last 3 versions
# 41.0.2 (patch)
  artifacthub.io/changes: |
    - kind: fixed
      description: "fix(crds): add missing hub.traefik.io_uplinks to kustomization"
    - kind: added
      description: "feat(deps): update traefik docker tag to v3.7.6"
    - kind: added
      description: "feat(deps): update ghcr.io/traefik/traefik-hub docker tag to v3.20.6"
    - kind: changed
      description: "chore(release): 🚀 publish 41.0.2"

# 41.0.1 (minor)
  artifacthub.io/changes: |
    - kind: fixed
      description: "fix(ingressroute): fail fast on uppercase ingressRoute keys (RFC 1123)"
    - kind: added
      description: "feat(hub): support traefik hub v3.20.5"
    - kind: changed
      description: "docs(hub): deprecate inline literal token in values"
    - kind: changed
      description: "chore(release): publish 41.0.1"

# 41.0.0 (major)
  artifacthub.io/changes: |
    - kind: changed
      description: "This is a major release with breaking changes. Read the upgrade notes before upgrading."
      links:
        - name: Upgrade Notes
          url: https://github.com/traefik/traefik-helm-chart/releases/tag/v41.0.0

Motivation

Artifact Hub buried the v41 breaking changes in a flat commit list (#1898). Artifact Hub has no "breaking" kind, so a major collapses to one entry pointing at the upgrade guide — impossible to miss.

More

  • Yes, I updated the tests accordingly
  • Yes, I updated the schema accordingly
  • Yes, I ran make test and all the tests passed

Emit the structured artifacthub.io/changes annotation so Artifact Hub renders
per-kind badges (feat->added, fix->fixed, else changed) and strips gitmoji
shortcodes.

On a major release (X.0.0), collapse the annotation to a single 'changed' entry
that links to the release Upgrade Notes, so the breaking-change signal is not
buried in a long commit list.
@mloiseleur mloiseleur changed the title ci(changelog): structured Artifact Hub changelog with breaking-change link on major ci(artifacthub): structured changelog with breaking-change link on major Jul 8, 2026
@mloiseleur mloiseleur changed the title ci(artifacthub): structured changelog with breaking-change link on major ci(artifacthub): structured changelog with link on major Jul 8, 2026
@darkweaver87

Copy link
Copy Markdown
Contributor

Nice one — the breaking-change link on major is exactly what we were missing after #1898. Few things I'd tweak before it goes in:

The gitmoji stripping doesn't fully work — the regex only catches text shortcodes like :rocket:, but our changelog already has the rendered unicode emoji, so the output still shows chore(release): 🚀 publish 41.0.2. Since the description is plain text on Artifact Hub, might as well strip the unicode ones too.

Also, every release ends up listing its own chore(release): publish X commit as a changed badge — pure noise, we can filter it out.

Small hardening: esc only escapes ", so a stray backslash would break the YAML string. Won't happen with conventional commits realistically, but it's a one-liner to cover.

Last one, and the bigger one: right now everything that isn't feat/fix falls into changed, so we only use 2 of the 6 kinds. Could map a bit more:

  • feat → added
  • fix → fixed
  • perf → changed
  • revert → removed
  • else → changed

deprecated and security don't have a conventional-commit type, so let's just skip those two.

@darkweaver87

darkweaver87 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Pushed 8c922f1 with all four points, ready for another pair of eyes while @mloiseleur is away.

  • Unicode gitmoji: GNU sed can't match multibyte ranges, so the shortcode sed became one perl -CSD pass covering both forms. Perl ships by default where GNU sed doesn't, so no extra install.
  • Release commits: filtered with grep -v '^\* chore(release)'.
  • Escaping: backslash first, then quote.
  • Kinds: perf → changed, revert → removed; deprecated/security have no conventional-commit type.

Re-ran against the real Changelog.md for 41.0.2 / 41.0.1 / 41.0.0 (matches the PR description minus the filtered release lines), plus a synthetic one for escaping and accented text. The emitted annotation round-trips through yq.

@darkweaver87 darkweaver87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@darkweaver87

Copy link
Copy Markdown
Contributor

@bpsoraggi could you have a look ?

@bpsoraggi bpsoraggi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

3 participants