Add latest pipelines link to api
What does this MR do?
This change adds an endpoint to the api. It mimics the changes as a part of !20865 (merged) / #50499
Does this MR meet the acceptance criteria?
It adds functionality to the api that parallels that added to the UI.
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. - Already included in !20865 (merged)
-
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
The only performance concern here is having to make a repository hit when we look up the the sha for the hash. This, however, is required in order to get the pipelines in the correct order in case you have a newer (by creation) pipeline for an older branch sha.
It suggested I ask @stanhu to review this, but I'm also throwing @rymai and @matteeyah on here since they reviewed/merged !20865 (merged) recently.
#50499 already exists but doesn't mention this, should I file another issue to cover the API case for it?
Edited by Grzegorz Bizon