-
Notifications
You must be signed in to change notification settings - Fork 28
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
Allow specifying table exclusions in Database Dump action #47
Allow specifying table exclusions in Database Dump action #47
Conversation
The `#ask_yn?` method is one of the few methods in `Prompts` that does not make use of the `just_ask` question. `#just_ask`, by default, has everything flow through `Readline`, which has a different output than the standard commands. Because of this, if you try mixing the two in the specs, you can get some strange behavior, such EOFError: The input stream is exhausted. Which comes from the Highline lib. This happens because the input is trying to be read from two different sources at once, and doesn't function as expected doing that (one ends up being blank, even though some input is still available). * * * Instead of making the risky change of forcing `q.readline` for every usage of `ask_yn?`, allow for a block, so this can be done a-la-carte as needed.
2f7842e
to
e45bf12
Compare
Code Climate failure is failing on something that I modified, and really isn't worth fixing at this point in my opinion. |
This looks good, I'm just not sure about the defaults for the exclude. I would lean towards not excluding any tables by default. Would want some more opinions before we merge this. @jdeubel @jrafanie @dmetzger57 what do you think? |
I'm good with the tables chosen as the defaults to be excluded (they are the ones typically bloating a dump and are not needed), and at a higher level in having a default set of tables on this option. However, I defer to support on whether a default would be good or bad in the wild. |
I would say by default have vim_performance_states and event_streams as these tables can take up a bit of space and are very rarely needed from my experience. For the metrics* tables I feel the customer is just going to hit enter since it is quick and easy. We should leave it up to (support) to tell them what other tables are needed (such as metrics) as the customer might not know. |
@@ -96,6 +97,26 @@ def ask_to_delete_backup_after_restore | |||
end | |||
end | |||
|
|||
def ask_for_tables_to_exclude_in_dump | |||
if action == :dump && should_exlcude_tables? |
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.
typo: should_exlcude_tables -> should_exclude_tables
+2 points for making the typo consistently in the method name. 😉
Don't worry, I type destory
instead of destroy
.
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.
performance
is the bane of my existence usually... ends up as preformance
...
Good catch. Thanks!
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.
+2 points for making the typo consistently in the method name. 😉
Autocomplete...
I know we don't want feature creep but showing them which tables are the top x in size, might make it easier for them to know which to exclude. I don't have a strong opinion on default tables either way. We can always ask for the missing tables in the event we're missing tables we need. What @jdeubel said is good with me. |
I am going to say no to this for now, possible future feature though. Reason being is we really rely on the getting DB connection info from the application, and the
Just for the record, the tables I chose were not picked at random, but plucked from the previous ticket and discussion: https://bugzilla.redhat.com/show_bug.cgi?id=1535345#c12 Specifically to @jdeubel 's comment, the metrics tables from The other reason I wanted to have the That last bit about "avoiding typing" was a big goal for this, and I hope it influences the overall decision here. I put a Anyway, that is my |
Adds a set of questions to be queried for `:dump` based actions in DatabaseAdmin. It asks: - If any tables wish to be excluded - If yes, what tables should be excluded The defaults for this are set as some sensible and standard defaults to be used, and allow for quickly moving on, but no tables will be excluded if the user answers no to the first question.
e45bf12
to
79b9fec
Compare
Checked commits NickLaMuro/manageiq-appliance_console@01cf151~...79b9fec with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Those seem like good reasons to include |
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.
@jrafanie I'm ok with that. It all depends on the case for what we need but I would assume they would have our guidance on what to exclude anyways. |
This pull request exposes the functionality of the
--exclude-table-data
flag inpg_dump
, which was added tomanageiq
andmanageiq-gems-pending
in the following pull requests respectively:In the user experience would look something like this:
Links