Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modules] [BPR alignment] Remove Microsoft. prefix and rename README.md files - part 1/2 #3165

Merged
merged 65 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
535f3ca
rename folder and pipeline
eriqua Mar 25, 2023
d765e5b
set module readme and readme
eriqua Mar 25, 2023
57ef60d
gh workflow name
eriqua Mar 25, 2023
d3d8320
ado pipeline
eriqua Mar 26, 2023
89c88d3
support both
eriqua Mar 29, 2023
b806e03
merge late3st
eriqua May 4, 2023
af1fb90
update cross reference pester test
eriqua May 4, 2023
b2c3ba8
remove renamed folder
eriqua May 4, 2023
7c8e9e3
cleanup
eriqua May 4, 2023
643982e
old folder
eriqua May 4, 2023
0070151
rename rp and readme rename
eriqua May 4, 2023
7c369d1
rename avd module files
eriqua May 5, 2023
e274e3b
replace avd module references
eriqua May 5, 2023
76e1a3a
merge latest
eriqua May 5, 2023
800b969
ms prefix workflows avd
eriqua May 5, 2023
f9b7307
readme in tests
eriqua May 5, 2023
621e40d
foldername workflows avd
eriqua May 5, 2023
2c3b9d7
foldername avd
eriqua May 5, 2023
f2d2a58
foldername avdback
eriqua May 5, 2023
6171110
foldername workflows avd sp
eriqua May 5, 2023
d4df88b
foldername workflows avd sp back
eriqua May 5, 2023
a2d1b19
foldername workflows avd hp
eriqua May 5, 2023
e630746
foldername workflows avd hp back
eriqua May 5, 2023
fa84d51
foldername hp
eriqua May 5, 2023
09a6c56
foldername hp back
eriqua May 5, 2023
4906e29
fix leftover
eriqua May 6, 2023
cc5c2c4
temp pester
eriqua May 8, 2023
01799be
temp pester else
eriqua May 8, 2023
05de06d
temp pester else out
eriqua May 8, 2023
957b477
temp pester else out
eriqua May 8, 2023
2b9cb80
call set-modulereadme
eriqua May 8, 2023
5ebd698
readme utilities
eriqua May 8, 2023
f043a60
readme docs
eriqua May 8, 2023
96ba317
update avd readme
eriqua May 8, 2023
bee8fe7
storage module
eriqua May 8, 2023
327729d
storage workflow
eriqua May 8, 2023
c6656c8
network module
eriqua May 8, 2023
f006588
network module ref
eriqua May 8, 2023
76e103f
pester cleanup
eriqua May 8, 2023
96bd72d
authorization namespace
eriqua May 8, 2023
f223b41
authorization workflow
eriqua May 8, 2023
f0b2a71
authorization pipelines
eriqua May 8, 2023
04f0615
authorization workflow 2
eriqua May 8, 2023
d2343e5
remove comments
eriqua May 8, 2023
5275f15
update ado docs
eriqua May 8, 2023
4475d41
update gh readme comments
eriqua May 8, 2023
2231890
update gh docs
eriqua May 8, 2023
75627e9
update gh readme comments
eriqua May 8, 2023
31abd68
update docs
eriqua May 8, 2023
d14568b
update policyassignments
eriqua May 8, 2023
df4d055
update set module readme
eriqua May 8, 2023
48c30b0
update ado pipelines avd storage
eriqua May 8, 2023
ee5e1d1
Remove Microsoft prefix from all modules
eriqua May 8, 2023
03aad54
Update utilities/pipelines/staticValidation/module.tests.ps1
eriqua May 9, 2023
2618810
Update utilities/pipelines/staticValidation/module.tests.ps1
eriqua May 9, 2023
5bcb587
Update utilities/pipelines/staticValidation/module.tests.ps1
eriqua May 9, 2023
59c91f3
Update utilities/pipelines/staticValidation/module.tests.ps1
eriqua May 9, 2023
c276f10
Remove other Microsoft prefix occurrences from docs
eriqua May 9, 2023
1f55aff
temp publish test
eriqua May 9, 2023
c51f159
temp remove storage lock
eriqua May 9, 2023
e98eb4a
revert temp remove storage lock
eriqua May 9, 2023
da6f370
update hp version
eriqua May 9, 2023
a23ecb2
remove microsoft. occurrences
eriqua May 9, 2023
fb46e05
revert temp changes
eriqua May 9, 2023
f81b6fb
remove microsoft. occurrences from ts references
eriqua May 9, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trigger:
include:
- '/.azuredevops/modulePipelines/ms.desktopvirtualization.applicationgroups.yml'
- '/.azuredevops/pipelineTemplates/*.yml'
- '/modules/Microsoft.DesktopVirtualization/applicationgroups/*'
- '/modules/desktop-virtualization/application-groups/*'
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
- '/utilities/pipelines/*'
exclude:
- '/utilities/pipelines/deploymentRemoval/*'
Expand All @@ -39,7 +39,7 @@ variables:
- template: '../../settings.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/modules/Microsoft.DesktopVirtualization/applicationgroups'
value: '/modules/desktop-virtualization/application-groups'

stages:
- template: /.azuredevops/pipelineTemplates/stages.module.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ on:
- '.github/actions/templates/**'
- '.github/workflows/template.module.yml'
- '.github/workflows/ms.desktopvirtualization.applicationgroups.yml'
- 'modules/Microsoft.DesktopVirtualization/applicationgroups/**'
- 'modules/desktop-virtualization/application-groups/**'
- 'utilities/pipelines/**'
- '!utilities/pipelines/deploymentRemoval/**'
- '!*/**/readme.md'

env:
modulePath: 'modules/Microsoft.DesktopVirtualization/applicationgroups'
modulePath: 'modules/desktop-virtualization/application-groups'
workflowPath: '.github/workflows/ms.desktopvirtualization.applicationgroups.yml'

concurrency:
Expand Down
21 changes: 17 additions & 4 deletions utilities/pipelines/staticValidation/module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ Describe 'File/folder tests' -Tag 'Modules' {

Context 'General module folder tests' {

$moduleFolderTestCases = [System.Collections.ArrayList] @()
foreach ($moduleFolderPath in $moduleFolderPaths) {
$moduleFolderTestCases += @{
moduleFolderName = $moduleFolderPath.Replace('\', '/').Split('/modules/')[1]
moduleFolderPath = $moduleFolderPath
isTopLevelModule = $moduleFolderPath.Replace('\', '/').Split('/modules/')[1].Split('/').Count -eq 2 # <provider>/<resourceType>
}
}

It '[<moduleFolderName>] Module should contain a [` deploy.json ` / ` deploy.bicep `] file.' -TestCases $moduleFolderTestCases {

param( [string] $moduleFolderPath )
Expand Down Expand Up @@ -158,7 +167,8 @@ Describe 'Pipeline tests' -Tag 'Pipeline' {
)

$workflowsFolderName = Join-Path $repoRootPath '.github' 'workflows'
$workflowFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
$workflowFileName = 'ms.{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('-', '').ToLower()
# $workflowFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
$workflowPath = Join-Path $workflowsFolderName $workflowFileName
Test-Path $workflowPath | Should -Be $true -Because "path [$workflowPath] should exist."
}
Expand All @@ -178,7 +188,8 @@ Describe 'Pipeline tests' -Tag 'Pipeline' {
}

$workflowsFolderName = Join-Path $repoRootPath '.github' 'workflows'
$workflowFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
# $workflowFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
$workflowFileName = 'ms.{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('-', '').ToLower()
$workflowFilePath = Join-Path $workflowsFolderName $workflowFileName
$workflowContent = Get-Content -Path $workflowFilePath

Expand Down Expand Up @@ -227,7 +238,8 @@ Describe 'Pipeline tests' -Tag 'Pipeline' {
)

$pipelinesFolderName = Join-Path $repoRootPath '.azuredevops' 'modulePipelines'
$pipelineFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
# $pipelineFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
eriqua marked this conversation as resolved.
Show resolved Hide resolved
$pipelineFileName = 'ms.{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('-', '').ToLower()
$pipelinePath = Join-Path $pipelinesFolderName $pipelineFileName
Test-Path $pipelinePath | Should -Be $true -Because "path [$pipelinePath] should exist."
}
Expand All @@ -247,7 +259,8 @@ Describe 'Pipeline tests' -Tag 'Pipeline' {
}

$pipelinesFolderName = Join-Path $repoRootPath '.azuredevops' 'modulePipelines'
$pipelineFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
# $pipelineFileName = '{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('Microsoft', 'ms').ToLower()
eriqua marked this conversation as resolved.
Show resolved Hide resolved
$pipelineFileName = 'ms.{0}.yml' -f $moduleFolderName.Replace('\', '/').Replace('/', '.').Replace('-', '').ToLower()
$pipelineFilePath = Join-Path $pipelinesFolderName $pipelineFileName
$pipelineContent = Get-Content -Path $pipelineFilePath

Expand Down
16 changes: 14 additions & 2 deletions utilities/tools/Set-ModuleReadMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,8 @@ function Set-DeploymentExamplesSection {
' >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.',
''
)
# Get module relative path to provide to module references in Deployment Examples
$moduleRelative = $moduleRoot.Replace('\', '/').split('modules/')[1]

# Get resource type and make first letter upper case. Requires manual handling as ToTitleCase lowercases everything but the first letter
$providerNamespace = ($fullModuleIdentifier.Split('/')[0] -split '\.' | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }) -join '.'
Expand Down Expand Up @@ -991,7 +993,8 @@ function Set-DeploymentExamplesSection {

# [3/6] Format header, remove scope property & any empty line
$rawBicepExample = $rawBicepExampleString -split '\n'
$rawBicepExample[0] = "module $resourceType './$FullModuleIdentifier/deploy.bicep' = {"
$rawBicepExample[0] = "module $resourceType './$moduleRelative/deploy.bicep' = {"
# $rawBicepExample[0] = "module $resourceType './$FullModuleIdentifier/deploy.bicep' = {"
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
$rawBicepExample = $rawBicepExample | Where-Object { $_ -notmatch 'scope: *' } | Where-Object { -not [String]::IsNullOrEmpty($_) }

# [4/6] Extract param block
Expand Down Expand Up @@ -1475,7 +1478,16 @@ function Set-ModuleReadMe {
}

$moduleRoot = Split-Path $TemplateFilePath -Parent
$fullModuleIdentifier = 'Microsoft.{0}' -f $moduleRoot.Replace('\', '/').split('/Microsoft.')[1]
$moduleRelative = $moduleRoot.Replace('\', '/').split('modules/')[1]
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
$splitHyphens = $moduleRelative.split('-')
$splitHyphens = $splitHyphens | ForEach-Object { $_.substring(0, 1).toupper() + $_.substring(1) }
$splitHyphens = $splitHyphens -join ''
# If willing to support both naming
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
if ($splitHyphens -match '^Microsoft\.(.)*') {
$fullModuleIdentifier = '{0}' -f $splitHyphens.Replace('-', '')
} else {
$fullModuleIdentifier = 'Microsoft.{0}' -f $splitHyphens.Replace('-', '')
}

# Check readme
if (-not (Test-Path $ReadMeFilePath) -or ([String]::IsNullOrEmpty((Get-Content $ReadMeFilePath -Raw)))) {
Expand Down