【问题标题】:VSTS Extension build summary sectionVSTS 扩展构建摘要部分
【发布时间】:2018-07-26 16:05:12
【问题描述】:

我已通过 VSTS 扩展将自定义摘要部分添加到“构建摘要”部分。

我在构建完成的 VSTS 构建摘要部分收到以下错误。

“ABC 的 VSTS 扩展加载失败。了解有关此扩展的更多信息,包括可用的支持选项。”

贡献:

        "id": "abcfef-build-status-section",
        "type": "ms.vss-build-web.build-results-section",
        "description": "ABC Scan Summary",
        "targets": [
            ".build-info-tab",
            "ms.vss-build-web.build-results-summary-tab"
        ],
        "properties": {
             "name": "ABC Summary Section",
             "uri": "buildstatus.html",
             "order": 20,
             "height": 500
        }

范围:

    "scopes": [
  "vso.build",
  "vso.build_execute"
]

HTML页面(buildstatus.html):

 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
     <title>Hello World</title>
     <script src="scripts/VSS.SDK.js"></script>
 </head>
 <body>
     <script type="text/javascript">VSS.init();</script>
     <h1>Hello World</h1>
     <script type="text/javascript">VSS.notifyLoadSucceeded();</script>
 </body>
 </html>

请帮助解决这个问题。

提前致谢。

【问题讨论】:

  • 您能分享您构建的完整日志吗?

标签: azure-devops tfs-2015 azure-pipelines


【解决方案1】:

这通常是启动扩展时无法加载VSS.SDK.js文件造成的,请检查以下内容:

  1. html页面中的src路径“scripts/VSS.SDK.js”正确。
  2. src 路径和文件包含在“vss-extension.json”文件的“files”部分中。

【讨论】:

    【解决方案2】:

    我通过分析 Chrome 浏览器的控制台日志发现了问题。我的组织防火墙似乎阻止了 API 调用以检索资源。 :)

    https://xxxxxxxx.gallery.vsassets.io/_apis/public/gallery/publisher/xxxxxxxxxxxxxxxxxxxxxxxx=/Extension/status.html 加载资源失败:net::ERR_CONNECTION_CLOSED

    谢谢-

    【讨论】:

      【解决方案3】:

      似乎由于各种原因可能会发生此错误。就我而言,我忘记将脚本文件夹包含在清单中的“文件”中:

          "files": [
          {
              "path": "scripts",
              "addressable": true
          }, ...   
      

      希望有人会觉得它有帮助。

      【讨论】:

        【解决方案4】:

        众所周知,Build Results Enhancer 有一个existing extension sample,源代码可以在 GitHub 上找到:https://github.com/Microsoft/vsts-extension-samples/tree/master/build-results-enhancer

        看来Contribution没什么问题,你可以关注你的Html页面,尝试在你的HTML页面中添加usePlatformScripts: true看看问题是否依然存在:

         <head>
             <title>Hello World</title>
         </head>
         <body>
             <script src="scripts/VSS.SDK.js"></script>
             <script type="text/javascript">
              VSS.init({
                    usePlatformScripts: true
                });
             </script>
             <h1>Hello World</h1>
         </body>
         </html>
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2023-03-25
          • 1970-01-01
          • 1970-01-01
          • 2018-07-07
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多