Skip to content
代码片段 群组 项目
提交 ea96a51a 编辑于 作者: Max Fan's avatar Max Fan
浏览文件

Updating /troubleshoot rca to handle empty logs

As any job can be passed, if there is no jog log
we return an error message

EE: true
上级 2d9968d1
No related branches found
No related tags found
无相关合并请求
...@@ -17,6 +17,7 @@ def perform ...@@ -17,6 +17,7 @@ def perform
Gitlab::ErrorTracking.track_exception(e) Gitlab::ErrorTracking.track_exception(e)
Answer.error_answer( Answer.error_answer(
error: e,
context: context, context: context,
error_code: "M4000" error_code: "M4000"
) )
......
...@@ -77,6 +77,8 @@ def perform ...@@ -77,6 +77,8 @@ def perform
elsif !job.failed? elsif !job.failed?
_('This command is used for troubleshooting jobs and can only be invoked from ' \ _('This command is used for troubleshooting jobs and can only be invoked from ' \
'a failed job log page.') 'a failed job log page.')
elsif !job.trace.exist?
_('There is no job log to troubleshoot.')
end end
return error_with_message(error_message) if error_message return error_with_message(error_message) if error_message
......
...@@ -129,6 +129,18 @@ ...@@ -129,6 +129,18 @@
tool.execute tool.execute
end end
context 'when log does not exist' do
before do
build.trace.erase!
end
it 'returns an error message' do
expect(tool.execute.content).to include(
"There is no job log to troubleshoot"
)
end
end
end end
context 'when the feature is disabled' do context 'when the feature is disabled' do
......
...@@ -53839,6 +53839,9 @@ msgstr "" ...@@ -53839,6 +53839,9 @@ msgstr ""
msgid "There is no data available. Please change your selection." msgid "There is no data available. Please change your selection."
msgstr "" msgstr ""
   
msgid "There is no job log to troubleshoot."
msgstr ""
msgid "There is no table data available." msgid "There is no table data available."
msgstr "" msgstr ""
   
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册