diff --git a/CHANGELOG.md b/CHANGELOG.md index 122c8f459..d480d6506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,11 +20,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `Examples` directory from being output in packaged module ([issue #11](https://github.com/dsccommunity/AzureDevOpsDsc/issues/11)). - Moved 'Ensure' and 'RequiredAction' enums into 'Enum' directory and out of 'prefix.ps1' ([issue #12](https://github.com/dsccommunity/AzureDevOpsDsc/issues/12)). + - Added pipeline support for publish markdown content to the GitHub repository + wiki ([issue #15](https://github.com/dsccommunity/AzureDevOpsDsc/issues/15)). + This will publish the markdown documentation that is generated bu the + build pipeline. + - Added new source folder `WikiSource`. Every markdown file in the folder + `WikiSource` will be published to the GitHub repository wiki. The markdown + file `Home.md` will be updated with the correct module version on each + publish to gallery (including preview). - AzureDevOpsDsc.Common - Added 'wrapper' functionality around the [Azure DevOps REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/) ### Changed -- Enabled integration tests against https://dev.azure.com/azuredevopsdsc/ (see - comment https://github.com/dsccommunity/AzureDevOpsDsc/issues/9#issuecomment-766375424 - for more information). +- AzureDevOpsDsc + - Enabled integration tests against https://dev.azure.com/azuredevopsdsc/ (see + comment https://github.com/dsccommunity/AzureDevOpsDsc/issues/9#issuecomment-766375424 + for more information). + - Updated pipeline file `RequiredModules.ps1` to latest pipeline pattern. + - Updated pipeline file `build.yaml` to latest pipeline pattern. +- AzDevOpsProject + - Added a validate set to the parameter `SourceControlType` to (for now) + limit the parameter to the values `Git` and `Tfvc`. + - Update comment-based help to remove text which the valid values are + since that is now add automatically to the documentation (conceptual + help and wiki documentation). + +### Fixed + +- AzDevOpsProject + - Added description to the comment-based help. diff --git a/RequiredModules.psd1 b/RequiredModules.psd1 index dd32e5874..1304808d1 100644 --- a/RequiredModules.psd1 +++ b/RequiredModules.psd1 @@ -1,11 +1,8 @@ @{ - # Set up a mini virtual environment... PSDependOptions = @{ AddToPath = $true Target = 'output\RequiredModules' - Parameters = @{ - Repository = '' - } + Parameters = @{} } InvokeBuild = 'latest' diff --git a/build.yaml b/build.yaml index fae560882..46731b217 100644 --- a/build.yaml +++ b/build.yaml @@ -52,7 +52,7 @@ BuildWorkflow: publish: - Publish_release_to_GitHub - publish_module_to_gallery - + - Publish_GitHub_Wiki_Content #################################################### # PESTER Configuration # @@ -63,7 +63,7 @@ Pester: ExcludeFromCodeCoverage: - Modules/DscResource.Common Script: - - tests/Integration + # Only run on unit test on './build.ps1 -Task test' - tests/Unit ExcludeTag: Tag: @@ -80,11 +80,6 @@ DscTest: ExcludeModuleFile: MainGitBranch: main -Resolve-Dependency: - Gallery: 'PSGallery' - AllowPrerelease: false - Verbose: false - ModuleBuildTasks: Sampler: - '*.build.Sampler.ib.tasks' @@ -108,3 +103,16 @@ GitHubConfig: GitHubConfigUserName: dscbot GitHubConfigUserEmail: dsccommunity@outlook.com UpdateChangelogOnPrerelease: false + +#################################################### +# DscResource.DocGenerator Configuration # +#################################################### +DscResource.DocGenerator: + Generate_Conceptual_Help: + MarkdownCodeRegularExpression: + - '\`(.+?)\`' # Match inline code-block + - '\\(\\)' # Match escaped backslash + - '\[[^\[]+\]\((.+?)\)' # Match markdown URL + - '_(.+?)_' # Match Italic (underscore) + - '\*\*(.+?)\*\*' # Match bold + - '\*(.+?)\*' # Match Italic (asterisk) diff --git a/source/Classes/010.AzDevOpsProject.ps1 b/source/Classes/010.AzDevOpsProject.ps1 index 5c9a2af83..4dea38bbc 100644 --- a/source/Classes/010.AzDevOpsProject.ps1 +++ b/source/Classes/010.AzDevOpsProject.ps1 @@ -2,6 +2,9 @@ .SYNOPSIS A DSC Resource for Azure DevOps that represents the 'Project' resource. + .DESCRIPTION + A DSC Resource for Azure DevOps that represents the 'Project' resource. + .PARAMETER ProjectId The 'Id' of the Azure DevOps, 'Project' resource. @@ -12,9 +15,10 @@ The 'Description' of the Azure DevOps, 'Project' resource. .PARAMETER SourceControlType - The 'SourceControlType' of the Azure DevOps, 'Project' resource. Valid options are 'Git' and 'Tfvc'. + The 'SourceControlType' of the Azure DevOps, 'Project' resource. - If the 'Project' resource already exists in Azure DevOps, the 'SourceControlType' cannot be changed to another type. + If the 'Project' resource already exists in Azure DevOps, the parameter + `SourceControlType` cannot be used to change to another type. #> [DscResource()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSDSCStandardDSCFunctionsInResource', '', Justification='Test() and Set() method are inherited from base, "AzDevOpsDscResourceBase" class')] @@ -33,6 +37,7 @@ class AzDevOpsProject : AzDevOpsDscResourceBase [System.String]$ProjectDescription [DscProperty()] + [ValidateSet('Git', 'Tfvc')] [System.String]$SourceControlType diff --git a/source/WikiSource/Home.md b/source/WikiSource/Home.md new file mode 100644 index 000000000..a1cf946e9 --- /dev/null +++ b/source/WikiSource/Home.md @@ -0,0 +1,45 @@ +# Welcome to the AzureDevOpsDsc wiki + +*AzureDevOpsDsc v#.#.#* + +Here you will find all the information you need to make use of the AzureDevOpsDsc +DSC resources in the latest release. This includes details of the resources +that are available, current capabilities, known issues, and information to +help plan a DSC based implementation of AzureDevOpsDsc. + +Please leave comments, feature requests, and bug reports for this module in +the [issues section](https://github.com/dsccommunity/AzureDevOpsDsc/issues) +for this repository. + +## Getting started + +To get started either: + +- Install from the PowerShell Gallery using PowerShellGet by running the + following command: + +```powershell +Install-Module -Name AzureDevOpsDsc -Repository PSGallery +``` + +- Download AzureDevOpsDsc from the [PowerShell Gallery](https://www.powershellgallery.com/packages/AzureDevOpsDsc) + and then unzip it to one of your PowerShell modules folders (such as + `$env:ProgramFiles\WindowsPowerShell\Modules`). + +To confirm installation, run the below command and ensure you see the AzureDevOpsDsc +DSC resources available: + +```powershell +Get-DscResource -Module AzureDevOpsDsc +``` + +## Prerequisites + +The minimum Windows Management Framework (PowerShell) version required is 5.0 +or higher, which ships with Windows 10 or Windows Server 2016, +but can also be installed on Windows 7 SP1, Windows 8.1, Windows Server 2012, +and Windows Server 2012 R2. + +## Change log + +A full list of changes in each version can be found in the [change log](https://github.com/dsccommunity/AzureDevOpsDsc/blob/main/CHANGELOG.md). diff --git a/tests/Unit/DSCClassResources/AzDevOpsProject/AzDevOpsProject.Tests.ps1 b/tests/Unit/DSCClassResources/AzDevOpsProject/AzDevOpsProject.Tests.ps1 index a818a34f6..0decd03ac 100644 --- a/tests/Unit/DSCClassResources/AzDevOpsProject/AzDevOpsProject.Tests.ps1 +++ b/tests/Unit/DSCClassResources/AzDevOpsProject/AzDevOpsProject.Tests.ps1 @@ -31,8 +31,7 @@ InModuleScope 'AzureDevOpsDsc' { 'Pat', 'ProjectId', 'ProjectName', - 'ProjectDescription', - 'SourceControlType' + 'ProjectDescription' ) $testCasesValidPropertyNames = $validPropertyNames | ForEach-Object { @{ @@ -41,6 +40,11 @@ InModuleScope 'AzureDevOpsDsc' { } } + $testCasesValidPropertyNames += @{ + PropertyName = 'SourceControlType' + PropertyValue = 'Git' + } + Context 'When creating a new instance of the class' { It 'Should not throw' {