未将扩展添加到构建任务时,隐藏VSTS/TFS扩展的“摘要"部分 [英] Hide VSTS/TFS extension's Summary section when extension not added to build task

查看:81
本文介绍了未将扩展添加到构建任务时,隐藏VSTS/TFS扩展的“摘要"部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开发了VSTS/TFS扩展,其中包含摘要页面,其中包含在构建结束时从扩展任务生成的详细信息.

We have developed VSTS/TFS extension which consists summary page with details generated from our extension task, at the end of build.

我们在清单文件中添加了类似于以下内容的内容,以添加此摘要部分

we have added contribution similar to below in manifest file to add this summary section

{
            "id": "build-status-section",
            "type": "ms.vss-build-web.build-results-section",
            "description": "A section contributing to our own new tab and also to existing build 'summary' tab",
            "targets": [
                ".build-info-tab",
                "ms.vss-build-web.build-results-summary-tab"
            ],
            "properties": {
                 "name": "Custom Section",
                 "uri": "statusSection.html",
                 "order": 20,
                 "height": 500
            }
        }

但是目前我们面临的问题是,即使用户未将扩展程序任务添加到其构建中,我们的摘要"页面也会显示在摘要"标签中(如果已安装并启用了扩展程序).

However currently we are facing issue as even when user not add our extension task in to his build our summary page will appear in summary tab (if our extension is installed and enabled).

当我们的任务未添加到其构建中时,有什么方法可以避免显示摘要部分.请足够帮助您.

Is there any way to avoid displaying summary section when our task is not added to their build. Please be kind enough to help on this.

推荐答案

否,您无法隐藏摘要部分.

No, you can't hide the summary section.

这是因为build-results-summary-tab用于所有构建.因此,当您安装扩展程序时,即使您没有添加开发的任务,也将显示任何构建结果的摘要结果.

This is because build-results-summary-tab is used for all builds. So when you install the extension, even you are not add the task you developed, the summary results will be showed for any of build results.

更多详细信息,您可以参考可定位的中心组显示.

More details, you can refer Referencing contributions and types and the example as Targetable hub groups shows.

解决方法是您可以将build-results-summary-tab扩展名与构建任务扩展名分开(改为使用两个扩展名).对于需要查看摘要结果的帐户,他们可以安装两个扩展.否则,这些帐户只需要安装构建任务的扩展程序即可.

The work around is that you can separate build-results-summary-tab extension with the build task extension (use two extensions instead). For the accounts need to view the summary result, they can install the two extensions. Else, the accounts just need to install the extension for the build task.

这篇关于未将扩展添加到构建任务时,隐藏VSTS/TFS扩展的“摘要"部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆