Skip to content

Remove prepend_namespace #551

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

Merged
merged 1 commit into from
May 23, 2025
Merged

Remove prepend_namespace #551

merged 1 commit into from
May 23, 2025

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Jul 9, 2024

We do not use prepend_namespace
The feature is causing us to double the number of queries when looking up objects

@Fryguy you mentioned that we are not using this.
It was an extension mechanism added by tina that seems to not be leveraged.

I just put this into a PR so I didn't have to have a local branch and have to remember where I saw this issue.

We do not use prepend namespace
The feature is causing us to double the number of queries when
looking up objects
@miq-bot
Copy link
Member

miq-bot commented Jul 9, 2024

Checked commit kbrock@0885f24 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
6 files checked, 0 offenses detected
Everything looks fine. 🏆

@Fryguy
Copy link
Member

Fryguy commented Jul 9, 2024

Oh interesting. So the vendor part of this was part of an idea to create namespaces for plugins. Plugins could then own their own namespace or even domain, and then provide concrete implementations of things like provisioning and event handling, where the core automation engine would have generic stuff and call into plug-in specific stuff.

I don't believe this was ever completed, but do you see any vendor specific namespaces in manageiq-content?

cc @agrare

@Fryguy Fryguy self-assigned this Jul 10, 2024
@agrare
Copy link
Member

agrare commented Jul 10, 2024

I don't recognize any of this but I like the idea of moving provider specific automate bits into their respective plugins

@kbrock
Copy link
Member Author

kbrock commented Jul 11, 2024

@Fryguy I didn't look. I remember you saying that Tina introduced this but we never ended up using it (6 months ago when I was tracing automate), and I saw a branch yesterday and finally pushed it forward.

When tracing the queries and walking through the code, it is a distraction to me, especially knowing they are useless queries.

@Fryguy
Copy link
Member

Fryguy commented Jul 11, 2024

Yeah my only concern is that there is already some vendor namespaces built, that this would effectively break. If not, then I think we can merge.

@miq-bot miq-bot added the stale label Oct 14, 2024
@miq-bot
Copy link
Member

miq-bot commented Oct 14, 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 Jan 20, 2025

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 Apr 21, 2025

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
Copy link
Member Author

kbrock commented May 22, 2025

@agrare Do you know if we've been using vendor specific namespaces in automate? I think we may for vmware, but was unsure how to even determine this.

@agrare
Copy link
Member

agrare commented May 22, 2025

@kbrock I don't know what this is or if it is used unfortunately :/

@Fryguy
Copy link
Member

Fryguy commented May 23, 2025

Oh it's from an old feature idea to make automate pluggable by provider...I can't remember if anything ever got implemented, but I'm pretty sure it didn't

@kbrock
Copy link
Member Author

kbrock commented May 23, 2025

@Fryguy agreed. You had told me you had suggested the feature but it wasn't implemented and could probably tear it out. So I added this PR to remove all these extra queries. Lookups end up taking 3 queries instead of 1 (for the non-missing case)

@kbrock
Copy link
Member Author

kbrock commented May 23, 2025

I'm guessing we wanted to put this into content/automate

Didn't check if our rake tasks checks all plugins for content/automate, or if it only checks manageiq-content.

ls -lpd manageiq-*/content/*
drwxr-xr-x  3 kbrock  staff   96 Mar 16  2021 manageiq-content/content/ansible/
drwxr-xr-x  4 kbrock  staff  128 Mar 16  2021 manageiq-content/content/automate/
drwxr-xr-x  5 kbrock  staff  160 Jul 22  2024 manageiq-content/content/workflows/
drwxr-xr-x  3 kbrock  staff   96 Jan 27  2023 manageiq-providers-autosde/content/dashboard/
-rw-r--r--  1 kbrock  staff  185 Jan 27  2023 manageiq-providers-autosde/content/notification_types.yml
drwxr-xr-x  3 kbrock  staff   96 Jan 27  2023 manageiq-providers-autosde/content/reports/
drwxr-xr-x  3 kbrock  staff   96 Sep 18  2023 manageiq-providers-azure/content/miq_dialogs/
drwxr-xr-x  5 kbrock  staff  160 Dec 13  2021 manageiq-providers-dummy_provider/content/ansible_runner/
drwxr-xr-x  3 kbrock  staff   96 Jun 28  2023 manageiq-providers-ibm_cic/content/miq_dialogs/
drwxr-xr-x  4 kbrock  staff  128 Aug 18  2021 manageiq-providers-ibm_cloud/content/ansible_runner/
drwxr-xr-x  5 kbrock  staff  160 Feb 29  2024 manageiq-providers-ibm_cloud/content/miq_dialogs/
drwxr-xr-x  4 kbrock  staff  128 Mar  3  2022 manageiq-providers-ibm_cloud/content/reports/
drwxr-xr-x  4 kbrock  staff  128 Sep 28  2023 manageiq-providers-ibm_power_hmc/content/miq_dialogs/
drwxr-xr-x  4 kbrock  staff  128 May  2  2022 manageiq-providers-ibm_power_hmc/content/reports/
drwxr-xr-x  4 kbrock  staff  128 May 27  2022 manageiq-providers-ibm_power_vc/content/ansible_runner/
drwxr-xr-x  3 kbrock  staff   96 Feb 27  2023 manageiq-providers-ibm_power_vc/content/miq_dialogs/
drwxr-xr-x  4 kbrock  staff  128 Mar  3  2022 manageiq-providers-ibm_power_vc/content/reports/
drwxr-xr-x  4 kbrock  staff  128 Sep 30  2024 manageiq-providers-kubevirt/content/miq_dialogs/
drwxr-xr-x  3 kbrock  staff   96 Mar 16  2021 manageiq-providers-lenovo/content/ansible_runner/
drwxr-xr-x  7 kbrock  staff  224 Mar 16  2021 manageiq-providers-nuage/content/ansible_runner/
drwxr-xr-x  3 kbrock  staff   96 Sep 30  2024 manageiq-providers-openshift/content/miq_dialogs/
drwxr-xr-x  3 kbrock  staff   96 Mar 16  2021 manageiq-providers-openstack/content/miq_dialogs/
drwxr-xr-x  3 kbrock  staff   96 Jan 27  2023 manageiq-providers-oracle_cloud/content/miq_dialogs/
drwxr-xr-x  5 kbrock  staff  160 Jan 27  2023 manageiq-providers-ovirt/content/miq_dialogs/
drwxr-xr-x  8 kbrock  staff  256 Feb 28  2023 manageiq-providers-vmware/content/miq_dialogs/

@Fryguy
Copy link
Member

Fryguy commented May 23, 2025

It definitely wasn't implemented at the plugin level. I thought Tina might have put some in manageiq-content, but I'm not sure.

This is the list of provider specific stuff I could find, but I don't think any of it is designed around the prepend_namespace idea, because I think the provider name would have to be a top-level namespace right under the domain. @agrare Can you verify the purpose of these?

content/automate
└── ManageIQ
    ├── AutomationManagement
    │   ├── AnsibleTower
    │   │   ├── Operations
    │   │   │   ├── JobTemplate.class
    │   │   │   ├── Methods.class
    │   │   │   └── StateMachines
    │   │   │       └── Job.class
    │   │   └── Service
    │   │       └── Provisioning
    │   │           └── StateMachines
    │   │               └── Provision.class
    │   └── TerraformEnterprise
    │       ├── Operations
    │       │   ├── Methods.class
    │       │   └── StateMachines
    │       │       └── Job.class
    │       └── Service
    │           └── Provisioning
    │               └── StateMachines
    │                   └── Provision.class
    ├── Container
    │   └── Openshift
    │       └── Operations
    │           └── Methods.class
    ├── Integration
    │   └── VMware
    │       └── VimApi.class
    ├── PhysicalInfrastructure
    │   └── CiscoIntersight
    │       ├── GetMethods
    │       │   ├── GetEms.class
    │       │   ├── GetServerProfileTemplates.class
    │       │   └── GetServers.class
    │       └── Services
    │           └── DeployServer.class
    ├── Storage
    │   └── Autosde
    │       ├── GetMethods
    │       │   ├── DisplayFields.class
    │       │   ├── GetEms.class
    │       │   └── GetPools.class
    │       └── Services
    │           └── ServiceVolumeRequestApproval.class
    └── System
        └── Event
            └── EmsEvent
                ├── Amazon.class
                ├── AnsibleTower.class
                ├── Azure.class
                ├── AzureStack.class
                ├── EmbeddedAnsible.class
                ├── EVM.class
                ├── Google.class
                ├── IBM_POWER_HMC.class
                ├── IBMCloud-PowerVS.class
                ├── IBMCloud-VPC.class
                ├── Kubernetes.class
                ├── KUBEVIRT.class
                ├── LenovoXclarity.class
                ├── NUAGE.class
                ├── OPENSHIFT_INFRA.class
                ├── OpenStack.class
                ├── ORACLE.class
                ├── RHEVM.class
                ├── VC.class
                └── VMWARE-VCLOUD.class

@Fryguy
Copy link
Member

Fryguy commented May 23, 2025

Yeah, none of these are at the toplevel - and the code prepends the vendor name as the namespace, so none of these fall in that category. Merging.

@Fryguy Fryguy merged commit ea62467 into ManageIQ:master May 23, 2025
3 checks passed
@Fryguy Fryguy removed the stale label May 23, 2025
@agrare
Copy link
Member

agrare commented May 23, 2025

Well System/Event/EmsEvent are all of the provider specific event handlers, and AutomationManagement/ are the AWX/AnsibleTower/TFE catalog ordering classes. I'll have to look into the others.

@kbrock kbrock deleted the single_namespace branch May 23, 2025 16:20
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