From a836a405790d8588d3e309f3679bf4ff0622d4c4 Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 17:39:08 +0000 Subject: [PATCH 01/11] Updated 'Get-AzDevOpsApiWaitTimeoutMs' to return 300000ms (5 minutes). --- .../Api/Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From 8d0970f363f1ee9d439422d0fdcd7f22c9e41454 Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 17:40:04 +0000 Subject: [PATCH 02/11] Updated tests to cater for updated Azure DevOps, API timeout value of 300000ms. --- .../Functions/Private/Get-AzDevOpsApiWaitTimeoutMs.Tests.ps1 | 2 +- .../Functions/Private/Test-AzDevOpsApiTimeoutExceeded.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 = @( From 9966ff121fdce4bde5d7ff35a5d2b0822f4ee75d Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 17:43:25 +0000 Subject: [PATCH 03/11] Updated 'ValidateRange', parameter validation to allow up to 300000ms (5 mins). --- .../Api/Functions/Private/Test-AzDevOpsApiTimeoutExceeded.ps1 | 2 +- .../Api/Functions/Private/Wait-AzDevOpsApiResource.ps1 | 2 +- .../Resources/Functions/Private/Wait-AzDevOpsOperation.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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), From f9fcea30cf9eb03262ebbae55580c88b1e83f34f Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 18:01:08 +0000 Subject: [PATCH 04/11] Updated changelog to include fix for issue #25. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 945605454..3bbf0b893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ 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)). - AzureDevOpsDsc.Common - Added 'wrapper' functionality around the [Azure DevOps REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/) From b7606a4562033e5eb75ccb48ab28337f0b16ab3c Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 18:08:07 +0000 Subject: [PATCH 05/11] Updated contextual help. --- CHANGELOG.md | 1 + source/en-US/about_AzureDevOpsDsc.help.txt | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bbf0b893..36b5143de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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)). - AzureDevOpsDsc.Common - Added 'wrapper' functionality around the [Azure DevOps REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/) 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 From 195fb3de5d822c2c93f84c3a2080885ea70c4618 Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 18:12:03 +0000 Subject: [PATCH 06/11] Removed 'Classes' and 'Examples' from 'build.yaml' --- build.yaml | 2 -- 1 file changed, 2 deletions(-) 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 From f5adcb95c10b7e505007335def2c556c13027904 Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 18:13:06 +0000 Subject: [PATCH 07/11] Updated 'CHANGELOG.md' with issues #10 (removing 'Classes' directory) and #11 (removing 'Examples' directory). --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36b5143de..db72c7d29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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)). - AzureDevOpsDsc.Common - Added 'wrapper' functionality around the [Azure DevOps REST API](https://docs.microsoft.com/en-us/rest/api/azure/devops/) From c224aed97c3cc1b6bfa426062cd98297ceeea1b0 Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 19:13:16 +0000 Subject: [PATCH 08/11] Moved 'Ensure' and 'RequiredAction' enums into 'Enum' directory and out of 'prefix.ps1'. --- source/Enum/Ensure.ps1 | 9 +++++++++ source/Enum/RequiredAction.ps1 | 14 ++++++++++++++ source/prefix.ps1 | 20 -------------------- 3 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 source/Enum/Ensure.ps1 create mode 100644 source/Enum/RequiredAction.ps1 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/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 -} - From 15ba58f3f3b0850b2b129534d721f6b8711f473c Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 19:15:28 +0000 Subject: [PATCH 09/11] Updated 'CHANGELOG.md' to include 'Enum' directory changes (issue #12). --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db72c7d29..122c8f459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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/) From e62fd56b3820f49f0f101f34b3066defc616b220 Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 20:02:36 +0000 Subject: [PATCH 10/11] Added 'SYNOPSIS' into 'DscResourceBase', 'AzDevOpsApiDscResourceBase' and 'AzDevOpsDscResourceBase' classes. --- source/Classes/001.DscResourceBase.ps1 | 4 ++++ source/Classes/002.AzDevOpsApiDscResourceBase.ps1 | 4 ++++ source/Classes/003.AzDevOpsDscResourceBase.ps1 | 11 ++++------- 3 files changed, 12 insertions(+), 7 deletions(-) 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()] From f4ce373ec420d5225672087f59437ba751c34def Mon Sep 17 00:00:00 2001 From: Paul Wilcox Date: Thu, 28 Jan 2021 20:11:48 +0000 Subject: [PATCH 11/11] Added description for 'AzDevOpsProject' resource. --- source/Classes/010.AzDevOpsProject.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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