-
Notifications
You must be signed in to change notification settings - Fork 898
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
Add configuration_script_sources.last_update_error #17290
Add configuration_script_sources.last_update_error #17290
Conversation
0ad3e42
to
f0aa161
Compare
ansible/ansible_tower_client_ruby v0.14.0 declared as Gemfile dependency in this PR has been released. Currently only the schema update dependency remains for this PR to become mergeable. |
Gemfile
Outdated
@@ -86,7 +86,7 @@ group :amazon, :manageiq_default do | |||
end | |||
|
|||
group :ansible, :manageiq_default do | |||
gem "ansible_tower_client", "~>0.13.0", :require => false | |||
gem "ansible_tower_client", "~>0.14.0", :require => false |
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.
we can remove this block because of ManageIQ/manageiq-providers-ansible_tower#84 and the manageiq-providers-ansible_tower
is already a dependency.
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.
I extracted that to a separate PR. Please note my questions there.
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.
Remove the dependency of ansible_tower_client
f0aa161
to
21c011b
Compare
Rebased on current |
@miq-bot add_label pending core |
@Glutexo Cannot apply the following label because they are not recognized: pending core |
@Fryguy Hey, I’d like to get this PR merged. Prior to that, ManageIQ/manageiq-schema#187 must be merged first. May I ask you to have a look? |
@bdunne Can you review here? The PR is really straightforward as is the migration, but I'm not sure about the naming. |
Ok, I see the confusion. We told Ansible Tower to update (git pull) a repo (ConfigurationScriptSource) and something went wrong (bad credentials / bad url / git server down / etc.). In Tower, that action is implemented as a playbook. So, the idea was to get the standard out of the playbook as part of our provider refresh so that we can display it to ManageIQ users when something goes wrong. I also don't like the name |
Maybe |
@Glutexo How much data is this? I know playbook output can get large, should we use a |
I see now. I think it would be best to do it in a similar matter to how we store the last error for things on the ext_management_system. For example, an ems refresh occurs and if anything fails in the middle, we set I do understand that this is slightly different in that in the "return" from the ansible playbook is just some stdout. However, do we also know if it was a success/failure case? If so, then I would name these possibly |
@Fryguy It already has a |
@bdunne It only store when there's a failure in update and the logs I checked are all <2KB. Also |
@Fryguy @jameswnl @bdunne Actually we store the stdout every time, even on a success. Just as we store the status and a timestamp. As @jameswnl said, they are usually about 2 KB of size, success results are smaller than failed ones. The stdout is actually text, not binary data, so I see As for the column name, I am not sure. The new column |
Guys, @Fryguy, @bdunne, @jameswnl, may I ask you for your opinion? As I stated in my previous comment, there is already a naming discrepancy in the table. By introducing a new Questioning the |
What @bdunne is referring to is our binary_blobs model, not a literal BINARY BLOB type. The binary_blobs model is designed to take large strings, chop it up into 1MB chunks and store them in a separate table. While named binary_blobs, it can store anything. Putting them into a separate table also has the advantage of allowing That being said, I'm fine with storing the stdout in the column directly since the 99% case is reasonably sized. I would however ensure that we truncate to some large, but reasonable, size, like 100KB or 50KB or something, just in case.
I'm arguing we should not store the stdout on success, because it's useless. The purpose of storing stdout is to present failure strings when there is a failure. Since we know the status, then on failure, we should store the error in If it wasn't clear there, we should name the column |
Add new last_update_stdout column to configuration_script_sources table. This allows to store last update stdout to display more information about why its refresh failed.
Great! That means that I can rename the column and these simple PRs can get merged:
Renaming those Also thanks for the clarification of binary blobs! |
21c011b
to
6335d6e
Compare
@Fryguy Renamed to |
Checked commit Glutexo@6335d6e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Only the migration PR ManageIQ/manageiq-schema#187 seems to be pending to get merged now. We should be ready to move on with this. @miq-bot remove_label dependencies |
Add new
last_update_stdout
column toconfiguration_script_sources
table. This allows to store last update stdout to display more information about why its refresh failed.Fetching and presenting this information is a workaround for cloning repositories from HTTPS servers with untrusted SSL certificates. Tower API does not offer an option to disable SSL check, so with the stdout user can at least see, why the cloning actually failed.
https://bugzilla.redhat.com/show_bug.cgi?id=1513616
Prior merging this PR, folowing PRs require to be merged:
/cc @jameswnl for review