---
# Settings for generating changelogs using the GitLab API. See
# https://docs.gitlab.com/ee/api/repositories.html#generate-changelog-data for
# more information.
categories:
  added: Added
  fixed: Fixed
  changed: Changed
  deprecated: Deprecated
  removed: Removed
  security: Security
  performance: Performance
  other: Other
template: |
  {% if categories %}
  {% each categories %}
  ### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %})

  {% each entries %}
  - [{{ title }}]({{ commit.reference }})\
  {% if author.contributor %} by {{ author.reference }}{% end %}\
  {% if commit.trailers.MR %}\
   ([merge request]({{ commit.trailers.MR }}))\
  {% else %}\
  {% if merge_request %}\
   ([merge request]({{ merge_request.reference }}))\
  {% end %}\
  {% end %}

  {% end %}

  {% end %}
  {% else %}
  No changes.
  {% end %}

---
# Settings for generating changelogs using the GitLab API. See
# https://docs.gitlab.com/ee/api/repositories.html#generate-changelog-data for
# more information.
categories:
  added: Added
  fixed: Fixed
  changed: Changed
  deprecated: Deprecated
  removed: Removed
  security: Security
  performance: Performance
  other: Other
template: |
  {% if categories %}
  {% each categories %}
  ### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %})

  {% each entries %}
  - [{{ title }}]({{ commit.reference }})\
  {% if author.contributor %} by {{ author.reference }}{% end %}\
  {% if commit.trailers.MR %}\
   ([merge request]({{ commit.trailers.MR }}))\
  {% else %}\
  {% if merge_request %}\
   ([merge request]({{ merge_request.reference }}))\
  {% end %}\
  {% end %}

  {% end %}

  {% end %}
  {% else %}
  No changes.
  {% end %}
# The format for tags that Omnibus uses isn't semver compliant, so we need to
# specify a custom format here.
#
# We only match EE tags in this regex. Release tools tags CE first, then EE.
# While it doesn't really matter which of the two we match, we opted to go with
# EE tags here so we have the same behaviour; regardless of the tagging order.
#
# This does not affect the commits included in the range, as no changelog
# commits are introduced between the tag commits.
tag_format: '^(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\+(?P<pre>rc\d+))?((\.|\+)(?P<meta>ee\.\d+))?$'

Use a custom tag format for changelogs
Use a custom tag format for changelogs

This allows us to handle the Omnibus tag format, which isn't compliant
with semantic versioning. We filter out CE tags as we don't need them to
determine a changelog commit range, as no changelog commits are
introduced between creating the CE and EE tags.

See https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1551 for
more information.
