-
Notifications
You must be signed in to change notification settings - Fork 141
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
ADReplicationSiteLink: Fix Setting Options After the Resource is Initially Created #606
ADReplicationSiteLink: Fix Setting Options After the Resource is Initially Created #606
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r1.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @johlju and @X-Guardian)
source/DSCResources/MSFT_ADReplicationSiteLink/MSFT_ADReplicationSiteLink.psm1, line 292 at r1 (raw file):
if ($PSBoundParameters.ContainsKey('OptionChangeNotification')
This was used to only change this property if it was passed in the configuration (if the value should be enforced on an existing site link). With this change it looks like the resource will always be changed regardless if the configuration wanted to enforce that value or not.
If the values need to be set when initially creating the site link, then that should be separate logic from enforcing an existing site link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @johlju)
source/DSCResources/MSFT_ADReplicationSiteLink/MSFT_ADReplicationSiteLink.psm1, line 292 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
if ($PSBoundParameters.ContainsKey('OptionChangeNotification')
This was used to only change this property if it was passed in the configuration (if the value should be enforced on an existing site link). With this change it looks like the resource will always be changed regardless if the configuration wanted to enforce that value or not.
If the values need to be set when initially creating the site link, then that should be separate logic from enforcing an existing site link?
The parameters have a default value, which we should be applying if not specified in the config, which is what this change does. If we don't want them to have a default value, we should remove the defaults from the parameter definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @johlju and @X-Guardian)
source/DSCResources/MSFT_ADReplicationSiteLink/MSFT_ADReplicationSiteLink.psm1, line 292 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
The parameters have a default value, which we should be applying if not specified in the config, which is what this change does. If we don't want them to have a default value, we should remove the defaults from the parameter definitions.
I think we should remove the default values, because I think we should only enforce values that is part of a configuration. The proposed change would be a breaking change since it will start enforcing values not in an existing configuration. If we remove the default values then this would not be a breaking change. 🤔
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @johlju)
source/DSCResources/MSFT_ADReplicationSiteLink/MSFT_ADReplicationSiteLink.psm1, line 292 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
I think we should remove the default values, because I think we should only enforce values that is part of a configuration. The proposed change would be a breaking change since it will start enforcing values not in an existing configuration. If we remove the default values then this would not be a breaking change. 🤔
What do you think?
Agreed, Johan. We shouldn't have non-required properties with default values, as it is confusing as to whether they are 'managed' properties or not. I'll remove the default values and refactor the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @johlju)
source/DSCResources/MSFT_ADReplicationSiteLink/MSFT_ADReplicationSiteLink.psm1, line 292 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Agreed, Johan. We shouldn't have non-required properties with default values, as it is confusing as to whether they are 'managed' properties or not. I'll remove the default values and refactor the code.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Codecov Report
@@ Coverage Diff @@
## master #606 +/- ##
=====================================
Coverage 98% 99%
=====================================
Files 23 23
Lines 3093 3045 -48
=====================================
- Hits 3059 3031 -28
+ Misses 34 14 -20 |
Pull Request (PR) description
This PR fixes the issue with the
ADReplicationSiteLink
resource whereby settingOptionChangeNotification
,OptionTwoWaySync
orOptionDisableCompression
fails after the resource is initially created.This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
and comment-based help.
This change is