从 Azure DevOps 管道启动时,XRay 扫描未找到任何手表

XRay scan does not find any watch when launched from Azure DevOps pipeline

我正在尝试 运行 从 Azure DevOps 管道进行 X 射线扫描,但即使设置了所有内容,我也得到了

Xray does not have any Watches monitoring this build, or the Watches monitoring this build do not have a CI Integration action defined

我有一个管道负责在 artifactory 上上传 nuget 包。 这部分工作正常,我可以将它打包并毫无问题地发布到我的存储库中的 artifactory 上。 然后,在同一构建中,我尝试使用 相同的人工端点 .

进行 X 射线扫描 运行

我在配置扫描任务时遇到不同的错误。 首先它说构建不存在所以我不得不在人工方面声明它,然后它说没有使用这个名称的构建被索引所以我在索引设置中添加了构建然后最后一条错误消息告诉我没有watch exist for that build 这让我觉得问题出在 Xray 方面。

(绿色任务正在运行,红色任务失败)

在 Xray 端,构建被索引(错误消息消失),我有几个手表,明确指定构建或所有构建。每个都有至少一个策略,并且已启用,如屏幕截图所示。这就是为什么我不明白为什么它找不到任何匹配的手表,因为所有构建都链接到手表

具体消息如下

C:\hostedtoolcache\windows\jfrog.23.1\x64\jfrog.exe rt bs Lovely-Library-CI Lovely-Library-CI-20190505.1 --url="https://bobbob601.jfrog.io/bobbob601/" --user=*** --password=***
========================== Starting Command Output ===========================
##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\e9fb9321-84e7-4d6b-9674-8e018729a51d.cmd""
The CLI commands require the Artifactory URL and authentication details
Configuring JFrog CLI with these parameters now will save you having to include them as command options.
You can also configure these parameters later using the 'config' command.
[Info] Triggered Xray build scan... The scan may take a few minutes.
[Info] Xray scan completed.
Configure now? (y/n): {
[Error] Xray does not have any Watches monitoring this build, or the Watches monitoring this build do not have a CI Integration action defined.
  "summary": {
    "total_alerts": 0,
    "fail_build": true,
    "message": "Xray does not have any Watches monitoring this build, or the Watches monitoring this build do not have a CI Integration action defined.",
    "more_details_url": ""
  },
  "alerts": [],
  "licenses": []
}

知道问题出在哪里或我遗漏了什么吗?我仔细检查了文档。尝试使用 CLI 手动调用 xray。还是一样的错误

非常感谢

感谢 JFrog 的支持,我得到了未记录的答案。

您有至少一项政策,请勾选选项 "fail on build"。如果它们只是审核策略,那么您会收到此随机消息。

所以 Xray 的手表 -> -> 设置 -> 策略(编辑) -> 检查构建失败