Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

How to get build id from ms.vss-build-web.build-results-tab #143

Open
szymon-wesolowski opened this issue Dec 5, 2019 · 1 comment
Open

Comments

@szymon-wesolowski
Copy link

szymon-wesolowski commented Dec 5, 2019

I'm useing new Azure DevOps Extensions SDK.

`import * as React from "react";
import * as SDK from "azure-devops-extension-sdk";

import { showRootComponent } from "../Common";

class BuildTabContent extends React.Component<{}, {}> {
constructor(props: {}) {
super(props);
}

public componentDidMount() {
    SDK.init();
    this.initializeComponent();
}

private async initializeComponent() {
    await SDK.ready();

    const configuration = SDK.getConfiguration();
    console.log(configuration)
}

public render(): JSX.Element {

    return (<div className="page-content">
        Hello World
    </div>
    );
}

}

showRootComponent();`

How to get build id from ms.vss-build-web.build-results-tab when the configuration is empty?

@karelkral
Copy link

Here is a result of my investigation of a source code. MS documentation sucks!
Beware, there is a bug in type definition

import * as SDK from "azure-devops-extension-sdk";
import { IBuildPageDataService, BuildServiceIds, IBuildPageData } from "azure-devops-extension- 
   api/Build";

const buildPageService: IBuildPageDataService = await SDK.getService(BuildServiceIds.BuildPageDataService);
const buildPageData = await buildPageService.getBuildPageData();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants