Skip to content
代码片段 群组 项目
提交 11c2ffdb 编辑于 作者: Mayra Cabrera's avatar Mayra Cabrera
浏览文件

Update stable checks to consider no downstream pipeline is generated

The package-and-test bridge can be canceled which interrupts the
generation of the downstream pipeline. This commit updates Danger stable
branch checks to account for these scenarios. This will avoid Danger
code failures when no downstream pipeline can be found, e.g. https://gitlab.com/gitlab-org/gitlab/-/jobs/3943016314.
上级 203dcd87
No related branches found
No related tags found
无相关合并请求
......@@ -177,20 +177,37 @@
it_behaves_like 'bypassing when flaky test or docs only'
end
context 'when no package-and-test job is found' do
context 'when no package-and-test bridge is found' do
let(:pipeline_bridges_response) { nil }
it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE
it_behaves_like 'bypassing when flaky test or docs only'
end
context 'when package-and-test job is being created' do
context 'when package-and-test bridge is created' do
let(:pipeline_bridge_state) { 'created' }
it_behaves_like 'with a warning', described_class::WARN_PACKAGE_AND_TEST_MESSAGE
it_behaves_like 'bypassing when flaky test or docs only'
end
context 'when package-and-test bridge has been canceled and no downstream pipeline is generated' do
let(:pipeline_bridge_state) { 'canceled' }
let(:pipeline_bridges_response) do
[
{
'name' => 'e2e:package-and-test',
'status' => pipeline_bridge_state,
'downstream_pipeline' => nil
}
]
end
it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE
it_behaves_like 'bypassing when flaky test or docs only'
end
context 'when package-and-test job is in a non-successful state' do
let(:package_and_qa_state) { 'running' }
......
......@@ -102,7 +102,7 @@ def package_and_test_bridge_and_pipeline_status
if bridge['status'] == 'created'
bridge['status']
else
bridge.fetch('downstream_pipeline').fetch('status')
bridge.fetch('downstream_pipeline')&.fetch('status')
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册