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

[WIP] extend relationships to define the appropriate class names #654

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Oct 27, 2020

This depends upon:

putting in this PR to show where I would like to go and to run cross repo tests

use parent definition of ensure since they are now pretty generic.
They may be no longer necessary and a build_ may suffice.

Use parent definition of propagation so all attributes go across
Extend parent managers to group the functionality together

@miq-bot miq-bot added the wip label Oct 27, 2020
@kbrock kbrock force-pushed the local_child_managers branch 2 times, most recently from 7e3576e to 18aa014 Compare October 27, 2020 18:41
before_create :ensure_managers

# TODO: move to before_validation
before_update :ensure_managers_zone_and_provider_region
Copy link
Member

Choose a reason for hiding this comment

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

One thing to keep in mind, the tenant_id is set also in a before_validation callback so we need to make sure those play nicely together. Don't want to be setting the child.tenant_id = tenant_id before tenant_id has been set

https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/tenancy_mixin.rb#L5

@@ -419,52 +427,19 @@ def ensure_managers
ensure_network_manager
ensure_cinder_manager
ensure_swift_manager
# TODO: remove when this moves to before_initialization
Copy link
Member

Choose a reason for hiding this comment

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

Do you mean before_validation?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should create the objects at initialization time - empty vessels
then in before validation, make sure they have the correct values

I seem to remember that rails could auto build the has_one for us but can't find the references anymore.

But maybe before validation is where we will create these objects too

network_manager.tenant_mapping_enabled = tenant_mapping_enabled
network_manager.save!
def ensure_managers_zone_and_provider_region
child_manager_references.each do |child_manager|
Copy link
Member

Choose a reason for hiding this comment

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

If we could work out the list of child managers generically we could do this in core right?

Copy link
Member Author

@kbrock kbrock Oct 27, 2020

Choose a reason for hiding this comment

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

I had child_managers but that messed with an already defined child_managers relation. I'm guessing that is what you are referring.

Were, we want to access the actual child managers that we are using.

If we want to stick with the child_managers association, then we could define swift_manager to be a select into child_managers or something like that?

just having a child managers relation and a different association for swift_manager messes things up.

@agrare
Copy link
Member

agrare commented Dec 1, 2020

Hey @kbrock now that ManageIQ/manageiq#20739 is merged can we get this in?

@Fryguy
Copy link
Member

Fryguy commented Jan 12, 2021

#673 was merged moving the SwiftManager from core to this plugin, which also made the class names more consistent.

@miq-bot miq-bot added the stale label Mar 6, 2023
@miq-bot
Copy link
Member

miq-bot commented Mar 6, 2023

This pull request has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this pull request if these changes are still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@miq-bot miq-bot closed this Mar 6, 2023
@kbrock kbrock removed the stale label Jul 27, 2023
@kbrock kbrock reopened this Jul 27, 2023
@miq-bot miq-bot added the stale label Nov 27, 2023
@miq-bot
Copy link
Member

miq-bot commented Nov 27, 2023

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@kbrock kbrock force-pushed the local_child_managers branch 2 times, most recently from cdf8136 to 0311d4d Compare November 27, 2023 23:36
WIP: quite a bit of stuff has happened since then.
there is a HasNetworkManagerMixin that may meet many of the needs

WIP: do a diff with origin to make sure the rebase didn't change too much
seems quite a few concepts have been changed in master
so definitely need to re-evaluate this

use parent definition of ensure since they are now pretty generic.
They may be no longer necessary and a build_ may suffice.

Use parent definition of propagation so all attributes go across
Extend parent managers to group the functionality together

WIP: quite a bit of stuff has happened since then.
there is a HasNetworkManagerMixin that may meet many of the needs
@kbrock kbrock force-pushed the local_child_managers branch from 0311d4d to 4b61465 Compare November 28, 2023 14:33
@miq-bot
Copy link
Member

miq-bot commented Nov 28, 2023

Checked commit kbrock@4b61465 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
2 files checked, 2 offenses detected

app/models/manageiq/providers/openstack/infra_manager.rb

@miq-bot
Copy link
Member

miq-bot commented Mar 4, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

2 similar comments
@miq-bot
Copy link
Member

miq-bot commented Jun 10, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@miq-bot
Copy link
Member

miq-bot commented Sep 16, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

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.

4 participants