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

xPackage, fixes bug preventing uninstalling software #705

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- xPackage
- Fixed a bug not allowing using the file hash of an installer [Issue #702](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/702).

### Fixed

- xRemoteFile
- Fixed message inconsistencies in `DSC_xRemoteFile.strings.psd1` - Fixes [Issue #716](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/716).
- xPSDesiredStateConfiguration
- Fixed build failures caused by changes in `ModuleBuilder` module v1.7.0
by changing `CopyDirectories` to `CopyPaths` - Fixes [Issue #687](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/687).
Expand All @@ -20,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Pester issue has been resolved - Fixes [Issue #698](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/698).
- xGroup
- Ensure group membership is always returned as an array - Fixes [Issue #353](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/353).
- xPackage
- Fixed a bug not allowing using the file hash of an installer [Issue #702](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/702).
- Uninstalling software (Ensure = Absent) did not work due to improper handling of arguments. This fixes #704.

### Changed

Expand All @@ -32,6 +34,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved strings into localization file - Fixes [Issue #622](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/622).
- Corrected case of `CertificateThumbPrint` to `CertificateThumbprint`.
- Renamed `master` branch to `main` - Fixes [Issue #696](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/696).
- Updated `GitVersion.yml` to latest pattern - Fixes [Issue #707](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/707).
- Updated build to use `Sampler.GitHubTasks` - Fixes [Issue #711](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/711).
- Added support for publishing code coverage to `CodeCov.io` and
Azure Pipelines - Fixes [Issue #711](https://github.com/dsccommunity/xPSDesiredStateConfiguration/issues/711).

## [9.1.0] - 2020-02-19

Expand Down
4 changes: 2 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ branches:
tag: useBranchName
increment: Minor
regex: f(eature(s)?)?[\/-]
source-branches: ['main']
source-branches: ['master']
hotfix:
tag: fix
increment: Patch
regex: (hot)?fix(es)?[\/-]
source-branches: ['main']
source-branches: ['master']
ignore:
sha: []
merge-message-formats: {}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dsccommunity/xPSDesiredStateConfiguration/8/main)](https://dsccommunity.visualstudio.com/xPSDesiredStateConfiguration/_test/analytics?definitionId=8&contextType=build)
[![PowerShell Gallery (with prereleases)](https://img.shields.io/powershellgallery/vpre/xPSDesiredStateConfiguration?label=xPSDesiredStateConfiguration%20Preview)](https://www.powershellgallery.com/packages/xPSDesiredStateConfiguration/)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/xPSDesiredStateConfiguration?label=xPSDesiredStateConfiguration)](https://www.powershellgallery.com/packages/xPSDesiredStateConfiguration/)
[![codecov](https://codecov.io/gh/dsccommunity/xPSDesiredStateConfiguration/branch/main/graph/badge.svg)](https://codecov.io/gh/dsccommunity/xPSDesiredStateConfiguration)

The **xPSDesiredStateConfiguration** module is a more recent, experimental
version of the PSDesiredStateConfiguration module that ships in Windows as part
Expand Down
1 change: 1 addition & 0 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
'Sampler.GitHubTasks' = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
'DscResource.Common' = 'latest'
Expand Down
143 changes: 77 additions & 66 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ trigger:
exclude:
- "*-*"

variables:
buildFolderName: output
buildArtifactName: output
testResultFolderName: testResults
testArtifactName: testResults
sourceFolderName: source

stages:
- stage: Build
jobs:
Expand All @@ -36,12 +43,13 @@ stages:
env:
ModuleVersion: $(gitVersion.Informationalversion)

- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifact'
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
PathtoPublish: 'output/'
ArtifactName: 'output'
publishLocation: 'Container'
targetPath: '$(buildFolderName)/'
artifact: $(buildArtifactName)
publishLocation: 'pipeline'
parallel: true

- stage: Test
dependsOn: Build
Expand All @@ -52,13 +60,12 @@ stages:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: test
Expand All @@ -72,7 +79,7 @@ stages:
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'HQRM'
condition: succeededOrFailed()

Expand All @@ -82,20 +89,12 @@ stages:
vmImage: 'vs2017-win2016'
timeoutInMinutes: 0
steps:
- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
name: dscBuildVariable
displayName: 'Set Environment Variables'

- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: test
Expand All @@ -109,31 +108,61 @@ stages:
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2016)'
condition: succeededOrFailed()

- task: PublishPipelineArtifact@1
displayName: 'Publish Test Artifact'
inputs:
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
artifactName: $(testArtifactName)
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'
condition: succeededOrFailed()
displayName: 'Publish Code Coverage to Azure DevOps'
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(DscBuildVariable.RepositoryName)'
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)'
pool:
vmImage: 'vs2017-win2016'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: configureWinRM
Expand All @@ -155,7 +184,7 @@ stages:
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (Windows Server 2016)'
condition: succeededOrFailed()

Expand All @@ -165,20 +194,12 @@ stages:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
name: dscBuildVariable
displayName: 'Set Environment Variables'

- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: test
Expand All @@ -192,31 +213,22 @@ stages:
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2019)'
condition: succeededOrFailed()

- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage'
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'

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

- task: PowerShell@2
name: configureWinRM
Expand All @@ -238,7 +250,7 @@ stages:
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (Windows Server 2019)'
condition: succeededOrFailed()

Expand All @@ -259,13 +271,12 @@ stages:
pool:
vmImage: 'ubuntu 16.04'
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'

- task: PowerShell@2
name: publishRelease
Expand Down
9 changes: 6 additions & 3 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ BuildWorkflow:
- Pester_if_Code_Coverage_Under_Threshold

publish:
- Publish_release_to_GitHub
- publish_module_to_gallery

- Publish_Release_To_GitHub
- Publish_Module_To_gallery

####################################################
# PESTER Configuration #
Expand All @@ -64,6 +63,8 @@ Pester:
- tests/Integration
ExcludeTag:
Tag:
CodeCoverageOutputFile: JaCoCo_coverage.xml
CodeCoverageOutputFileEncoding: ascii
CodeCoverageThreshold: 70

DscTest:
Expand All @@ -84,6 +85,8 @@ Resolve-Dependency:
ModuleBuildTasks:
Sampler:
- '*.build.Sampler.ib.tasks'
Sampler.GitHubTasks:
- '*.ib.tasks'

TaskHeader: |
param($Path)
Expand Down
28 changes: 28 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
codecov:
require_ci_to_pass: no
# main should be the baseline for reporting
branch: main

comment:
layout: "reach, diff, flags, files"
behavior: default

coverage:
range: 50..80
round: down
precision: 0

status:
project:
default:
# Set the overall project code coverage requirement to 70%
target: 70
patch:
default:
# Set the pull request requirement to not regress overall coverage by more than 5%
# and let codecov.io set the goal for the code changed in the patch.
target: auto
threshold: 5

fixes:
- '^\d+\.\d+\.\d+::source' # move path "X.Y.Z" => "source"
Loading