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

rm unnecessary use of the foreman_proxy::plugin::module::features param #773

Closed
wants to merge 1 commit into from

Conversation

jhoblitt
Copy link
Contributor

@jhoblitt jhoblitt commented Aug 4, 2022

No description provided.

@alexjfisher
Copy link
Contributor

Looks correct given the default in foreman_proxy::plugin::module for the feature parameter is $title.capitalize().

String $feature = $title.capitalize(),

Further down foreman_proxy::module uses upcase though.

String $feature = upcase($title),
Not sure why the inconsistency??

@ekohl
Copy link
Member

ekohl commented Aug 5, 2022

Not sure why the inconsistency??

Excellent question. I think it was mostly because in core we have modules:

  • bmc => BMC
  • dns => DNS
  • dhcp => DHCP
  • httpboot => HTTPBoot
  • logs => Logs
  • puppet => Puppet
  • puppetca => Puppet CA
  • realm => Realm
  • registration => Registration
  • templates => Templates
  • tftp => TFTP

So it's really about 4 upcase vs 5 capitalize. In plugins it's much closer to all being capitalize. So you could align on $title.capitalize() and set the 4 upcased versions explicitly.

You could also argue for "explicit is better than implicit".

Hopefully that explains the backstory.

@jhoblitt
Copy link
Contributor Author

jhoblitt commented Aug 5, 2022

I don't have strong feelings about magic vs explicit but I do think that which ever style is used, it should be consistent.

@ekohl
Copy link
Member

ekohl commented Aug 8, 2022

it should be consistent.

This I agree with. However, changing the default would technically be a major version bump and we just did a major version a few days ago.

Right now I'm not sure what the best way to proceed is.

Perhaps we should explicitly codify the expected feature. AFAIK contain_foreman_proxy__plugin__module('ansible').with_feature('Ansible') also works on parameter defaults, so if the default would be changed it would cause a unit test failure.

@ekohl
Copy link
Member

ekohl commented Aug 26, 2022

It looks like with #776 we'll do a major bump anyway. Should we use this to fix the inconsistency?

@jhoblitt
Copy link
Contributor Author

Sounds reasonable to me.

ekohl added a commit to ekohl/puppet-foreman_proxy that referenced this pull request Oct 28, 2022
foreman_proxy::plugin::module uses $title.capitalize() and now
foreman::module does too. This makes it more consistent. It also
explicitly sets the feature where needed. This was explained in an
issue[1].

[1]: theforeman#773 (comment)
@ekohl
Copy link
Member

ekohl commented Oct 28, 2022

I came up with #788. Should we close this PR or would you still prefer to rely on defaults where possible?

@jhoblitt
Copy link
Contributor Author

@ekohl #788 also seems fine to me. Someone just needs to pick a style. ;)

ekohl added a commit to ekohl/puppet-foreman_proxy that referenced this pull request Oct 31, 2022
foreman_proxy::plugin::module uses $title.capitalize() and now
foreman_proxy::module does too. This makes it more consistent. It also
explicitly sets the feature where needed. This was explained in an
issue[1].

[1]: theforeman#773 (comment)
evgeni pushed a commit that referenced this pull request Oct 31, 2022
foreman_proxy::plugin::module uses $title.capitalize() and now
foreman_proxy::module does too. This makes it more consistent. It also
explicitly sets the feature where needed. This was explained in an
issue[1].

[1]: #773 (comment)
@ekohl
Copy link
Member

ekohl commented Nov 1, 2022

I guess we can close this now.

@ekohl ekohl closed this Nov 1, 2022
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.

None yet

4 participants