Comments (4)
Going forward you can file your vsts-python-api issues directly in the vsts-python-api repo:
https://github.com/Microsoft/vsts-python-api/issues
I have forwarded your question to the git api team, and will get back to you.
from azure-devops-cli-extension.
On a side note, we have a new documentation site for the VSTS APIs with examples. Our python-sdk-api is just a wrapper for the REST apis, so you may find useful information here:
https://docs.microsoft.com/en-us/rest/api/vsts/git/commits
from azure-devops-cli-extension.
You can get all the tags from the /refs/tags endpoints. For example, tag1 below is annotated and tag2 is a lightweight:
{
value: [
{
name: "refs/tags/tag1",
objectId: "b0fa354e399adc227fe013e3a9e1b4947659beee",
},
{
name: "refs/tags/tag2",
objectId: "6d9ae2bf6883412bab2d389a3b5e1447003944eb",
}
],
count: 2
}
In the tag2 case, the objectId is the commit as it is a lightweight tag. In the tag1 case, if we want the commitId we need to crack the annotated tag, which you can do with the annotated tag endpoint (https://docs.microsoft.com/en-us/rest/api/vsts/git/Annotated%20Tags/Get). In my example, if I go to /annotatedtags/b0fa354e399adc227fe013e3a9e1b4947659beee off the repository REST API, I then get the response:
{
name: "refs/tags/tag1",
objectId: "b0fa354e399adc227fe013e3a9e1b4947659beee",
taggedObject: {
objectId: "6d9ae2bf6883412bab2d389a3b5e1447003944eb",
objectType: "commit"
},
message: "hello",
}
In this result we see that the annotated tag b0fa354e399adc227fe013e3a9e1b4947659beee
points to the object 6d9ae2bf6883412bab2d389a3b5e1447003944eb
which is a commit. Since annottated tags can point to annotated tags, you may have to follow the chain until you get to the taggedObject being of objectType commit.
from azure-devops-cli-extension.
@WilAtMSFT @tedchamb thanks for the answer.
It would have been handy to not need to fire another request to distinguish between simple and annotated tags, but it's not an additional request that will make a big difference.
from azure-devops-cli-extension.
Related Issues (20)
- az pipeline create failed
- [Feature Request]
- while doing security update it kept on failing although --subject parameter is correct as per documentation
- ERROR: Could not resolve identity: SOME-SECURITY-GROUP
- Bug: the azure-devops cache folder location is computed differently in different places
- [Feature Request] Install keyring by default or offer a way to install keyring without causing error messages
- [Feature Request] Extend `--detect` to use environment variables available when running in Azure Pipelines
- [Feature Request] Ability to create deployment groups
- [Feature Request] support `requireVoteOnEachIteration` and `requireVoteOnLastIteration` for `az repos policy approver-count`
- Not able to download universal packages from public feeds HOT 1
- [Feature Request] `az repos show` should auto-detect `--repository` via git config HOT 1
- [Feature Request] `az artifacts universal` should support preemptively installing artifacttool
- [Error] Artifact Tool hangs and causes docker dev container to lose network connectivity
- [Feature Request] Update repository description url to a valid one
- Description not working in pull request command
- [Feature Request] Set Team Admin on Project Team
- [Feature Request] Wiki include subpages (recursion level parameter) HOT 1
- [Feature Request] [Proposal] New commands to push a build request to the top of the pool queue
- Should use win-arm64 ArtifactTool for Windows 11 on Arm64
- Windows Subsystem Linux AZ CLI DevOps Query SSLError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-devops-cli-extension.