azure-devops-extension-api | REST client libraries and contracts for Azure DevOps web | Azure library
kandi X-RAY | azure-devops-extension-api Summary
kandi X-RAY | azure-devops-extension-api Summary
REST client libraries and contracts for Azure DevOps web extension developers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of azure-devops-extension-api
azure-devops-extension-api Key Features
azure-devops-extension-api Examples and Code Snippets
Community Discussions
Trending Discussions on azure-devops-extension-api
QUESTION
I'm developing an Azure DevOps extension which lists all builds for a project. I'm using GetBuilds API from BuildRestClient class.
I have 1500 builds in my project, when I make above API call it only returns 1000 builds. In order to fetch remaining 500 builds, I know I have to make another API call by passing "continuationToken" parameter to API.
But the question is how to fetch the continuationToken from the first API call? I tried to look for the solution everywhere, couldn't find any!!
PS: I've tried fetching builds using ListBuilds REST APIs through Postman, able to fetch all 1500 by making two API calls. First API call returns 1000 builds along with continuationToken as part of response header, which is used to fetch remaining builds by passing header value as input parameter to second API call.
...ANSWER
Answered 2021-Dec-29 at 09:18As of now, we cannot get the continuationToken as part of GetBuilds API result. We need to call build List api and parse response header to get continuation token.
Got this workaround from developer community. Check here.
QUESTION
I'm trying to publish an extension by vsce, I logged in with the user access token, after the build its create a file named 'NadavShaked.my-first-extension v1.0.968.vsix' I'm trying to publish the extension to the marketplace by this command 'vsce publish' and received this error:
this is the guide I used https://code.visualstudio.com/api/working-with-extensions/publishing-extension
this is my azure-devops-extension.json file:
...ANSWER
Answered 2021-Nov-02 at 07:55vsce
is not the right command to publish to Azure devops.
In my package.json
, I used npm run publish-extension
or better npm run package-extension
and published it by hand.
QUESTION
I'm trying to run a pipeline from an Azure DevOps hub extension, using the azure-devops-extension-api.
The azure-devops-extension-api (GitHub repository) contains several rest client classes, such as the BuildRestClient class and the ReleaseRestClient class. Both of which I've successfully used methods from.
However, the azure-devops-extension-api doesn't contain any rest client class for the Runs - Run Pipeline Azure DevOps Services REST API. I'm suspecting that this is because this endpoint is new for the 6.0 version of the API, and so it hasn't been implemented in the azure-devops-extension-api yet
Is there any way that I could use this azure-devops-extension-api to run a specified pipeline? Perhaps via the queueBuild method? I want to run a specific pipeline though, not a specific old build.
Any input would be appreciated!
...ANSWER
Answered 2020-Sep-25 at 08:59Yes, if you want to use azure-devops-extension-api to run a specified pipeline, you can use queueBuild method.
Regarding the sourceBuildId
parameter, there is no specific description in the document, I will add it here.
sourceBuildId
: The source build must be a pull request build if queueing with sourceBuildId
.
QUESTION
Using the Azure Devops Extension API in an extension I'm building and wondering if there is an API available to tell if the current user is the organization admin so that we can hide/show different options for that user(s). Or is there another API that I can hit from my extension to get some extended details about the current user rather than what comes back with SDK.getUser()
ANSWER
Answered 2020-Sep-23 at 08:20You can get PCA members via the API below, and check whether the current user in PCA:
QUESTION
I’ve tried to update a functional component that points to an azure-devops-ui/Filter
. I am using azure-devops-extension-sdk
that returns an async response, in order to use this component:
https://developer.microsoft.com/en-us/azure-devops/components/filter
inside a WorkItem on Azure DevOps
I’ve already code with both a class-based and function component using this.state
/componentDidMount
and useState
/useEffect
respectively. I followed this SO post.
However, I only can re-render the state. The UI component neither in a class nor in a functional component updates when the state is updated.
There are my two versions of the code, both them wait for the response and successfully update state. However, neither will wait for render of the UI.
General Component:
...ANSWER
Answered 2020-Apr-20 at 15:00Writing a functional react component is simple with the new React Hooks. In the example below, I'm using useState
and useEffect
. The useState
hook is synonymous with this.state/this.setState
in a class-based React component. The useEffect
hook is similar to componentDidMount
+componentDidUpdate
. It also is capable of being componentDidUnmount
.
The way the code will execute is from top to bottom. Because it's functional, it will run through once and render with the default state set at the argument to useState
. It will not block on getting data from the API in the useEffect
function. Thus, you need to be able to handle loading without having data. Anytime props.apiConfig
or props.id
changes, the component will re-render and all the useEffect
again. It will only call useEffect
if props.apiConfig
and props.id
do change after first run. The only nasty part is that useEffect
cannot be an async
function, so you have to call the function getDataWrapper
without using await
. When the data is received by the API, it will store the data in state
, which will trigger a re-render of the component.
To Summarize:
- Render once with default state
- Call
useEffect
, which callsgetDataWrapper
- return component with initial values in
useState
- Call
- Once data is received by the API in the
useEffect
/getDataWrapper
function, set the state viasetState
& setisLoading
tofalse
- Re-render the component with updated value that
setState
now contains- Avoid the
useEffect
control path since the values in the second argument ofuseEffect
have not changed. (eg:props.apiConfig
&props.id
).
- Avoid the
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-devops-extension-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page