alejandro5042 / azdo-userscripts

A collection of userscripts to improve the Azure DevOps UI
https://alejandro5042.github.io/azdo-userscripts/
MIT License
40 stars 23 forks source link

PR build result icon on PR landing page shows successful when no builds have run #227

Closed kroeschl closed 5 months ago

kroeschl commented 1 year ago

When no builds exists for the latest merge commit for a PR, such as when a PR has no PR builds or PR builds for the latest merge haven't been enqueued yet, the PR landing page will show the build success icon for that PR.

Note that this is different from #50, which refers to successful builds where the result is older than the maximum value configured in the repo policies.

Example screenshots ![image](https://github.com/alejandro5042/azdo-userscripts/assets/60117794/f4e302b8-fe18-449c-ae4a-4478e73eacad) ![image](https://github.com/alejandro5042/azdo-userscripts/assets/60117794/1d79bf13-3e1d-41ae-859d-1eb7236bb3f4)

Context

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Please refer to our support and troubleshooting docs.

kroeschl commented 1 year ago

Digging into this more, I think my PR being a draft was messing with things. In draft PRs, PR builds must be manually enqueued, so my last build was failed/timed out but there weren't actually any runs on the latest merge, which is what we check here:

https://github.com/alejandro5042/azdo-userscripts/blob/7f427845d9fe67e04465bd26debf2acf130453b3/src/azdo-pr-dashboard.user.js#L1620-L1621

We probably need to change that check from !builds to !builds?.length so we show nothing instead of a check mark when there are no builds for the latest merge. Ideally we'd try to check for the most recent build (if any), but I don't see a reasonable way to backtrack through merge commit IDs (AFAICT we only get the branch HEAD commit IDs for each PR iteration, not the merge commit ID).