Skip to content

Add an extended_trailers field to the commits API

Robert May requested to merge commits-api-better-trailers into master

What does this MR do and why?

Adds a new field to the commits API that returns correctly-parsed commit trailers. The existing field only returns the last value for each key, which is certainly unintentional, but has been the case for a long time and so this could be considered a breaking change. For now we'll introduce this as a new field and then start to deprecate the old implementation.

Related #387555 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Push a commit with trailers in the message, ideally multiple, e.g. "Cc: John Doe", "Changelog: added" etc
  2. Call the commits API endpoint with the trailers param set to true
  3. trailers and extended_trailers should both exist in the response, and for instances where multiples of the same trailer key exist, trailers will only show the last value and extended_trailers will show them all

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Robert May

Merge request reports