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-145) Add validation mode flag to puppetized DSC Resources #147

Merged
merged 1 commit into from
Jun 28, 2021
Merged

(GH-145) Add validation mode flag to puppetized DSC Resources #147

merged 1 commit into from
Jun 28, 2021

Conversation

michaeltlombardi
Copy link

@michaeltlombardi michaeltlombardi commented Apr 25, 2021

This PR adds a validation_mode flag to the puppetized resources which changes their behavior from Puppet's perspective; by default resources will use the property validation mode, which relies on Puppet's own property insync validation to tell whether or not a resource is in the desired state. If the manifest writer instead specifies the validation mode to be resource, it will call Invoke-DscResource with the Test method and trust that result, reporting in/out of state for all properties of the resource. This results in less granular change reporting but reduces the incidence of flapping, failing to recognize changes correctly, etc.

This PR adds documentation for using the validation mode flag and tests to validate the changes in behavior.

This change is blocked on the resolving of puppetlabs/puppet-resource_api#225 and its subsequent release into Puppet, as well as a PDK version which bundles those versions into itself.

It is also blocked on the merging of puppetlabs/ruby-pwsh#124 which implements the custom insync logic in the base provider.

TODO:

  • Write a changelog entry
  • Ensure tests function as expected

@michaeltlombardi michaeltlombardi added the enhancement New feature or request label Apr 25, 2021
@michaeltlombardi michaeltlombardi added this to the 002: End to End Testing milestone Apr 25, 2021
@michaeltlombardi
Copy link
Author

Blocked on the next releases of Puppet (6.23.0 and 7.?.? and the PDK which incorporates them).

@michaeltlombardi michaeltlombardi removed this from the 002: End to End Testing & 1.0.0 Release milestone Jun 14, 2021
@michaeltlombardi
Copy link
Author

The implementation here has been validated against the implementation of custom insync in the DSC Base provider (as seen in the passing acceptance tests against a git reference). Once that implementation is merged and a release is cut, the commit modifying the git reference for acceptance should be dropped, at which point this PR can be merged and #145 will be resolved.

This commit adds a validation mode flag to the puppetized resources which
changes their behavior from Puppets perspective; by default resources will
use the property validation mode, which relies on Puppets own property
insync validation to tell whether or not a resource is in the desired
state. If the manifest writer instead specifies the validation mode to be
resource mode, it will call Invoke-DscResource with the test method and
trust that result, reporting in/out of state for **all** properties of
the resource. This results in less granular change reporting but reduces
the incidence of flapping, failing to recognize changes correctly, etc.

This commit adds documentation for using the validation mode flag and
tests to validate the changes in behavior.

This change is blocked on the resolving of puppetlabs/puppet-resource_api#225
and its subsequent release into Puppet, as well as a PDK version which
bundles those versions into itself.

It is also blocked on the merging of puppetlabs/ruby-pwsh#124 which implements
the custom insync logic in the base provider.

TODO:

- [ ] Write a changelog entry
- [ ] Ensure tests function as expected
@michaeltlombardi michaeltlombardi marked this pull request as ready for review June 28, 2021 15:14
@michaeltlombardi michaeltlombardi requested a review from a team as a code owner June 28, 2021 15:15
@david22swan david22swan merged commit 488fdd7 into puppetlabs:main Jun 28, 2021
@michaeltlombardi michaeltlombardi deleted the gh-145/main/add_validation_mode branch July 21, 2021 15:48
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.

2 participants