Improve "most recent deployment" for API, Environments Index, Job note

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Release notes

Problem to solve

Currently the API, Environments Index and Job note sort by creation of deployment. This is problematic when as a deployment can be deployed after it's created but created before another deployment.

Proposal

Update the API, Environments Index and Job note lastest deployment to use latest "Deployment" field of deployments.
As in change #292031 (closed) this was changed to the latest "Deployment" field of a deployment.

Intended users

-->

Metrics

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖