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

Fix AdcsAuthorityInformationAccess: always makes a change #128, #138 #139

Closed
wants to merge 8 commits into from
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- AdcsAuthorityInformationAccess
- Removed `AllowRestartService` parameter from compared settings, force `Get-CaAiaUriList`
to return unmangled `System.String[]` with single values.
Fixes [Issue #128](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/128)
Fixes [Issue #138](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/138).

### Changed

- ActiveDirectoryCSDsc
Expand All @@ -13,7 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `GitVersion.yml` to latest pattern - Fixes [Issue #126](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/126).
- Updated build to use `Sampler.GitHubTasks` - Fixes [Issue #129](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/129).
- Added support for publishing code coverage to `CodeCov.io` and
Azure Pipelines - Fixes [Issue #130](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/130).
- Azure Pipelines - Fixes [Issue #130](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/130).
- Azure pipelines - Remove deprecated images, make the build work

## [5.0.0] - 2020-06-20

Expand Down
150 changes: 40 additions & 110 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ stages:
- job: Package_Module
displayName: 'Package Module'
pool:
vmImage: 'ubuntu 16.04'
vmImage: 'windows-latest'
steps:
- task: GitVersion@5
name: gitversion
displayName: 'Evaluate Next Version'
inputs:
runtime: 'core'
configFilePath: 'GitVersion.yml'
- pwsh: |
dotnet tool install --global GitVersion.Tool
$gitVersionObject = dotnet-gitversion | ConvertFrom-Json
$gitVersionObject.PSObject.Properties.ForEach{
Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'."
Write-Host -Object "##vso[task.setvariable variable=$($_.Name);]$($_.Value)"
}
Write-Host -Object "##vso[build.updatebuildnumber]$($gitVersionObject.FullSemVer)"
displayName: Calculate ModuleVersion (GitVersion)

- task: PowerShell@2
name: package
Expand All @@ -41,7 +44,7 @@ stages:
arguments: '-Tasks pack -ResolveDependency'
pwsh: true
env:
ModuleVersion: $(gitVersion.Informationalversion)
ModuleVersion: $(NuGetVersionV2)

- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
Expand All @@ -57,11 +60,11 @@ stages:
- job: Test_HQRM
displayName: 'HQRM'
pool:
vmImage: 'windows-2019'
vmImage: 'windows-latest'
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
Expand All @@ -83,14 +86,14 @@ stages:
testRunTitle: 'HQRM'
condition: succeededOrFailed()

- job: Test_Unit_2016
displayName: 'Unit (Windows Server 2016)'
- job: Test_Unit
displayName: 'Unit'
pool:
vmImage: 'vs2017-win2016'
vmImage: 'windows-latest'
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
Expand All @@ -109,52 +112,22 @@ stages:
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2016)'
testRunTitle: 'Unit'
condition: succeededOrFailed()

- task: PublishPipelineArtifact@1
displayName: 'Publish Test Artifact'
inputs:
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
artifactName: $(testArtifactName)
# If several pipeline jobs are generating code coverage, replace above with this:
#artifactName: 'CodeCoverageWindows' # Can be any, in the pipeline, unique name
parallel: true

- job: Code_Coverage
displayName: 'Publish Code Coverage'
dependsOn: Test_Unit_2016
pool:
vmImage: 'ubuntu 16.04'
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: DownloadPipelineArtifact@2
displayName: 'Download Test Artifact'
inputs:
buildType: 'current'
artifactName: $(testArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)'

- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage to Azure DevOps'
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/$(sourceFolderName)/'

- script: |
bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml"
displayName: 'Publish Code Coverage to Codecov.io'

- job: Test_Integration_2016
displayName: 'Integration (Windows Server 2016)'
- job: Test_Integration
displayName: 'Integration'
pool:
vmImage: 'vs2017-win2016'
vmImage: 'windows-latest'
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
Expand Down Expand Up @@ -193,82 +166,39 @@ stages:
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (Windows Server 2016)'
testRunTitle: 'Integration'
condition: succeededOrFailed()

- job: Test_Unit_2019
displayName: 'Unit (Windows Server 2019)'
- job: Code_Coverage
displayName: 'Publish Code Coverage'
dependsOn: Test_Unit
pool:
vmImage: 'windows-2019'
vmImage: 'ubuntu-latest'
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: test
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
pwsh: false

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2019)'
condition: succeededOrFailed()

- job: Test_Integration_2019
displayName: 'Integration (Windows Server 2019)'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
displayName: 'Download Test Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false

- task: PowerShell@2
name: installADCSFeatures
displayName: 'Install ADCS Features'
inputs:
targetType: 'inline'
script: 'Install-WindowsFeature -Name ADCS-Cert-Authority, RSAT-ADCS'
pwsh: false
artifactName: $(testArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)'

- task: PowerShell@2
name: test
displayName: 'Run Integration Test'
- task: PublishCodeCoverageResults@2
displayName: 'Publish Code Coverage to Azure DevOps'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
pwsh: false
summaryFileLocation: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/$(sourceFolderName)/'

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (Windows Server 2019)'
condition: succeededOrFailed()
- script: |
bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml"
displayName: 'Publish Code Coverage to Codecov.io'

- stage: Deploy
dependsOn: Test
Expand All @@ -285,7 +215,7 @@ stages:
- job: Deploy_Module
displayName: 'Deploy Module'
pool:
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function Test-TargetResource
-Verbose:$VerbosePreference

$null = $PSBoundParameters.Remove('IsSingleInstance')
$null = $PSBoundParameters.Remove('AllowRestartService')

return Test-DscParameterState `
-CurrentValues $currentSettings `
Expand Down Expand Up @@ -234,7 +235,8 @@ function Get-CaAiaUriList

Write-Verbose -Message ($script:localizedData.GettingAiaUrisMessage -f $ExtensionType)

return [System.String[]] (Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri
$UriList = [System.String[]](Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri
return ,$UriList
}

Export-ModuleMember -Function *-TargetResource