Skip to content
Merged
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
39 changes: 33 additions & 6 deletions arm/.global/global.module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,37 @@ Describe 'File/folder tests' -Tag Modules {
$moduleFolderTestCases += @{
moduleFolderName = $moduleFolderPath.Replace('\', '/').Split('/arm/')[1]
moduleFolderPath = $moduleFolderPath
isTopLevelModule = $moduleFolderPath.Replace('\', '/').Split('/arm/')[1].Split('/').Count -eq 2 # <provider>/<resourceType>
}
}

if (Test-Path (Join-Path $repoRoot '.github')) {
It '[<moduleFolderName>] Module should have a GitHub workflow' -TestCases ($moduleFolderTestCases | Where-Object { $_.isTopLevelModule }) {

param(
[string] $moduleFolderName,
[string] $moduleFolderPath
)

$workflowsFolderName = Join-Path $RepoRoot '.github' 'workflows'
$workflowFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()

Test-Path (Join-Path $workflowsFolderName $workflowFileName) | Should -Be $true
}
}

if (Test-Path (Join-Path $repoRoot '.azuredevops')) {
It '[<moduleFolderName>] Module should have an Azure DevOps pipeline' -TestCases ($moduleFolderTestCases | Where-Object { $_.isTopLevelModule }) {

param(
[string] $moduleFolderName,
[string] $moduleFolderPath
)

$pipelinesFolderName = Join-Path $RepoRoot '.azuredevops' 'modulePipelines'
$pipelineFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()

Test-Path (Join-Path $pipelinesFolderName $pipelineFileName) | Should -Be $true
}
}

Expand All @@ -53,13 +84,9 @@ Describe 'File/folder tests' -Tag Modules {
(Test-Path (Join-Path -Path $moduleFolderPath 'readme.md')) | Should -Be $true
}

It '[<moduleFolderName>] Module should contain a [.parameters] folder' -TestCases $moduleFolderTestCases {
It '[<moduleFolderName>] Module should contain a [.parameters] folder' -TestCases ($moduleFolderTestCases | Where-Object { $_.isTopLevelModule }) {
param( [string] $moduleFolderPath )
if ((Split-Path (Split-Path $moduleFolderPath -Parent) -Leaf) -like 'Microsoft.*') {
(Test-Path (Join-Path -Path $moduleFolderPath '.parameters')) | Should -Be $true
} else {
$true | Should -Be $true
}
Test-Path (Join-Path -Path $moduleFolderPath '.parameters') | Should -Be $true
}

It '[<moduleFolderName>] Module should contain a [version.json] file' -TestCases $moduleFolderTestCases {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ The primary pipeline variable file `global.variables.yml` hosts the fundamental

### 3.2.3 Enable actions


Finally, 'GitHub Actions' are disabled by default and must be enabled for execution.

To do so, perform the following steps:
Expand All @@ -229,6 +228,7 @@ For _Azure DevOps_, you have to perform the following environment-specific steps
- [3.2.3 Setup variables file](#323-setup-variables-file)
- [3.2.4 Register pipelines](#324-register-pipelines)
- [3.2.5 Azure Artifacts Universal Packages](#325-azure-artifacts-universal-packages)

### 3.2.1 Setup service connection

The service connection must be set up in the project's settings under _Pipelines: Service connections_ (a step by step guide can be found [here](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml)).
Expand Down Expand Up @@ -329,7 +329,7 @@ This section will explain what is required to publish the modules to [Azure Arti
1. If you chose the feed to be project-scoped, you will need the Project Build Service account to have `Contributor` access to publish to the Azure Artifacts feed. To set this, follow the [Pipeline permission](https://docs.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#pipelines-permissions) steps.

#### Implementation Guidance
Each `./azuredevops/modulePipelines` yaml pipeline already calls `/.azuredevops/pipelineTemplates/jobs.publishModule.yml`. This yaml template contains a method to `Publish module to artifacts feed` via `utilities\pipelines\resourcePublish\Publish-ModuleToUniversalArtifactFeed.ps1`.
Each `./azuredevops/modulePipelines` yaml pipeline already calls `/.azuredevops/pipelineTemplates/jobs.publishModule.yml`. This YAML template contains a method to `Publish module to artifacts feed` via `utilities\pipelines\resourcePublish\Publish-ModuleToUniversalArtifactFeed.ps1`.


</details>
Expand Down
1 change: 0 additions & 1 deletion utilities/tools/Set-ModuleReadMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function Set-ResourceTypesSection {
$_.type -notin $ResourceTypesToExclude -and $_
} | Select-Object 'Type', 'ApiVersion' -Unique | Sort-Object Type -Culture en-US

$TextInfo = (Get-Culture).TextInfo
foreach ($resourceTypeObject in $RelevantResourceTypeObjects) {
$ProviderNamespace, $ResourceType = $resourceTypeObject.Type -split '/', 2
# Validate if Reference URL Is working
Expand Down