Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add artifacthub.io/changes changelog annotation to the released chart #949

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Nov 20, 2023

This PR adds Artifact Hub annotation in the released chart so it can renders its integrated changelog: https://blog.artifacthub.io/blog/changelogs/

Notes:

  • Only the current version changes have to be included, not the full changelog.

  • It's the simple form of Artifact Hub changes. Looking at the existing changelog, I'm not sure the more complete form will ever be needed.

  • I had to strip emojis to avoid having the scalar value broke as single string and failing chart-releaser step:

    📦 Add `artifacthub.io/changes` changelog annotation to the released chart.
    
    Table example:
    | plugin                | old version          | new version           |
    |-----------------------|----------------------|-----------------------|
    | kubernetes            | 3900.va_dce992317b_4 | 3937.vd7b_82db_e347b_ |
    | configuration-as-code | 1625.v27444588cc3d   | 1647.ve39ca_b_829b_42 |
    

    replaced by

    artifacthub.io/changes: "\U0001F4E6 Add `artifacthub.io/changes` changelog annotation to the released chart.\n\nTable example:\n| plugin                | old version          | new version           |\n|-----------------------|----------------------|-----------------------|\n| kubernetes            | 3900.va_dce992317b_4 | 3937.vd7b_82db_e347b_ |\n| configuration-as-code | 1625.v27444588cc3d   | 1647.ve39ca_b_829b_42 |"
    
  • I'm using yq to retrieve the version directly from Chart.yaml, easier than the previous method requiring two steps.

Tested on a fork:

  • Entry in CHANGELOG.md starting with an emoji and including a table: https://github.com/lemeurherve/jenkinsci-helm-charts/blob/862770b35ef457f3ffc20b6286e227ee74fef91f/charts/jenkins/CHANGELOG.md?plain=1

  • Release: https://github.com/lemeurherve/jenkinsci-helm-charts/releases/tag/jenkins-4.8.4

  • Released Chart.yaml content
    annotations:
      artifacthub.io/category: integration-delivery
      artifacthub.io/changes: |-
        Add `artifacthub.io/changes` changelog annotation to the released chart.
    
        Table example:
        | plugin                | old version          | new version           |
        |-----------------------|----------------------|-----------------------|
        | kubernetes            | 3900.va_dce992317b_4 | 3937.vd7b_82db_e347b_ |
        | configuration-as-code | 1625.v27444588cc3d   | 1647.ve39ca_b_829b_42 |
      artifacthub.io/images: |
        - name: jenkins
          image: jenkins/jenkins:2.426.1-jdk11
        - name: k8s-sidecar
          image: kiwigrid/k8s-sidecar:1.24.4
        - name: inbound-agent
          image: jenkins/inbound-agent:3107.v665000b_51092-15
        - name: backup
          image: maorfr/kube-tasks:0.2.0
      artifacthub.io/license: Apache-2.0
      artifacthub.io/links: |
        - name: Chart Source
          url: https://github.com/jenkinsci/helm-charts/tree/main/charts/jenkins
        - name: Jenkins
          url: https://www.jenkins.io/
        - name: support
          url: https://github.com/jenkinsci/helm-charts/issues
    apiVersion: v2
    appVersion: 2.426.1
    description: Jenkins - Build great things at any scale! The leading open source automation
      server, Jenkins provides over 1800 plugins to support building, deploying and automating
      any project.
    home: https://jenkins.io/
    icon: https://get.jenkins.io/art/jenkins-logo/logo.svg
    keywords:
    - jenkins
    - ci
    - devops
    maintainers:
    - email: [email protected]
      name: maorfr
    - email: [email protected]
      name: torstenwalter
    - email: [email protected]
      name: mogaal
    - email: [email protected]
      name: wmcdona89
    - email: [email protected]
      name: timja
    name: jenkins
    sources:
    - https://github.com/jenkinsci/jenkins
    - https://github.com/jenkinsci/docker-inbound-agent
    - https://github.com/maorfr/kube-tasks
    - https://github.com/jenkinsci/configuration-as-code-plugin
    version: 4.8.4
    

Follow-up of:

Submitter checklist

Preview Give feedback

Special notes for your reviewer

@lemeurherve lemeurherve requested review from a team as code owners November 20, 2023 23:08
@lemeurherve lemeurherve force-pushed the artifact-hub-changelog branch 2 times, most recently from 714972d to a3b6c7c Compare November 20, 2023 23:12
@lemeurherve lemeurherve force-pushed the artifact-hub-changelog branch from a3b6c7c to d4dc896 Compare November 20, 2023 23:15
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

wow nice!

@timja timja merged commit 45203bf into jenkinsci:main Nov 22, 2023
5 checks passed
@hervelemeur
Copy link

I need to prepare a fixup to properly quote the changelog if it contains only one line.

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