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

Add $CATEGORIES as a template variable #139

Closed
smyrick opened this issue Mar 8, 2019 · 10 comments · Fixed by #1013
Closed

Add $CATEGORIES as a template variable #139

smyrick opened this issue Mar 8, 2019 · 10 comments · Fixed by #1013

Comments

@smyrick
Copy link

smyrick commented Mar 8, 2019

Currently the categories will just be appended to the end of the template. I would like to control where in the template they go. So if we had a $CATEGORIES variable that could go in the template string that would solve the problem.

An example

name-template: v$NEXT_PATCH_VERSION
tag-template: v$NEXT_PATCH_VERSION
categories:
  - title: Bug Fixes
    label: fix
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
template: |
  $CATEGORIES

  ## Other Changes

  $CHANGES

would result in this:

## Bug Fixes

- fix: example (#2) @smyrick

## Other Changes

- docs: other change (#3) @smyrick
@TimonVS
Copy link
Member

TimonVS commented Apr 5, 2019

This feature makes a lot of sense to me. We should probably keep $CHANGES like it is to not break people's workflows.

We could decide to introduce two new variables: $CATEGORIZED_CHANGES and $UNCATEGORIZED_CHANGES, or we could change the way $CHANGES is rendered to always append uncategorized changes at the end with the ## Other Changes header.

@toolmantim
Copy link
Collaborator

It'd be really nice if we could switch to this:

categories:
  - title: 🚀 Features
    label: feature
  - title: 🐛 Bug Fixes
    label: fix
template: |
  $CHANGES

producing:

## 🚀 Features

* Add important feature (#2) @TimonVS 

## 🐛 Bug Fixes

* Important bug fix (#1) @TimonVS 

## Other Changes

* Update documentation (#3) @TimonVS 

and if you wanted to change the header label:

categories:
  - title: 🚀 Features
    label: feature
  - title: 🐛 Bug Fixes
    label: fix
  - title: 📝 Other Changes
template: |
  $CHANGES

(aka label: null)

That might be hard to keep backwards compatibility though @TimonVS?

@TimonVS
Copy link
Member

TimonVS commented Apr 7, 2019

Agreed @toolmantim, let's go with that :)

@jetersen
Copy link
Member

jetersen commented Apr 22, 2019

I'd like to work on this, as an preparation I wanted to add schema to catch configuration mistakes, I feel like the configuration is becoming increasingly complex to warrant a schema.

@toolmantim
Copy link
Collaborator

toolmantim commented Apr 22, 2019

That’d be great @jetersen. I did that for https://buildkite.com/changelog/36-autocomplete-for-your-pipeline-dot-yml-files and it was 👌🏼

We can submit it to http://schemastore.org/json/ for the file pattern release-drafter.yml and have it point to a schematic in this repo (see my PR SchemaStore/schemastore#578 for an example)

This would mean that when run as a GitHub Action (#181) we could output nicer config valuation errors too using AJV, as we did with https://github.com/buildkite-plugins/buildkite-plugin-linter

@jetersen
Copy link
Member

Sure, I built the schema with Joi (idea taken from stale bot) I should be able to convert Joi to JSON schema 😉

@oleg-nenashev
Copy link
Contributor

+1 from me. I am working on the pre-release changelog generation for Release Drafter for https://github.com/jenkinsci/jenkins. , and I would like to add categories like bug or rfe to follow https://jenkins.io/changelog/

My suggestion would be to not only follow the labels, but to actually introduce a new category ID field so that we can split the labeling and the changelog parts:

categories:
  - title: 🚀 New features and improvements
    id: rfe 
    labels:
      - enhancement
      - feature
  - title: 🐛 Bug Fixes
    id: bug
    labels:
      - bug
      - fix
      - bugfix
      - regression  

P.S: Current YAML draft is here: https://github.com/oleg-nenashev/jenkins/releases/tag/untagged-010cd0d0ed069df04d00

CC @daniel-beck

@Mike-E-angelo
Copy link

Mike-E-angelo commented Nov 21, 2019

Yeahhh this is an amazing product! We are incorporating it into our repo... and the first thing that strikes you is where the features are in relation to everything else.

https://i.imgur.com/92cSUbB.gifv

😆

Having the ability to separate categories from the "remainder" would be awesome. 👍

@jetersen
Copy link
Member

jetersen commented Feb 2, 2020

I think with my recent changes to #412 this should be fairly easy to introduce as I have split the uncategorized changes from the changes array.

@jetersen
Copy link
Member

created #1013

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 a pull request may close this issue.

6 participants