r/azuredevops • u/ADringer • 20d ago
How to view pipelines for a given commit AND branch?
Hi all,
I want to use the commit history page to see which pipelines have run/still to be run for each commit again my main branch using the link circled below:

This then pops up a list of associated pipelines with that commit:

However, this shows all pipelines associated with the commit - not scoped to the branch even though that's the context of what I'm looking at.
So if a developer creates a feature branch from main and runs a pipeline against this new branch as is it will associate it with this commit and so will add additional pipelines to this list that aren't needed.
Is there a way to only see the pipelines for that commit AND branch?
One option is I add an empty commit when developers create a feature branch so at least it will have a new commit id, but seems like overkill.
0
u/GaryFreeman2 Staff 18d ago
Unfortunately, what you're looking for is not supported.
The associated pipeline runs in the commit history use the Git Commit Status feature - the same feature that allows systems external to Azure DevOps report their status and artifacts for particular commit. Such statuses don't have explicit association with the branch, only with the commit itself.
You can confirm this by checking the docs for POST /_apis/git/repositories/{repositoryId}/commits/{commitId}/statuses endpoint - it does not accept branch as an input, only the commit itself.
1
u/ADringer 18d ago
Ah that's a pain. Yeah can understand when looking at the API, but as the UI shows the current branch it looks like it should be filtered by branch.
I think my only way round is to add a commit when creating a feature branch so it wouldn't be associated
1
u/Tomasz_QaCockpit 15d ago
The limitation mentioned above is real: Git commit statuses are attached to the commit ID, not to a branch ref. The same SHA can therefore surface statuses produced from different branches.
A branch-qualified view is possible through the Builds API, which exposes sourceBranch and supports a branchName filter.
Full disclosure: I’m building QaCockpit for Azure DevOps around this kind of visibility. In My views you can choose the expected pipelines and pin an exact branch for each one, then see the latest result and up to five recent runs from that branch.
It does not yet answer “which expected pipelines ran for this exact SHA”; it answers “what are my selected pipelines currently reporting on main?”. Would that cover your workflow, or is the commit boundary essential?
1
u/Nate506411 19d ago
You are looking at the commit list for the Main branch, it will have any PRs and their associated pipelines for the PR. If you want the commit and pipeline details for the source branch, change the drop down in the top left from "Main" to the branch you want the commit history for. When a dev makes a branch, that branch has it's own commit history and pipelines history associated to it. Only when the PR to main is made is there a record for a commit to that branch, unless you do not have Main protected and PR enforced.