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

(MAINT) Ensure changelog actually updates #108

Merged
merged 1 commit into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- `JoinOU` to the static list of DSC Resource properties which are Puppet parameters ([#107](https://github.com/puppetlabs/Puppet.Dsc/pulls/107))
## Fixed

- Ensure changelog is actually updated during module Puppetization ([#108](https://github.com/puppetlabs/Puppet.Dsc/pull/))

## [0.2.0] - 2020-12-04

Expand Down
4 changes: 4 additions & 0 deletions src/functions/New-PuppetDscModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ Function New-PuppetDscModule {
Write-PSFMessage -Message 'Writing the Puppet Module readme'
Update-PuppetModuleReadme -PuppetModuleFolderPath $PuppetModuleRootFolderDirectory -PowerShellModuleManifestPath $PowerShellModuleManifestPath

# Write the Puppet module changelog based on PowerShell module
Write-PSFMessage -Message 'Writing the Puppet Module changelog'
Update-PuppetModulechangelog -PuppetModuleFolderPath $PuppetModuleRootFolderDirectory -PowerShellModuleManifestPath $PowerShellModuleManifestPath

# The PowerShell Module path needs to be munged because the Get-DscResource function always and only
# checks the PSModulePath for DSC modules; you CANNOT point to a module by path.
Write-PSFMessage -Message 'Converting the DSC resources to Puppet types and providers'
Expand Down
12 changes: 12 additions & 0 deletions src/tests/functions/New-PuppetDscModule.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Describe "New-PuppetDscModule" {
Mock Update-PuppetModuleMetadata {}
Mock Update-PuppetModuleFixture {}
Mock Update-PuppetModuleReadme {}
Mock Update-PuppetModuleChangelog {}
Mock Set-PSModulePath {}
Mock Get-DscResource {
[Microsoft.PowerShell.DesiredStateConfiguration.DscResourceInfo[]]@(
Expand Down Expand Up @@ -68,6 +69,12 @@ Describe "New-PuppetDscModule" {
$PowerShellModuleManifestPath -match 'import(/|\\)foo\S+(/|\\)foo(/|\\)foo.psd1'
}
}
It 'Updates the Puppet CHANGELOG based on the PowerShell metadata' {
Assert-MockCalled Update-PuppetModuleChangelog -ParameterFilter {
$PuppetModuleFolderPath -match 'import(/|\\)foo' -and
$PowerShellModuleManifestPath -match 'import(/|\\)foo\S+(/|\\)foo(/|\\)foo.psd1'
}
}
It 'Temporarily sets the PSModulePath' {
Assert-MockCalled Set-PSModulePath -ParameterFilter {
$Path -match 'import(/|\\)foo\S*dsc_resources$'
Expand Down Expand Up @@ -119,6 +126,7 @@ Describe "New-PuppetDscModule" {
Mock Update-PuppetModuleMetadata {}
Mock Update-PuppetModuleFixture {}
Mock Update-PuppetModuleReadme {}
Mock Update-PuppetModuleChangelog {}
Mock Set-PSModulePath {}
Mock Get-DscResource {
[Microsoft.PowerShell.DesiredStateConfiguration.DscResourceInfo[]]@(
Expand Down Expand Up @@ -224,6 +232,7 @@ Describe "New-PuppetDscModule" {
Mock Update-PuppetModuleMetadata {}
Mock Update-PuppetModuleFixture {}
Mock Update-PuppetModuleReadme {}
Mock Update-PuppetModuleChangelog {}
Mock Set-PSModulePath {}
Mock Get-DscResource {}
Mock ConvertTo-PuppetResourceApi {}
Expand Down Expand Up @@ -270,6 +279,7 @@ Describe "New-PuppetDscModule" {
Mock Update-PuppetModuleMetadata {}
Mock Update-PuppetModuleFixture {}
Mock Update-PuppetModuleReadme {}
Mock Update-PuppetModuleChangelog {}
Mock Set-PSModulePath {}
Mock Get-DscResource {}
Mock ConvertTo-PuppetResourceApi {}
Expand Down Expand Up @@ -313,6 +323,7 @@ Describe "New-PuppetDscModule" {
Mock Update-PuppetModuleMetadata {}
Mock Update-PuppetModuleFixture {}
Mock Update-PuppetModuleReadme {}
Mock Update-PuppetModuleChangelog {}
Mock Set-PSModulePath {}
Mock Get-DscResource {}
Mock ConvertTo-PuppetResourceApi {}
Expand Down Expand Up @@ -340,6 +351,7 @@ Describe "New-PuppetDscModule" {
Mock Update-PuppetModuleMetadata {}
Mock Update-PuppetModuleFixture {}
Mock Update-PuppetModuleReadme {}
Mock Update-PuppetModuleChangelog {}
Mock Set-PSModulePath {}
Mock Get-DscResource {}
Mock ConvertTo-PuppetResourceApi {}
Expand Down