diff --git a/CHANGELOG.md b/CHANGELOG.md index 945605454..122c8f459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([issue #1](https://github.com/dsccommunity/AzureDevOpsDsc/issues/1)) - Added the `AzDevOpsProject`, DSC Resource - Fixed non-terminating, integration tests ([issue #18](https://github.com/dsccommunity/AzureDevOpsDsc/issues/18)) + - Increased Azure DevOps, API timeout to 5 minutes to allow for busy/slow API + operations ([issue #25](https://github.com/dsccommunity/AzureDevOpsDsc/issues/25)). + - Updated contextual help ([issue #5](https://github.com/dsccommunity/AzureDevOpsDsc/issues/5)). + - Removed `Classes` directory from being output in packaged module ([issue #10](https://github.com/dsccommunity/AzureDevOpsDsc/issues/10)). + - 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)). - AzureDevOpsDsc.Common - Added 'wrapper' functionality around the [Azure DevOps REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/) diff --git a/build.yaml b/build.yaml index ceb932b0f..fae560882 100644 --- a/build.yaml +++ b/build.yaml @@ -3,9 +3,7 @@ # ModuleBuilder Configuration # #################################################### CopyPaths: - - Classes - en-US - - Examples - Modules Encoding: UTF8 VersionedOutputDirectory: true diff --git a/source/Classes/001.DscResourceBase.ps1 b/source/Classes/001.DscResourceBase.ps1 index 4dd52ddf4..9f9e9e33b 100644 --- a/source/Classes/001.DscResourceBase.ps1 +++ b/source/Classes/001.DscResourceBase.ps1 @@ -1,3 +1,7 @@ +<# + .SYNOPSIS + Defines a base class from which other DSC resources inherit from. +#> class DscResourceBase { hidden [System.String]GetDscResourceKey() diff --git a/source/Classes/002.AzDevOpsApiDscResourceBase.ps1 b/source/Classes/002.AzDevOpsApiDscResourceBase.ps1 index e39dd5e3c..191cd9721 100644 --- a/source/Classes/002.AzDevOpsApiDscResourceBase.ps1 +++ b/source/Classes/002.AzDevOpsApiDscResourceBase.ps1 @@ -1,3 +1,7 @@ +<# + .SYNOPSIS + Defines a base class from which other DSC resources that use the AzureDevOps API inherit from. +#> class AzDevOpsApiDscResourceBase : DscResourceBase { [System.String]$ResourceName = $this.GetResourceName() diff --git a/source/Classes/003.AzDevOpsDscResourceBase.ps1 b/source/Classes/003.AzDevOpsDscResourceBase.ps1 index aa7bf4593..ccfa36b98 100644 --- a/source/Classes/003.AzDevOpsDscResourceBase.ps1 +++ b/source/Classes/003.AzDevOpsDscResourceBase.ps1 @@ -1,10 +1,7 @@ -# This enum is re-defined here so it is recognised by 'Import-DscResource' (which won't pre/post-parse the 'using' statements) -#enum Ensure -#{ -# Present -# Absent -#} - +<# + .SYNOPSIS + Defines a base class from which other AzureDevOps DSC resources inherit from. +#> class AzDevOpsDscResourceBase : AzDevOpsApiDscResourceBase { [DscProperty()] diff --git a/source/Classes/010.AzDevOpsProject.ps1 b/source/Classes/010.AzDevOpsProject.ps1 index 79f493079..5c9a2af83 100644 --- a/source/Classes/010.AzDevOpsProject.ps1 +++ b/source/Classes/010.AzDevOpsProject.ps1 @@ -1,3 +1,21 @@ +<# + .SYNOPSIS + A DSC Resource for Azure DevOps that represents the 'Project' resource. + + .PARAMETER ProjectId + The 'Id' of the Azure DevOps, 'Project' resource. + + .PARAMETER ProjectName + The 'Name' of the Azure DevOps, 'Project' resource. + + .PARAMETER ProjectDescription + The 'Description' of the Azure DevOps, 'Project' resource. + + .PARAMETER SourceControlType + The 'SourceControlType' of the Azure DevOps, 'Project' resource. Valid options are 'Git' and 'Tfvc'. + + If the 'Project' resource already exists in Azure DevOps, the 'SourceControlType' cannot be changed to another type. +#> [DscResource()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSDSCStandardDSCFunctionsInResource', '', Justification='Test() and Set() method are inherited from base, "AzDevOpsDscResourceBase" class')] class AzDevOpsProject : AzDevOpsDscResourceBase diff --git a/source/Enum/Ensure.ps1 b/source/Enum/Ensure.ps1 new file mode 100644 index 000000000..5f59d0d54 --- /dev/null +++ b/source/Enum/Ensure.ps1 @@ -0,0 +1,9 @@ +<# + .SYNOPSIS + Defines whether the DSC resource should be Present or Absent. +#> +enum Ensure +{ + Present + Absent +} diff --git a/source/Enum/RequiredAction.ps1 b/source/Enum/RequiredAction.ps1 new file mode 100644 index 000000000..2db39674c --- /dev/null +++ b/source/Enum/RequiredAction.ps1 @@ -0,0 +1,14 @@ +<# + .SYNOPSIS + Defines the `RequiredAction` of the DSC resource. +#> +enum RequiredAction +{ + None + Get + New + Set + Remove + Test + Error +} diff --git a/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.ps1 b/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.ps1 index 3e8dec726..ff7bc590e 100644 --- a/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.ps1 +++ b/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.ps1 @@ -15,5 +15,5 @@ function Get-AzDevOpsApiWaitTimeoutMs [OutputType([Int32])] param () - return 10000 + return 300000 } diff --git a/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.ps1 b/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.ps1 index 29f986c11..998dcfeaf 100644 --- a/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.ps1 +++ b/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.ps1 @@ -42,7 +42,7 @@ function Test-AzDevOpsApiTimeoutExceeded $EndTime, [Parameter(Mandatory = $true)] - [ValidateRange(250,10000)] + [ValidateRange(250,300000)] [Int32] $TimeoutMs ) diff --git a/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Wait-AzDevOpsApiResource.ps1 b/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Wait-AzDevOpsApiResource.ps1 index 3ab7de4fb..eb5de524f 100644 --- a/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Wait-AzDevOpsApiResource.ps1 +++ b/source/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Wait-AzDevOpsApiResource.ps1 @@ -94,7 +94,7 @@ function Wait-AzDevOpsApiResource $WaitIntervalMilliseconds = $(Get-AzDevOpsApiWaitIntervalMs), [Parameter()] - [ValidateRange(250,10000)] + [ValidateRange(250,300000)] [Alias('Timeout','TimeoutMilliseconds')] [System.Int32] $WaitTimeoutMilliseconds = $(Get-AzDevOpsApiWaitTimeoutMs), diff --git a/source/Modules/AzureDevOpsDsc.Common/Resources/Functions/Private/Wait-AzDevOpsOperation.ps1 b/source/Modules/AzureDevOpsDsc.Common/Resources/Functions/Private/Wait-AzDevOpsOperation.ps1 index ff8ae7cad..1fa4916bf 100644 --- a/source/Modules/AzureDevOpsDsc.Common/Resources/Functions/Private/Wait-AzDevOpsOperation.ps1 +++ b/source/Modules/AzureDevOpsDsc.Common/Resources/Functions/Private/Wait-AzDevOpsOperation.ps1 @@ -75,7 +75,7 @@ function Wait-AzDevOpsOperation $WaitIntervalMilliseconds = $(Get-AzDevOpsApiWaitIntervalMs), [Parameter()] - [ValidateRange(250,10000)] + [ValidateRange(250,300000)] [Alias('Timeout','TimeoutMilliseconds')] [System.Int32] $WaitTimeoutMilliseconds = $(Get-AzDevOpsApiWaitTimeoutMs), diff --git a/source/en-US/about_AzureDevOpsDsc.help.txt b/source/en-US/about_AzureDevOpsDsc.help.txt index c7ef9edf4..a0ebc823f 100644 --- a/source/en-US/about_AzureDevOpsDsc.help.txt +++ b/source/en-US/about_AzureDevOpsDsc.help.txt @@ -2,23 +2,24 @@ TOPIC about_AzureDevOpsDsc SHORT DESCRIPTION - DSC Resources for deployment and configuration of Azure DevOps and Azure DevOps Server. + DSC Resources for deployment and configuration of Azure DevOps Services and Azure DevOps Server. LONG DESCRIPTION - This module contains DSC Resources for deployment and configuration of Azure DevOps and Azure DevOps Server. + This module contains DSC Resources for deployment and configuration of Azure DevOps Services and Azure DevOps Server. EXAMPLES - PS C:\> {{ add examples here }} + PS C:\> Get-DscResource -Module AzureDevOpsDsc NOTE: Thank you to all those who contributed to this module, by writing code, sharing opinions, and provided feedback. TROUBLESHOOTING NOTE: - Look out on the Github repository for issues and new releases. + Go to the Github repository for read about issues, submit a new issue, and read + about new releases. https://github.com/dsccommunity/AzureDevOpsDsc SEE ALSO - - {{ Please add Project URI such as github }}} + - https://github.com/dsccommunity/AzureDevOpsDsc KEYWORDS - {{ Add coma separated keywords here }} + DSC, DscResource, AzureDevOps, VSTS, TFS diff --git a/source/prefix.ps1 b/source/prefix.ps1 index 6e3108d3d..6f68e81ce 100644 --- a/source/prefix.ps1 +++ b/source/prefix.ps1 @@ -7,23 +7,3 @@ Import-Module -Name $script:azureDevOpsDscCommonModulePath # Define localization data $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' - - -# Define 'enums' for module -enum Ensure -{ - Present - Absent -} - -enum RequiredAction -{ - None - Get - New - Set - Remove - Test - Error -} - diff --git a/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.Tests.ps1 b/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.Tests.ps1 index 3d2df3ff4..6f92ad0ab 100644 --- a/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.Tests.ps1 +++ b/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.Tests.ps1 @@ -18,7 +18,7 @@ InModuleScope 'AzureDevOpsDsc.Common' { Describe "$script:subModuleName\Api\Function\$script:commandName" -Tag $script:tag { - [Int32]$expectedWaitTimeoutMs = 10000 + [Int32]$expectedWaitTimeoutMs = 300000 Context 'When input parameters are valid' { diff --git a/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.Tests.ps1 b/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.Tests.ps1 index 36c3088d9..c23ef1c10 100644 --- a/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.Tests.ps1 +++ b/tests/Unit/Modules/AzureDevOpsDsc.Common/Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.Tests.ps1 @@ -57,7 +57,7 @@ InModuleScope 'AzureDevOpsDsc.Common' { @{ StartTime = [DateTime]::new(2020,11,12, 09,35,00, 0) EndTime = [DateTime]::new(2021,11,12, 09,35,00, 0) # 1 year longer than timeout - TimeoutMs = 10000 + TimeoutMs = 300000 } ) $testCasesTimeoutNotExceeded = @(