In certain corner cases, upon attempting to decorate an Azure DevOps Pull Request with several iterations, our computer engine may be attempting to decorate the wrong iteration, which results in the Quality Gate (and its comments) not showing on Azure.
This is happening when the last iteration on a PR is not a commit, but a "retarget".
We try to infer the iteration id from the PR Head SHA (which is available on the analysis context), by getting the list of Pull Request Iterations from Azure, and then filtering the list to see which one is the first iteration to have a commit id that matches the SHA. However, this is not correct.
If the list of iterations contains several, we should return the one with the biggest iteration id (which is the one that will be shown on Azure's UI).