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

Cleanup the Controllers/Mixins directory and add it back to the autoload_paths #8784

Open
jrafanie opened this issue May 10, 2023 · 3 comments

Comments

@jrafanie
Copy link
Member

From: #8771

Zeitwerk requires directories to be names of namespaces or you must tell it to ignore the directory.
This means if we specify Mixins:: namespace in some files in the mixins directory, we must do all of them. Or, we need to strip the Mixins namespace completely by autoloading mixins. This would be the best way forward but we have several issues that prevent that from happening easily.

Some files in the mixins directory specified the Mixins namespace and many of the constants in the mixins directory are not unique, so we had to make them all use the Mixins namespace.

In the referenced PR, we had to remove the autoload paths for the Mixins directory so all constants in this directory are unique and not confusing. We should fix the files in the controllers/mixins directory to be unique or move them out of here and into a different namespace.

See this comment for more examples:
#8771 (comment)


I think the problem was we had inconsistency with some things requiring or autoloading using Mixins:: namespace and others not. I was trying to consolidate them to all use the same way. What you see here is one of those ways: changes things to use Mixins:: namespace.

When I tried going the route of "use mixins" autoload_paths (no Mixins:: on include), I had weird things like this happening:

Autoloading using CustomButtons(strip Mixins from autoload) seemed very confusing to me as that conflicts mentally with CustomButton.

I felt the more intentional thing was to use the Mixins namespace as the other way would require more work to move/name things to be more intentional and unique.

There are other examples such as MiqPolicyMixin in core and PolicyMixin.

@jrafanie jrafanie changed the title Cleanup the Controllers/Mixins directory Cleanup the Controllers/Mixins directory and add it back to the autoload_paths May 10, 2023
@miq-bot miq-bot added the stale label Aug 28, 2023
@miq-bot
Copy link
Member

miq-bot commented Aug 28, 2023

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

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

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

@miq-bot
Copy link
Member

miq-bot commented Dec 11, 2023

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

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

1 similar comment
@miq-bot
Copy link
Member

miq-bot commented Mar 18, 2024

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

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants