Skip to content

Changelog API returns 500 when changelog configuration file has an invalid indentation

Summary

Changelog API returns 500 when the changelog configuration file has an invalid indentation, instead of a more user-friendly message. This makes the error much harder to troubleshoot. This was reported by a customer in one of our support tickets. Here's the feedback from the customer:

it would be very helpful if the API gave contextual information on the error, in this case a YAML formatting error.

Steps to reproduce

  • Create a project
  • Add a custom config file with the following (the last line is not indent correctly):
---
template: |
  {% if categories %}
  {% each categories %}
  ### {{ title }}

  {% each entries %}
  - [{{ title }}]({{ commit.reference }})\
  {% if author.credit %} by {{ author.reference }}{% end %}

  {% end %}

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

What is the current bug behavior?

Changelog API returns 500 when changelog configuration file has an invalid indentation

What is the expected correct behavior?

Changelog API should fail with a more user-friendly message to make it easier to troubleshoot

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

Possible fixes

Edited by Bruno Freitas