-
Notifications
You must be signed in to change notification settings - Fork 53
Added PartitionStyle Parameter to Disk - Fixes #137 #170
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
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #170 +/- ##
===================================
+ Coverage 94% 94% +<1%
===================================
Files 6 6
Lines 795 797 +2
===================================
+ Hits 754 756 +2
Misses 41 41 |
@johlju - maybe hold off on review of this one until we decide if changing the prefix is acceptable? |
Yes sounds good, maybe you want to rename the property back to PartitionStyle again too then? |
Yep! Will do. I'll probably create another branch off this one with the renamed parameter and the new MOF name. |
@PlagueHO I haven't heard anything from @kwirkykat or @mgreenegit so let's assume the rename is not a problem. We have until next release to change it if there are any obstacles with it. So let's do the rename of prefix. |
@johlju - this should be good to go now! |
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 4 of 12 files at r1, 8 of 8 files at r2.
Reviewable status: all files reviewed, 9 unresolved discussions (waiting on @PlagueHO)
CHANGELOG.md, line 8 at r2 (raw file):
- Added `PartitionStyle` parameter - Fixes [Issue #137](https://github.com/PowerShell/StorageDsc/issues/37). - Changed MOF name from `MSFT_Disk` to `MSFTDSC_Disk` to remove conflict with Windows built-in CIM class.
Maybe reference issue here?
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.psm1, line 42 at r2 (raw file):
This value of this parameter is ignored
This can be interpreted as it is used, but the value will be ignored. Maybe write 'This parameter is not used in Get-TargetResource'? Throughout.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.schema.mof, line 3 at r2 (raw file):
Prefix
maybe 'prefix' (lower-case 'p')?
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/README.md, line 25 at r2 (raw file):
for disks with `GPT` partition table format.
What if the disk is RAW? Should the PartitionStyle be set to 'GPT' for the Guid identifier is allowed to be used?
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1, line 21 at r2 (raw file):
'{3}' required.
maybe: '{3}' is required.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1, line 22 at r2 (raw file):
'{3}' required.
maybe: '{3}' is required.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1, line 22 at r2 (raw file):
'True'
Not sure, but maybe we should change this to $true
, otherwise it could mean that the string 'True' should be used for a boolean value (for users less familiar with PowerShell)? Throughout, if so.
Tests/Integration/MSFTDSC_Disk.config.ps1, line 12 at r2 (raw file):
DiskId = $Node.DiskId DiskIdType = $Node.DiskIdType PartitionStyle = $Node.PartitionStyle
Alignment wrong (after search/replace). 🙂
Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1, line 368 at r2 (raw file):
} Context "Resize partition on Disk Number $($disk.Number) to use 50MB with AllowDestructive" {
Is this description correct? Doesn't it clear all partitions on the disk and converts it to GPT then creates a 50MB partition? Or do I misunderstood this test?
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.
Should be good now @johlju
Reviewable status: 6 of 12 files reviewed, 9 unresolved discussions (waiting on @johlju and @PlagueHO)
CHANGELOG.md, line 8 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Maybe reference issue here?
Done.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.psm1, line 42 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
This value of this parameter is ignored
This can be interpreted as it is used, but the value will be ignored. Maybe write 'This parameter is not used in Get-TargetResource'? Throughout.
Done.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.schema.mof, line 3 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Prefix
maybe 'prefix' (lower-case 'p')?
Done. And changed the c in Class to lower case as it should be.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/README.md, line 25 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
for disks with `GPT` partition table format.
What if the disk is RAW? Should the PartitionStyle be set to 'GPT' for the Guid identifier is allowed to be used?
The paragraph above specifies that a disk that is RAW can not be used with a GUID identifier or do you mean should we throw an exception if the MBR style is used and a Guid identifier type is specified?
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1, line 21 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
'{3}' required.
maybe: '{3}' is required.
Done.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1, line 22 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
'{3}' required.
maybe: '{3}' is required.
Done.
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1, line 22 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
'True'
Not sure, but maybe we should change this to
$true
, otherwise it could mean that the string 'True' should be used for a boolean value (for users less familiar with PowerShell)? Throughout, if so.
Done.
Tests/Integration/MSFTDSC_Disk.config.ps1, line 12 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Alignment wrong (after search/replace). 🙂
Good catch! Done
Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1, line 368 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Is this description correct? Doesn't it clear all partitions on the disk and converts it to GPT then creates a 50MB partition? Or do I misunderstood this test?
You are correct. I also clarified another test that allowed destructive clearing of the disk.
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 6 of 6 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @johlju)
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/README.md, line 25 at r2 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
The paragraph above specifies that a disk that is RAW can not be used with a GUID identifier or do you mean should we throw an exception if the MBR style is used and a Guid identifier type is specified?
I was just thinking if the disk is RAW and has no partition style yet (neither MBR or GPT), can I still specify 'Guid' as identifier type? I assume the disk can be neither GPT or MBR when it is newly created.
I just looking for if it should say: '...for disk with no partition format (RAW
) or GPT
partition table format'. 🙂
Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1, line 368 at r3 (raw file):
} Context "Clear Disk Number $($disk.Number) and change the partition style to GPT and add a 50MB partition" {
Minor: Context should start with 'When...'. Throughout.
Leaving as non-blocking.
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.
Should be good to go now @johlju! Thank you!
Reviewable status: 9 of 12 files reviewed, 1 unresolved discussion (waiting on @johlju and @PlagueHO)
Modules/StorageDsc/DSCResources/MSFTDSC_Disk/README.md, line 25 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
I was just thinking if the disk is RAW and has no partition style yet (neither MBR or GPT), can I still specify 'Guid' as identifier type? I assume the disk can be neither GPT or MBR when it is newly created.
I just looking for if it should say: '...for disk with no partition format (RAW
) orGPT
partition table format'. 🙂
You are correct: If the disk is RAW then selecting GUID isn't possible. It will report back to the user that the disk can't be found.
I've reworked the text to hopefully make this a bit more clear.
Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1, line 368 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Minor: Context should start with 'When...'. Throughout.
Leaving as non-blocking.
Done! 😁 Lots!
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.
Awesome work on this (as usual)! 😃
Reviewed 3 of 3 files at r4.
Reviewable status:complete! all files reviewed, all discussions resolved
Thank you @johlju !!! |
Pull Request (PR) description
PartitionStyle
parameter - Fixes Issue #137.This Pull Request (PR) fixes the following issues
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
@johlju - would you mind reviewing when you have time?
This change is