• Yorick Peterse's avatar
    Add code for generating Markdown changelogs · e9cc000a
    Yorick Peterse authored
    This adds the basic building blocks for generating changelogs from a
    list of commits. The output is Markdown, and each release section is
    generated using a minimal, custom template language.
    
    In an early iteration we used Liquid, but this was found to suffer from
    unresolved security issues. Alternative template languages had their own
    share of issues that made using them not an option. The template engine
    introduced in this commit is the bare minimum that we need for changelog
    generation, and works by compiling the user provided template to an ERB
    template; making sure the user can't run arbitrary code. Using ERB
    allows us to offload the heavy lifting of a template engine to ERB,
    instead of having to write and maintain such an engine ourselves.
    
    The use of a template engine gives users control over how they want to
    present their changelog data, without GitLab having to provide
    potentially dozens of settings to enable this.
    
    This builds on the changes introduced in merge requests
    https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49243 and
    https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2842.
    
    See https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1369 for
    more information.
    e9cc000a
template.rb 842 Bytes