You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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
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.
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.
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.
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 useMixins::
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.
The text was updated successfully, but these errors were encountered: