-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find Azure orchestration stack failure from its operations #12064
Conversation
@gmcculloug @djberg96 please review |
else | ||
operation.properties.status_message.to_s | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzwei - Looks repetitive. I have not tested this, but maybe something along these lines?
status_message = properties.try(:status_message)
return nil unless status_message
error_message = status_message.try(:error).try(:message)
error_message.nil? ? status_message.to_s : error_message
Also , maybe pass operation.properties
into the method instead of just operation
before do | ||
bad_raw_stack = Azure::Armrest::TemplateDeployment.new('properties' => {'provisioningState' => 'Failed'}) | ||
operations = [Azure::Armrest::TemplateDeploymentOperation.new('properties' => { 'statusMessage' => 'reason'})] | ||
allow(orchestration_service).to receive(:get).and_return(bad_raw_stack) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzwei - A bit of a nick pick but are you testing the scenario where operation.properties.status_message.error.message is populated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bronaghs This block is testing #raw_status
. We just need to setup a failed stack with any type of error message. The test for different types of error messages is in another block.
37b372a
to
00e24f4
Compare
Checked commit bzwei@00e24f4 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@bzwei - Looks like you added the test, is that correct? ( commit is squashed so I am not sure) |
@bronaghs Yes. The test is added in this PR, but to the context of testing status. Before the existing test for status only covers the successful case. This one covers a failed status with error message. There is another test |
@bzwei - 👍 @blomquisg - review/merge? |
👍 |
@gmcculloug or @agrare - final review/ merge? |
@bzwei - euwe, darga? |
@miq-bot add_label euwe/yes |
@bzwei is there a BZ for this? |
@simaishi No BZ. This is an enhancement. Do we need one? |
Find Azure orchestration stack failure from its operations (cherry picked from commit 47390ef) https://bugzilla.redhat.com/show_bug.cgi?id=1410828
Euwe backport details:
|
Azure template deployment, aka orchestration stack, does not have an attribute for status message. For failed deployments, user needs to go through its operations, aka resources, to find out the causes.
Because of this reason, manageiq automate service currently simply shows provision failure without detailed error message. In the log the user is reminded to look into stack resources for reasons. QE often opened manageiq bugs when an Azure orchestration provisioning failed, but the actual failure happened on the provider side.
With this enhancement we scan through the operations and delegate the error message to the stack. So that the user will see clearly how the stack creation is failing.
The enhancement work is placed in a module. The code is meant to be reused by the refresh logic. A follow-up PR will be created to use this module in refresh.