Skip to content

Add ServiceTemplate.class_from_prov_type to hide the complexity of finding a ServiceTemplate class#23789

Merged
Fryguy merged 3 commits intoManageIQ:masterfrom
agrare:add_service_template_class_from_prov_type
Mar 31, 2026
Merged

Add ServiceTemplate.class_from_prov_type to hide the complexity of finding a ServiceTemplate class#23789
Fryguy merged 3 commits intoManageIQ:masterfrom
agrare:add_service_template_class_from_prov_type

Conversation

@agrare
Copy link
Copy Markdown
Member

@agrare agrare commented Mar 31, 2026

Unify the various approaches to getting a ServiceTemplate class given a prov_type string.

Dependents:

Unify the various approaches to getting a ServiceTemplate class given a
prov_type string.
@agrare agrare requested a review from Fryguy as a code owner March 31, 2026 20:45
@agrare agrare changed the title Add service template class from prov type Add ServiceTemplate.class_from_prov_type to hide the complexity of finding a ServiceTemplate class Mar 31, 2026
Comment on lines +160 to +161
class_name = "ServiceTemplate#{prov_type.camelize}"
class_name = "ServiceTemplate" unless allowed_class_names.include?(class_name)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TODO would love to enforce provider subclasses of ServiceTemplates and Services so this can follow the same rules as the generic_ case above

@agrare agrare force-pushed the add_service_template_class_from_prov_type branch from 697dc2a to f6d9914 Compare March 31, 2026 20:55
@Fryguy
Copy link
Copy Markdown
Member

Fryguy commented Mar 31, 2026

I agree with rubocop here.

@Fryguy Fryguy self-assigned this Mar 31, 2026
@agrare agrare force-pushed the add_service_template_class_from_prov_type branch from f6d9914 to ec3302b Compare March 31, 2026 21:07
@miq-bot
Copy link
Copy Markdown
Member

miq-bot commented Mar 31, 2026

Checked commits agrare/manageiq@b87b3d0~...ec3302b with ruby 3.3.10, rubocop 1.86.0, haml-lint 0.72.0, and yamllint 1.37.1
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@Fryguy Fryguy merged commit 25ecfad into ManageIQ:master Mar 31, 2026
7 checks passed
@agrare agrare deleted the add_service_template_class_from_prov_type branch March 31, 2026 21:37
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.

3 participants