Skip to content

Commit

Permalink
BREAKING CHANGE: xWindowsUpdate: Added automatic release with a new C…
Browse files Browse the repository at this point in the history
…I pipeline (#94)

- xWindowsUpdate
  - BREAKING CHANGE: Removed the deprecated resource `xMicrosoftUpdate`- 
  - Added automatic release with a new CI pipeline.
  - Moved the `Set-StrictMode` so that it is used during testing only and
    not during runtime.
  - Removed the helper function `Trace-Message` and using the `Write-Verbose`
    directly instead.
  - The helper function `New-InvalidArgumentException` was replaced by
    its equivalent in the module DscResource.Common.
xWindowsUpdateAgent
  - Added Retry logic to known transient errors (issue #24).
  - Removed the `$PSCmdlet.ShouldProcess` calls from code since DSC does not
    support interactive actions.
  - No longer defaults to output verbose messages.
  • Loading branch information
johlju authored Mar 21, 2020
1 parent 406c00c commit 8b2a840
Show file tree
Hide file tree
Showing 55 changed files with 4,392 additions and 2,945 deletions.
4 changes: 0 additions & 4 deletions .MetaTestOptIn.json

This file was deleted.

6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
* text eol=crlf

# Ensure any exe files are treated as binary
*.exe binary
*.jpg binary
*.xl* binary
*.pfx binary
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Problem_with_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ about: If you have a problem, bug, or enhancement with a resource in this resour
$PSVersionTable
-->

#### Version of the DSC module that was used ('dev' if using current dev branch)
#### Version of the DSC module that was used
22 changes: 14 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@
#### Pull Request (PR) description
<!--
Replace this comment block with a description of your PR.
Also, make sure you have updated the CHANGELOG.md, see the
task list below. An entry in the CHANGELOG.md is mandatory
for all PRs.
-->

#### This Pull Request (PR) fixes the following issues
<!--
If this PR does not fix an open issue, replace this comment block with None.
If this PR resolves one or more open issues, replace this comment block with
a list the issues using a GitHub closing keyword, e.g.:
- Fixes #123
- Fixes #124
a list of the issues using a GitHub closing keyword, e.g.:
- Fixes #123
- Fixes #124
-->

#### Task list
Expand All @@ -34,14 +38,16 @@
Change to [x] for each task in the task list that applies to your PR.
For those task that don't apply to you PR, leave those as is.
-->
- [ ] Added an entry under the Unreleased section of the change log in the README.md.
Entry should say what was changed, and how that affects users (if applicable).
- [ ] Added an entry to the change log under the Unreleased section of the
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
- [ ] Resource documentation added/updated in README.md.
- [ ] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help.
- [ ] Comment-based help added/updated.
- [ ] Localization strings added/updated in all localization files as appropriate.
- [ ] Examples appropriately added/updated.
- [ ] Unit tests added/updated. See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] Integration tests added/updated (where possible). See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] New/changed code adheres to [DSC Resource Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md) and [Best Practices](https://github.com/PowerShell/DscResources/blob/master/BestPractices.md).
- [ ] Unit tests added/updated. See [DSC Community Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines).
- [ ] Integration tests added/updated (where possible). See [DSC Community Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines).
- [ ] New/changed code adheres to [DSC Community Style Guidelines](https://dsccommunity.org/styleguidelines).
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DSCResource.Tests
output/
.vs
.vscode
10 changes: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"MD029": {
"style": "one"
},
"MD013": true,
"MD024": false,
"MD034": false,
"no-hard-tabs": true
}
16 changes: 3 additions & 13 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
@{
<#
For the custom rules to work, the DscResource.Tests repo must be
cloned. It is automatically clone as soon as any unit or
integration tests are run.
#>
CustomRulePath = '.\DSCResource.Tests\DscResource.AnalyzerRules'

IncludeRules = @(
CustomRulePath = '.\output\RequiredModules\DscResource.AnalyzerRules'
includeDefaultRules = $true
IncludeRules = @(
# DSC Resource Kit style guideline rules.
'PSAvoidDefaultValueForMandatoryParameter',
'PSAvoidDefaultValueSwitchParameter',
Expand Down Expand Up @@ -43,11 +38,6 @@
'PSUseDeclaredVarsMoreThanAssignments',
'PSUsePSCredentialType',

<#
This is to test all the DSC Resource Kit custom rules.
The name of the function-blocks of each custom rule start
with 'Measure*'.
#>
'Measure-*'
)
}
29 changes: 27 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.newLineAfterCloseBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
"powershell.codeFormatting.preset": "Custom",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1"
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1",
"powershell.scriptAnalysis.enable": true,
"files.associations": {
"*.ps1xml": "xml"
},
"cSpell.words": [
"COMPANYNAME",
"ICONURI",
"LICENSEURI",
"PROJECTURI",
"RELEASENOTES",
"buildhelpers",
"endregion",
"gitversion",
"icontains",
"keepachangelog",
"notin",
"pscmdlet",
"steppable"
],
"[markdown]": {
"files.trimTrailingWhitespace": true,
"files.encoding": "utf8"
}
}
125 changes: 125 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"version": "2.0.0",
"_runner": "terminal",
"windows": {
"options": {
"shell": {
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-Command"
]
}
}
},
"linux": {
"options": {
"shell": {
"executable": "/usr/bin/pwsh",
"args": [
"-NoProfile",
"-Command"
]
}
}
},
"osx": {
"options": {
"shell": {
"executable": "/usr/local/bin/pwsh",
"args": [
"-NoProfile",
"-Command"
]
}
}
},
"tasks": [
{
"label": "build",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": ["-AutoRestore"],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "new",
"clear": false
},
"runOptions": {
"runOn": "default"
},
"problemMatcher": [
{
"owner": "powershell",
"fileLocation": [
"absolute"
],
"severity": "error",
"pattern": [
{
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
"message": 1
},
{
"regexp": "(.*)",
"code": 1
},
{
"regexp": ""
},
{
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*",
"file": 1,
"line": 2
}
]
}
]
},
{
"label": "test",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": ["-AutoRestore","-Tasks","test"],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": [
{
"owner": "powershell",
"fileLocation": [
"absolute"
],
"severity": "error",
"pattern": [
{
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
"message": 1
},
{
"regexp": "(.*)",
"code": 1
},
{
"regexp": ""
},
{
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*",
"file": 1,
"line": 2
}
]
}
]
}
]
}
88 changes: 88 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Change log for {RepositoryName}

The format is based on and uses the types of changes according to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- xWindowsUpdate
- Added automatic release with a new CI pipeline.
- xWindowsUpdateAgent
- Added Retry logic to known transient errors ([issue #24](https://github.com/dsccommunity/xWindowsUpdate/issues/24)).

### Changed

- xWindowsUpdate
- Moved the `Set-StrictMode` so that it is used during testing only and
not during runtime.
- Removed the helper function `Trace-Message` and using the `Write-Verbose`
directly instead.
- The helper function `New-InvalidArgumentException` was replaced by
its equivalent in the module DscResource.Common.
- xWindowsUpdateAgent
- Removed the `$PSCmdlet.ShouldProcess` calls from code since DSC does not
support interactive actions.
- No longer defaults to output verbose messages.

### Removed

- xWindowsUpdate
- BREAKING CHANGE: Removed the deprecated resource `xMicrosoftUpdate`

## [2.8.0.0] - 2019-04-03

- xWindowsUpdateAgent: Fixed verbose statement returning incorrect variable
- Tests no longer fail on `Assert-VerifiableMocks`, these are now renamed
to `Assert-VerifiableMock` (breaking change in Pester v4).
- README.md has been updated with correct description of the resources
([issue #58](https://github.com/dsccommunity/xWindowsUpdate/issues/58)).
- Updated appveyor.yml to use the correct parameters to call the test framework.
- Update appveyor.yml to use the default template.
- Added default template files .gitattributes, and .gitignore, and
.vscode folder.

## [2.7.0.0] - 2017-07-12

- xWindowsUpdateAgent: Fix Get-TargetResource returning incorrect key

## [2.6.0.0] - 2017-03-08

- Converted appveyor.yml to install Pester from PSGallery instead of from
Chocolatey.
- Fixed PSScriptAnalyzer issues.
- Fixed common test breaks (markdown style, and example style).
- Added CodeCov.io reporting
- Deprecated xMicrosoftUpdate as it's functionality is replaced by
xWindowsUpdateAgent

## [2.5.0.0] - 2016-05-18

- Added xWindowsUpdateAgent

## [2.4.0.0] - 2016-03-30

- Fixed PSScriptAnalyzer error in examples

## [2.3.0.0] - 2016-02-02

- MSFT_xWindowsUpdate: Fixed an issue in the Get-TargetResource function,
resulting in the Get-DscConfiguration cmdlet now working appropriately
when the resource is applied.
- MSFT_xWindowsUpdate: Fixed an issue in the Set-TargetResource function
that was causing the function to fail when the installation of a hotfix
did not provide an exit code.

## [2.2.0.0] - 2015-09-11

- Minor fixes

## [2.1.0.0] - 2015-07-24

- Added xMicrosoftUpdate DSC resource which can be used to enable/disable
Microsoft Update in the Windows Update Settings.

### [2.0.0.0] - 2015-04-23

- Initial release with the xHotfix resource
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

This project has adopted the [DSC Community Code of Conduct](https://dsccommunity.org/code_of_conduct).
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing

Please check out common DSC Community [contributing guidelines](https://dsccommunity.org/guidelines/contributing).

## Running the Tests

If want to know how to run this module's tests you can look at the [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/#running-tests)
Loading

0 comments on commit 8b2a840

Please sign in to comment.