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

Pluggable provider mapping prefixes and targets #20776

Conversation

@lpichler
Copy link
Contributor Author

lpichler commented Nov 4, 2020

Once review will be finished I will create rest of provider PRs

@miq-bot assign @agrare

supported_subclasses.select(&:supported_for_label_mapping?)
end

def self.supported_label_mapping_prefixes
Copy link
Member

Choose a reason for hiding this comment

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

Unless we're going to have an unsupported_label_mapping_prefixes we can probably just call this self.label_mapping_prefixes or all_label_mapping_prefixes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

@agrare
Copy link
Member

agrare commented Nov 4, 2020

@lpichler should we include "/managed/" in the mapping prefix name? Either in the providers or as part of the label_mapping_prefixes method? Not sure if you need this list without the "/managed" prefix

@agrare
Copy link
Member

agrare commented Nov 4, 2020

@lpichler for the categories it looks like you might need more info than just the class names?
Not sure how you go from e.g. VmIBM to "ibm:vm:" and "ManageIQ::Providers::IbmCloud::VPC::CloudManager::Vm" generically.
Maybe we need to be updating those categories to be more consistent and able to be built automatically? Along these lines I did put in ManageIQ/manageiq-schema#525 to make Image/Vm more amazon specific

@lpichler lpichler force-pushed the pluggable_provider_mapping_prefixes_and_targets branch 2 times, most recently from c984ffb to c9f1679 Compare November 5, 2020 10:59
@lpichler
Copy link
Contributor Author

lpichler commented Nov 5, 2020

@lpichler should we include "/managed/" in the mapping prefix name? Either in the providers or as part of the label_mapping_prefixes method? Not sure if you need this list without the "/managed" prefix

No. /managed is prefix which is related to our tags so I would like to leave it in; core. But in upcoming refactoring will most likely remove part map { |name| "/managed/#{name}:" } in ProviderTagMapping:25

@lpichler for the categories it looks like you might need more info than just the class names?
Not sure how you go from e.g. VmIBM to "ibm:vm:" and "ManageIQ::Providers::IbmCloud::VPC::CloudManager::Vm" generically.
Maybe we need to be updating those categories to be more consistent and able to be built automatically? Along these lines I did put in ManageIQ/manageiq-schema#525 to make Image/Vm more amazon specific

Yes, you are right we need it for ProviderTagMapping#labeled_resource_type so I change it to have also this.
See provider PRs for amazon and Kubernetes
I think we can find way how to build ProviderTagMapping#labeled_resource_type` automatically but let's leave on other PR.

@agrare you can re-review it,
thanks!

@agrare
Copy link
Member

agrare commented Nov 5, 2020

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
agrare added a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
agrare added a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
agrare added a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

Looks good to me, cross repo is green, thanks @lpichler !

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
@lpichler
Copy link
Contributor Author

lpichler commented Nov 5, 2020

I am not sure what I am doing wrong for cross testing miq bot command:

@miq-bot cross-repo-tests https://github.com/ManageIQ/manageiq-providers-amazon/pull/669,https://github.com/ManageIQ/manageiq-providers-azure/pull/424,https://github.com/ManageIQ/manageiq-providers-ibm_cloud/pull/116,https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/409,https://github.com/ManageIQ/manageiq-providers-openstack/pull/665,https://github.com/ManageIQ/manageiq-providers-vmware/pull/669 including https://github.com/ManageIQ/manageiq-providers-amazon/pull/669 https://github.com/ManageIQ/manageiq-providers-azure/pull/424 https://github.com/ManageIQ/manageiq-providers-ibm_cloud/pull/116 https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/409 https://github.com/ManageIQ/manageiq-providers-openstack/pull/665 https://github.com/ManageIQ/manageiq-providers-vmware/pull/669 https://github.com/ManageIQ/manageiq-schema/pull/525 https://github.com/ManageIQ/manageiq/pull/20776

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 5, 2020
@agrare
Copy link
Member

agrare commented Nov 10, 2020

Just going to do one more cross-repo test with the UI and API included

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 10, 2020
@agrare
Copy link
Member

agrare commented Nov 10, 2020

Currently only failing on an unrelated UI error

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 12, 2020

def self.entities_for_label_mapping
label_mapping_classes.reduce({}) { |all_mappings, klass| all_mappings.merge(klass.entities_for_label_mapping) }
end
Copy link
Member

Choose a reason for hiding this comment

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

Please mark any of the above as private if they are not to be used as public API of the class.

Copy link
Member

Choose a reason for hiding this comment

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

Can you also add specs for these methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added specs but we need public API, at least for now for UI.

@lpichler lpichler force-pushed the pluggable_provider_mapping_prefixes_and_targets branch from c9f1679 to edf3531 Compare November 12, 2020 17:13
@lpichler lpichler force-pushed the pluggable_provider_mapping_prefixes_and_targets branch from edf3531 to a011707 Compare November 12, 2020 17:16
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 12, 2020
@agrare
Copy link
Member

agrare commented Nov 12, 2020

@lpichler you need to rebase this PR on master to fix that k8s test

@lpichler lpichler force-pushed the pluggable_provider_mapping_prefixes_and_targets branch from a011707 to 3a7f053 Compare November 13, 2020 06:59
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 13, 2020
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Nov 13, 2020
@lpichler
Copy link
Contributor Author

✅✅✅ All checks have passed in ManageIQ/manageiq-cross_repo-tests#235 ✅✅✅

}.freeze

it "supports label mapping for provider subclasses" do
expect(SUPPORTED_MAPPING_ENTITIES).to eq(ExtManagementSystem.entities_for_label_mapping)
Copy link
Member

Choose a reason for hiding this comment

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

Sorry @lpichler (just noticed you added this) but can you update this to check .includes on one or two values instead of .eq on the whole list? I don't want to get back into having the same problems as we fixed in #20595 aka everytime we add another one core specs start failing.

You don't need to rerun the whole cross repo tests again though :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry @lpichler (just noticed you added this) but can you update this to check .includes on one or two values instead of .eq on the whole list? I don't want to get back into having the same problems as we fixed in #20595 aka everytime we add another one core specs start failing.

Done 👍

You don't need to rerun the whole cross repo tests again though :)

👍 :)

thanks @agrare

@lpichler lpichler force-pushed the pluggable_provider_mapping_prefixes_and_targets branch from 3a7f053 to a173322 Compare November 16, 2020 18:26
@miq-bot
Copy link
Member

miq-bot commented Nov 16, 2020

Checked commit lpichler@a173322 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
4 files checked, 0 offenses detected
Everything looks fine. ⭐

@agrare agrare merged commit 267ceed into ManageIQ:master Nov 18, 2020
@agrare agrare mentioned this pull request Nov 19, 2020
48 tasks
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