Imagine this:
You have an Azure DevOps 2019 server and a XAML Build definition.
You queue a few check-ins to the build definition. The first one is in progress of being checked in, the rest are waiting in queue.
How does one using the REST API get the shelvesets of the queued builds?
It's easy to get the shelveset associated with the InProgress build, because there's a BuildID present. I use it to get more details on the build using the API, e.g.: "Builds/33217/Details". From there on, I can get to the shelveset.
If a build is queued (or NotStarted), then the build details API returns:
{
"value": [],
"count": 0
}
... and therefore I cannot get the shelveset.
I was under the impression that a upgrade to DevOps 2019 amends the API, so that one can easily get the queued shelveset from XAML build definitions as well. However, I'm not sure what I'm missing here. Should I be using another API?
Short answer ref Microsoft backlogged/doesn't exist/no easy way explained in option
1, but I used option2, and option3, I hope this helps you, I struggled a good bit!Option 1: No example so, MS build docs was clear as mud for me, and was not helpful but its listed as possible, I gave up and took a different route, below..
Option 2:
since
shelveSets are unversioned Azure DevOps uses versionedchangeSetsper their ER/DB Design ,I had to get the associated shelveSets via ChangeSets/or WorkItems in a build.First, a nice article I found to help me understand the relationship and difference between two key items,
changeSetvsshelveSetAzure DevOps in relation to a build. ThechangeSetwill allow you to find associatedshelvesetsto build, query it and getDimChangeset, I suspect you have to do this in a couple of steps.IMHO versioning allows you get your
changeset associated with a build, and then you can get the shelveset that went into that changesetStep 1: get changetSets for a ShelveSet
Step 2: get
Step 3: I
manually jointhe Response in my middle wareoption 3:
Follow a
practice of taggingyourshelveSetsThen, you query, using tags filer:
tagFilters={tagFilters}in your build queryUse the tags from your shelvesets and filter from your builds list
tagFilters={tagFilters}, of course this assume you setup tags