Add a REST API for generating a changelog from a list of commits
We need an API in GitLab that is used for generating a changelog section and adding this to a changelog file.
The input of this API will be:
- The project to generate the data for
- A start and end ref to use for fetching commits
- A branch name to commit the changes to
- The path to the file to write the changes to
- The name of the release in the format
MAJOR.MINOR.PATCH. RC/beta/etc identifiers won't be supported for the time being, unless we already happen to have a working semantic versioning version parser
- An (optional) commit message to use when updating the changelog
- An (optional) message to display in a release section when there are no changes
If the file already exists, the section is to be appended after the release that precedes it; instead of always being added to the top. If the file doesn't exist, it's to be created
The API will commit the changes to Git, using the author details of the user that triggered the API call. If a conflict occurs when committing the changes, GitLab will retry up to 3 times. If the conflict persists, the API will produce an error.
If a changelog section already exists for a release, GitLab is to produce an error. This way you don't accidentally overwrite existing data.
The API should not return until all work has been committed.
This API should be hidden behind a feature flag that is disabled by default, and can be enabled on a per-project basis.