microsoft / simple_ado Goto Github PK
View Code? Open in Web Editor NEWAn easy to use wrapper around the Azure DevOps REST API
License: MIT License
An easy to use wrapper around the Azure DevOps REST API
License: MIT License
While the class is helpful for the default collections case / visualstudio, I've found that it has a number of issues with URLs like dev.azure.com, when interacting with those sites via the api_endpoint method. In these cases, I think that if you allow a URL that's the full /_git/{project_name} override to be passed in, you could simply replace _git with _apis and achieve the necessary result.
Open to alternative ideas?
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
It seems that the API versions used in simple_ado are very old, and cannot be configured.
E.g. in git.py on line 89, we see:
request_url = f"{self.http_client.api_endpoint(project_id=project_id)}/git/repositories/?api-version=1.0"
The latest stable API version seems to be 6.0, and the oldest documentation available is version 4.1.
โ๏ธ
I am unsure of how to create a new work item using this. I can create a very simple create request using the 'requests' module to complete this however on doing so I am unaware of how to set the WorkItemType etc. Looking into simple_ado there seems to be a lot of functionality but I am just unsure of how to utilize this. I have my PAT and URL as well as what fields I'd like to populate when creating a new WorkItem but am just unaware of how to do so. In a very sad pseudocode effort this is the kind of thing I am trying to acheive:
Import simple_ado
pat = '***************'
url = 'https://dev.azure.com/lochlannyeal/lochlannyeal'
fields = ["title","status","WorkItemType"]
input = ["Hello","In Progress","Issue"]
simple_ado.createWorkItem(fields, input)
I believe this is due to the server in question responding without a content-length header because of chunked encoding.
I initially found your project in a roundabout way because of a similar issue with azure-devops-python-api where when pulling a tree zip, a Generator would be created, so there was no reasonable way to get a progress update bar going. The interface you've created is a lot simpler and easy to use, which is perfect for my purposes, and has made my development much more streamlined, but it would be nice to find a way to show a progress bar. For large mono-repos, a download can take quite some time.
Perhaps there is a way to recursively get all items from a tree via a given path and then calculate an approximate total size? I played a bit with hacking up download_zip to simply get all tree entries from a given path, ignoring content and grabbing metadata, and it did seem to have sizes returned. Perhaps if we summed these, we could simply pass them into the download_zip call and have that be the fall back if the content-length isn't provided?
This seems to be a useful set of tools. Does it have any documentation describing how to use each API?
Would be nice to extend this to use msal for additional authentication types, like device flow.
@guojiubo maybe we need to fix it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.