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

(GH-59) Refactor away from Simple Provider #60

Merged
merged 1 commit into from
Nov 24, 2020
Merged

(GH-59) Refactor away from Simple Provider #60

merged 1 commit into from
Nov 24, 2020

Conversation

michaeltlombardi
Copy link
Contributor

Prior to this commit the DSC Base provider inherited from the Resource APIs Simple Provider. This brought with it a limitation in the type definition, requiring all of the generated DSC types to have the ensure attribute. This led to the confusion in puppetlabs/Puppet.Dsc#72 as well as necessitated the filing of puppetlabs/Puppet.Dsc#74 to improve the UX.

This commit removes the dependence on the Simple Provider and instead copies over the code from it - namely, the set method - and modifies it slightly for brevity.

This change sets up a few things:

  1. The collapse of the ensure and dsc_ensure attributes. Once merged, the ensure attribute becomes redundant; the provider no longer needs to care about it and it can be removed from both generation and the provider.
  2. The dropping of the simple_get_filter from puppetized DSC Resource type definitions. The feature is made redundant in this commit and no longer used.
  3. Refactoring of this provider for clarity. Now that all of the required code for this provider lives in this gem we can look to refactor some of the helpers out and clean things up a little.

Prior to this commit the DSC Base provider inherited from
the Resource APIs Simple Provider. This brought with it a
limitation in the type definition, requiring all of the
generated DSC types to have the ensure attribute. This
led to the confusion in puppetlabs/Puppet.Dsc#72 as well
as necessitated the filing of puppetlabs/Puppet.Dsc#74
to improve the UX.

This commit removes the dependence on the Simple Provider
and instead copies over the code from it - namely, the
set method - and modifies it slightly for brevity.

This change sets up a few things:

1. The collapse of the ensure and dsc_ensure attributes.
   Once merged, the ensure attribute becomes redundant;
   the provider no longer needs to care about it and it
   can be removed from both generation and the provider.
2. The dropping of the simple_get_filter from puppetized
   DSC Resource type definitions. The feature is made
   redundant in this commit and no longer used.
3. Refactoring of this provider for clarity. Now that all
   of the required code for this provider lives in this
   gem we can look to refactor some of the helpers out and
   clean things up a little.

- Resolves #59
- Unblocks puppetlabs/Puppet.Dsc#74
Copy link
Contributor

@pmcmaw pmcmaw left a comment

Choose a reason for hiding this comment

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

LGTM.

@pmcmaw pmcmaw merged commit fd51a41 into puppetlabs:main Nov 24, 2020
@michaeltlombardi michaeltlombardi deleted the gh-59/main/implement-set branch February 2, 2021 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop inheriting from Simple Provider
2 participants