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

Upgrade the xRegistry resource to high quality #299

Merged
merged 3 commits into from
Dec 17, 2016

Conversation

kwirkykat
Copy link
Contributor

@kwirkykat kwirkykat commented Dec 17, 2016

This is the high quality upgrade of xRegistry for #160.

It includes @Amedama96 's fix for setting a Binary registry value to 0.

Unit tests, integration tests, and examples have been added.
Documentation has been updated.


This change is Reviewable

@kwirkykat kwirkykat added the needs review The pull request needs a code review. label Dec 17, 2016
@kwirkykat kwirkykat requested a review from mbreakey3 December 17, 2016 02:31
@kwirkykat kwirkykat force-pushed the CleanRegistry branch 2 times, most recently from 4781bef to 223b2cc Compare December 17, 2016 03:44
@mbreakey3
Copy link
Contributor

Reviewed 2 of 17 files at r1.
Review status: 1 of 16 files reviewed at latest revision, 7 unresolved discussions.


README.md, line 363 at r1 (raw file):

* **[String] Key** _(Key)_: The path of the registry key to add, modify, or remove. This path must include the registry hive/drive (e.g. HKEY_LOCAL_MACHINE, HKLM:).
* **[String] ValueName** _(Key)_: The name of the registry value. To add or remove a registry key, specify this property as an empty string without specifying ValueType or ValueData. To modify or remove the default value of a registry key, specify this property as an empty string while also specifying ValueType or ValueData.
* **[String] Ensure** _(Write)_: Specifies whether or not the registry key or value should exist. To add or modify a registry key or value, set this property to Present. To remove a registry key or value, set the property to Absent. { *Present* | Absent }.

...'set this property to Absent' for consistency.


README.md, line 365 at r1 (raw file):

* **[String] Ensure** _(Write)_: Specifies whether or not the registry key or value should exist. To add or modify a registry key or value, set this property to Present. To remove a registry key or value, set the property to Absent. { *Present* | Absent }.
* **[String] ValueData** _(Write)_: The data the specified registry key value should have as an array of strings.
* **[String] ValueType** _(Write)_: The type of the specified registry key value should have. { *String* | Binary | DWord | QWord | MultiString | ExpandString }

The type the specified...' (extra of)


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 176 at r1 (raw file):

        If an empty string ValueName has been specified and no ValueType and no ValueData
        has been specified, treat this case as if ValueName was not specified and target
        the Key itself. This is to cater the limitation that both Key and ValueName

This last sentence is worded a bit weird.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 303 at r1 (raw file):

                    Write-Verbose -Message ($script:localizedData.RemovingRegistryKeyValue -f $valueDisplayName, $Key)
                        
                    # If the specified registry key value exists, check if it is the user specified a registry key value with a name to remove

'check if the user....'


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 555 at r1 (raw file):

<#
    .SYNOPSIS
        Converts the specigied registry drive root to its corresponding registry drive name.

'specified'


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 951 at r1 (raw file):

<#
    .SYNOPSIS
        Creates a new subkey with the specified name under the specfied registry key.

'specified'


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 1287 at r1 (raw file):

<#
    .SYNOPSIS
        Sets the specified registry key value with the specified name to the specigied value.

specified lol


Comments from Reviewable

@kwirkykat
Copy link
Contributor Author

Review status: 0 of 16 files reviewed at latest revision, 7 unresolved discussions.


README.md, line 363 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

...'set this property to Absent' for consistency.

Done.


README.md, line 365 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

The type the specified...' (extra of)

Done.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 176 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

This last sentence is worded a bit weird.

Moved to the ValueName parameter description


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 303 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

'check if the user....'

Done.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 555 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

'specified'

Done.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 951 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

'specified'

Done.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 1287 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

specified lol

Done.


Comments from Reviewable

@mbreakey3
Copy link
Contributor

Reviewed 14 of 17 files at r1.
Review status: 12 of 16 files reviewed at latest revision, 14 unresolved discussions.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.schema.mof, line 4 at r1 (raw file):

class MSFT_xRegistryResource : OMI_BaseResource
{
  [Key,Description("The path of the registry key to add, modify, or remove. This path must include the registry hive/drive.")] String Key;

can you add spaces after the commas? 'Key, Description...'


DSCResources/MSFT_xRegistryResource/en-US/MSFT_xRegistryResource.strings.psd1, line 26 at r1 (raw file):

    RegistryKeyValueTypeDoesNotMatch = The type of the value {0} under the registry key at path {1} does not match the expected type. Expected {2} but was {3}.
    RegistryKeyValueDoesNotMatch = The value {0} under the registry key at path {1} does not match the expected value. Expected {2} but was {3}.

did you mean to have an extra newline here?


Tests/MSFT_xRegistryResource.TestHelper.psm1, line 346 at r1 (raw file):

<#
    .SYNOPSIS
        Tests if the registry drive of he given registry key path is mounted.

'...drive of the given....'


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 4 at r1 (raw file):

    WARNING: DO NOT RUN THESE TESTS ON A VALUABLE MACHINE!
    Running on a disposable VM or AppVeyor is strongly recommended.
    If these tests go awry, your machine's registry could be corrupted which will brick your machine!

lol brick your machine? Is that what happened to yours?


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 59 at r1 (raw file):

            $registryKey = Get-Item -Path $registryParameters.Key -ErrorAction 'SilentlyContinue'

            It 'Should have created registry key' {

'..the registry key'


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 87 at r1 (raw file):

            $registryKeyValue = Get-ItemProperty -Path $registryParameters.Key -Name $registryParameters.ValueName -ErrorAction 'SilentlyContinue'

            It 'Should have created registry key value' {

the registry


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 214 at r1 (raw file):

            $registryKeyValue = Get-ItemProperty -Path $registryParameters.Key -Name $registryParameters.ValueName -ErrorAction 'SilentlyContinue'

            It 'Should be able to retrieve registry key value' {

the registry


Comments from Reviewable

@kwirkykat
Copy link
Contributor Author

Review status: 12 of 16 files reviewed at latest revision, 14 unresolved discussions.


DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.schema.mof, line 4 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

can you add spaces after the commas? 'Key, Description...'

Done.


DSCResources/MSFT_xRegistryResource/en-US/MSFT_xRegistryResource.strings.psd1, line 26 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

did you mean to have an extra newline here?

Yup. They separate the Get/Test/Set-TargetResource-specific messages and the error messages


Tests/MSFT_xRegistryResource.TestHelper.psm1, line 346 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

'...drive of the given....'

Done.


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 4 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

lol brick your machine? Is that what happened to yours?

Pretty much. I couldn't open ANY programs... I could get to the desktop and that was it.


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 59 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

'..the registry key'

Done.


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 87 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

the registry

Done.


Tests/Integration/MSFT_xRegistryResource.EndToEnd.Tests.ps1, line 214 at r1 (raw file):

Previously, mbreakey3 (Mariah) wrote…

the registry

Done.


Comments from Reviewable

@mbreakey3
Copy link
Contributor

Reviewed 1 of 17 files at r1.
Review status: 11 of 16 files reviewed at latest revision, 14 unresolved discussions.


Comments from Reviewable

@mbreakey3
Copy link
Contributor

Reviewed 1 of 17 files at r1, 5 of 5 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@mbreakey3
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants