Skip to content
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

Replication excluded tables UI moved to the replication tab #12604

Merged

Conversation

lgalis
Copy link
Contributor

@lgalis lgalis commented Nov 14, 2016

Updating replication excluded tables UI moved to the replication tab

Links

This is the UI change for
https://bugzilla.redhat.com/show_bug.cgi?id=1389821

Depends on #12592

Steps for Testing/QA

@lgalis lgalis changed the title [WIP] Updating replication excluded tables UI moved to the replication tab [WIP]Replication excluded tables UI moved to the replication tab Nov 14, 2016
@lgalis lgalis force-pushed the separate_replication_exclude_tables_ui branch from 1b35423 to e0d6bc1 Compare November 14, 2016 13:34
@lgalis lgalis force-pushed the separate_replication_exclude_tables_ui branch 2 times, most recently from faf92b1 to 545a4c0 Compare November 14, 2016 15:28
add_flash(_("Replication configuration save was successful"))
if replication_type == :remote && !params[:exclusion_list].empty?
begin
new_exclusion_list = params[:exclusion_list].split("\n- ").reject { |s| s.eql?('---') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should roll our own YAML parsing. I would rather use YAML.load and deal with the brakeman issues in some other way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carbonin - agree - changed to use safe_load

@carbonin
Copy link
Member

carbonin commented Nov 14, 2016

When testing this change, it seems like the page is rendering the active_excludes which doesn't actually include all of the tables that should be excluded by the time the page comes up. This is because we are queueing the refresh of the excludes.

The result is that tables get removed from the excludes if you resubmit the excludes after making another change.

I'm not sure what way we should go with this. Maybe we don't queue the refresh or maybe we can do everything in some kind of transaction so that you don't see any excludes until the transaction finishes, but that will lead to people seeing an empty list of excludes ... not sure which is better. @Fryguy thoughts on this?

--- Edit:
I think this is addressed because we don't re-query the excludes when rendering the page after a save. Instead we display what was entered which doesn't rely on the current state of the process of changing the excludes in the background.

@lgalis lgalis force-pushed the separate_replication_exclude_tables_ui branch 2 times, most recently from 137ab45 to d739610 Compare November 14, 2016 18:53
@carbonin
Copy link
Member

This is what the page looks like after both changes:

excludesinreplicationpage

@carbonin
Copy link
Member

#12592 has been merged.

@chessbyte chessbyte changed the title [WIP]Replication excluded tables UI moved to the replication tab [WIP] Replication excluded tables UI moved to the replication tab Nov 14, 2016
@lgalis lgalis force-pushed the separate_replication_exclude_tables_ui branch from 70e6bfd to aef6cd2 Compare November 14, 2016 22:00
@lgalis
Copy link
Contributor Author

lgalis commented Nov 14, 2016

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Nov 14, 2016
@lgalis
Copy link
Contributor Author

lgalis commented Nov 14, 2016

@miq-bot add_label blocker

@lgalis lgalis changed the title [WIP] Replication excluded tables UI moved to the replication tab Replication excluded tables UI moved to the replication tab Nov 14, 2016
@lgalis lgalis force-pushed the separate_replication_exclude_tables_ui branch from aef6cd2 to 1771a61 Compare November 14, 2016 22:05
@lgalis
Copy link
Contributor Author

lgalis commented Nov 14, 2016

/cc @carbonin @gtanzillo

@@ -183,9 +183,16 @@ def pglogical_subscriptions_form_fields
end
end

exclusion_list = if replication_type == :remote
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can one-line this:
exclusion_list = replication_type == :remote ? MiqPglogical.new.active_excludes : MiqPglogical.default_excludes

@@ -218,7 +225,18 @@ def pglogical_save_subscriptions
add_flash(_("Error during replication configuration save: %{message}") %
{:message => bang.message}, :error)
else
add_flash(_("Replication configuration save was successful"))
if replication_type == :remote && !params[:exclusion_list].empty?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking this code should probably be in a separate method.

I don't think this really belongs in pglogical_save_subscriptions right?

I'm thinking the entry point should be a separate, more generic method. Then depending on the replication type we should call something like pglogical_save_subscriptions or pglogical_save_excludes. That would make this a lot easier to understand.

Then we could also remove some duplication of the error handling code and also of MiqRegion.replication_type = replication_type calls (which we seem to have two of).

Copy link
Contributor Author

@lgalis lgalis Nov 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carbonin - That method is invoked by the save button - it could have had a different name, I agree, but it handles the save for the entire replication tab. I am not sure I want to separate it for this PR.

@miq-bot
Copy link
Member

miq-bot commented Nov 15, 2016

Checked commits lgalis/manageiq@865abd1~...8466ad4 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
3 files checked, 0 offenses detected
Everything looks good. 👍

@carbonin
Copy link
Member

@lgalis can you assign to someone on the UI team for review? I'm not sure who should take this.

@lgalis
Copy link
Contributor Author

lgalis commented Nov 15, 2016

@h-kataria - please review

@lgalis
Copy link
Contributor Author

lgalis commented Nov 15, 2016

@miq-bot assign @h-kataria

@lgalis lgalis closed this Nov 16, 2016
@lgalis lgalis reopened this Nov 16, 2016
@himdel himdel closed this Nov 16, 2016
@himdel himdel reopened this Nov 16, 2016
@h-kataria
Copy link
Contributor

Don't have a setup to test save of exclude list, overall changes look good.

@h-kataria h-kataria added this to the Sprint 50 Ending Dec 5, 2016 milestone Nov 16, 2016
@h-kataria h-kataria merged commit e28727a into ManageIQ:master Nov 16, 2016
chessbyte pushed a commit that referenced this pull request Nov 16, 2016
…bles_ui

Replication excluded tables UI moved to the replication tab
(cherry picked from commit e28727a)

https://bugzilla.redhat.com/show_bug.cgi?id=1389821
@chessbyte
Copy link
Member

Euwe Backport details:

$ git log -1
commit 4fd04ca2f56d19f31921d5f75224da18b2e40c49
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Wed Nov 16 10:27:43 2016 -0500

    Merge pull request #12604 from lgalis/separate_replication_exclude_tables_ui

    Replication excluded tables UI moved to the replication tab
    (cherry picked from commit e28727a3cae37d561d8dd7daca87e94726cbddf0)

    https://bugzilla.redhat.com/show_bug.cgi?id=1389821

@lgalis lgalis deleted the separate_replication_exclude_tables_ui branch December 9, 2016 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants