Add .txt format support to changelog API
What does this MR do and why?
Every time I want to preview what the next release will include for my project I hit https://gitlab.com/api/v4/projects/56614952/repository/changelog?version=v999.999.999 and see something like:
{"notes":"## 999.999.999 (2026-05-22)\n\n### Maintenance (6 changes)\n\n- [Update dependency...Then I have to copy/paste into VSCode, trim the JSON then find & replace \\n with \n to see the plain text.
This MR adds .txt format support to the changelog GET endpoint, using Grape built-in format routing (the same pattern used by the repository archive endpoint). Appending .txt to the URL returns the changelog as plain text Markdown instead of JSON.
GET /projects/:id/repository/changelog.txt?version=1.0.0References
Similar pattern: Retrieve file archive from a repository uses [.format] suffix for response format control.
How to set up and validate locally
- Create a tag & release
- Push a commit with a changelog trailer like:
Did a thing Changelog: Feature - Hit http://gdk.test:3000/api/v4/projects/19/repository/changelog?version=v999.999.999 and see the JSON changelog
- Hit http://gdk.test:3000/api/v4/projects/19/repository/changelog.txt?version=v999.999.999 and see the plain text changelog
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.