pact broker概述页面(索引页面)显示每个协议的验证状态,这非常有用。是否可以通过查询参数等过滤此视图,以便我可以看到某个标记的验证?我想用它来概述所有prod-tagged协议及其验证,以确保在发布组件时已经验证了所有产品。
如果不是,我正在考虑为产品协议设立一个单独的协议经纪人实例。
谢谢!
答案 0 :(得分:0)
这完全可行。这是我(或其他人)有时间做这件事的问题。我在这里提出了一个问题:
https://github.com/pact-foundation/pact_broker/issues/146
与此同时,您可以通过为每个产品代码制作CI构建来制作自己的“信息中心”。我想我可能已经把它放在了gitter频道上了。
致电/pacts/provider/PROVIDER/consumer/CONSUMER/latest/prod
。遵循pb:consumer-version
关系,然后按照pb:latest-verification-results-where-pacticipant-is-consumer
关系。
你会得到这个。
{
"success": true,
"providerSummary": {
"successful": [
"B"
],
"failed": [],
"unknown": []
},
"_embedded": {
"verificationResults": [
{
"providerName": "B",
"providerApplicationVersion": "2",
"success": true,
"verificationDate": "2017-10-09T12:34:17+08:00",
"_links": {
"self": {
"title": "Verification result",
"name": "Verification result 2 for Pact between A (v1) and B",
"href": "http://localhost:9292/pacts/provider/B/consumer/A/pact-version/7954fb780aa0db0ea451db4c3c1012fb7f0e1eb4/verification-results/2"
},
"pb:pact-version": {
"title": "Pact",
"name": "Pact between A (v1) and B",
"href": "http://localhost:9292/pacts/provider/B/consumer/A/version/1"
}
}
}
]
},
"_links": {
"self": {
"href": "http://localhost:9292/verification-results/consumer/A/version/1/latest",
"title": "Latest verification results for consumer A version 1"
}
}
}
我会尝试优先将标记的协议添加到用户界面。