From 3e0c69e3b9ce1e4a108e900cf38557e38ab13e56 Mon Sep 17 00:00:00 2001 From: Erika Gressi <56914614+eriqua@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:34:59 +0200 Subject: [PATCH 1/2] fix: Align platform workflow file names (#1754) ## Description Renaming 2 leftover platform workflows to aligned convention Updating references in comments and env vars ## Pipeline Reference | Pipeline | | -------- | | | ## Type of Change - [x] Update to CI Environment or utlities (Non-module effecting changes) - [ ] Azure Verified Module updates: - [ ] Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [x] I'm sure there are no other open Pull Requests for the same update/change - [ ] I have run `Set-AVMModule` locally to generate the supporting module files. - [ ] My corresponding pipelines / checks run clean and green without any errors or warnings --- .github/workflows/platform.check.psrule.yml | 2 +- ...le-index-json.yml => platform.publish-module-index-json.yml} | 0 ...-avm-modules-list.yml => platform.sync-avm-modules-list.yml} | 0 .../pipelines/platform/Set-AvmGitHubIssueOwnerConfig.ps1 | 2 +- .../pipelines/platform/Set-AvmGithubIssueForWorkflow.ps1 | 2 +- avm/utilities/pipelines/platform/Sync-AvmModulesList.ps1 | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{avm.platform.publish-module-index-json.yml => platform.publish-module-index-json.yml} (100%) rename .github/workflows/{avm.platform.sync-avm-modules-list.yml => platform.sync-avm-modules-list.yml} (100%) diff --git a/.github/workflows/platform.check.psrule.yml b/.github/workflows/platform.check.psrule.yml index 9c608959440..c0a294a0a26 100644 --- a/.github/workflows/platform.check.psrule.yml +++ b/.github/workflows/platform.check.psrule.yml @@ -24,7 +24,7 @@ on: - cron: "0 12 * * 0" # Weekly Sunday Analysis env: - workflowPath: ".github/workflows/avm.platform.check.psrule.yml" + workflowPath: ".github/workflows/platform.check.psrule.yml" targetPath: "avm/res/" PSRuleOutputFilePath: "avm/res/PSRule-output.csv" PSRuleInputFilePath: "avm/res/PSRule-output.md" diff --git a/.github/workflows/avm.platform.publish-module-index-json.yml b/.github/workflows/platform.publish-module-index-json.yml similarity index 100% rename from .github/workflows/avm.platform.publish-module-index-json.yml rename to .github/workflows/platform.publish-module-index-json.yml diff --git a/.github/workflows/avm.platform.sync-avm-modules-list.yml b/.github/workflows/platform.sync-avm-modules-list.yml similarity index 100% rename from .github/workflows/avm.platform.sync-avm-modules-list.yml rename to .github/workflows/platform.sync-avm-modules-list.yml diff --git a/avm/utilities/pipelines/platform/Set-AvmGitHubIssueOwnerConfig.ps1 b/avm/utilities/pipelines/platform/Set-AvmGitHubIssueOwnerConfig.ps1 index 3ef36379720..ca3c75b4544 100644 --- a/avm/utilities/pipelines/platform/Set-AvmGitHubIssueOwnerConfig.ps1 +++ b/avm/utilities/pipelines/platform/Set-AvmGitHubIssueOwnerConfig.ps1 @@ -18,7 +18,7 @@ Mandatory. The URL of the GitHub issue, like 'https://github.com/Azure/bicep-reg Set-AvmGitHubIssueOwnerConfig -Repo 'Azure/bicep-registry-modules' -IssueUrl 'https://github.com/Azure/bicep-registry-modules/issues/757' .NOTES -Will be triggered by the workflow avm.platform.set-avm-github-issue-owner-config.yml +Will be triggered by the workflow platform.set-avm-github-issue-owner-config.yml #> function Set-AvmGitHubIssueOwnerConfig { [CmdletBinding(SupportsShouldProcess)] diff --git a/avm/utilities/pipelines/platform/Set-AvmGithubIssueForWorkflow.ps1 b/avm/utilities/pipelines/platform/Set-AvmGithubIssueForWorkflow.ps1 index fed872e51d1..08e3cab020f 100644 --- a/avm/utilities/pipelines/platform/Set-AvmGithubIssueForWorkflow.ps1 +++ b/avm/utilities/pipelines/platform/Set-AvmGithubIssueForWorkflow.ps1 @@ -26,7 +26,7 @@ Set-AvmGithubIssueForWorkflow -Repo 'owner/repo01' -LimitNumberOfRuns 100 -Limit Check the last 100 workflow runs in the repository 'owner/repo01' that happened in the last 2 days. If the workflow name is 'Pipeline 01', then ignore the workflow run. .NOTES -Will be triggered by the workflow avm.platform.manage-workflow-issue.yml +Will be triggered by the workflow platform.manage-workflow-issue.yml #> function Set-AvmGithubIssueForWorkflow { [CmdletBinding(SupportsShouldProcess)] diff --git a/avm/utilities/pipelines/platform/Sync-AvmModulesList.ps1 b/avm/utilities/pipelines/platform/Sync-AvmModulesList.ps1 index 7cdfa21e8db..7a2af595fa9 100644 --- a/avm/utilities/pipelines/platform/Sync-AvmModulesList.ps1 +++ b/avm/utilities/pipelines/platform/Sync-AvmModulesList.ps1 @@ -15,7 +15,7 @@ Optional. Path to the root of the repository. Sync-AvmModulesList -Repo 'Azure/bicep-registry-modules' .NOTES -Will be triggered by the workflow avm.platform.sync-avm-modules-list.yml +Will be triggered by the workflow platform.sync-avm-modules-list.yml #> function Sync-AvmModulesList { param ( From a89a3eeda81a80b2af1f5f91dfe74522fb6ba0a9 Mon Sep 17 00:00:00 2001 From: Yas Date: Fri, 26 Apr 2024 08:42:38 +1000 Subject: [PATCH 2/2] fix: SQL Instance Pool - hard coding location of tests to make sure pipeline succeeds (#1748) ## Description Since we had to disable resource deletion on tests to false, we're hard coding the location to make sure consequent deployments pass. Fixes #1744 Closes #1744 ## Pipeline Reference | Pipeline | | -------- | | [![avm.res.sql.instance-pool](https://github.com/yashints/bicep-registry-modules/actions/workflows/avm.res.sql.instance-pool.yml/badge.svg)](https://github.com/yashints/bicep-registry-modules/actions/workflows/avm.res.sql.instance-pool.yml) | ## Type of Change - [ ] Update to CI Environment or utlities (Non-module effecting changes) - [x] Azure Verified Module updates: - [ ] Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [x] I'm sure there are no other open Pull Requests for the same update/change - [x] I have run `Set-AVMModule` locally to generate the supporting module files. - [x] My corresponding pipelines / checks run clean and green without any errors or warnings --- .github/workflows/avm.res.sql.instance-pool.yml | 1 + .../tests/e2e/defaults/main.test.bicep | 14 +++++++++----- .../tests/e2e/waf-aligned/main.test.bicep | 14 +++++++++----- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/avm.res.sql.instance-pool.yml b/.github/workflows/avm.res.sql.instance-pool.yml index 75f61038646..659c39b82a4 100644 --- a/.github/workflows/avm.res.sql.instance-pool.yml +++ b/.github/workflows/avm.res.sql.instance-pool.yml @@ -18,6 +18,7 @@ on: removeDeployment: type: boolean description: "Remove deployed module" + # We had to set this to false because the SQL Instance Pool takes more than 24 hours to get deleted required: false default: false push: diff --git a/avm/res/sql/instance-pool/tests/e2e/defaults/main.test.bicep b/avm/res/sql/instance-pool/tests/e2e/defaults/main.test.bicep index 677a80dbe17..3e801241ffb 100644 --- a/avm/res/sql/instance-pool/tests/e2e/defaults/main.test.bicep +++ b/avm/res/sql/instance-pool/tests/e2e/defaults/main.test.bicep @@ -12,6 +12,7 @@ metadata description = 'This instance deploys the module with the minimum set of param resourceGroupName string = 'dep-${namePrefix}-sql.instancepool-${serviceShort}-rg' @description('Optional. The location to deploy resources to.') +#disable-next-line no-unused-params // A rotation location cannot be used for this test as the SQL Instance Pool deletion is not possible in the same deployment param resourceLocation string = deployment().location @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') @@ -21,6 +22,9 @@ param serviceShort string = 'sipmin' @description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.') param namePrefix string = '#_namePrefix_#' +@description('Optional. The static location of the resource group & resources.') // Note, we set the location of the SQL Instance Pool to avoid conflicts with the already existing ones +param tempLocation string = 'uksouth' + // ============ // // Dependencies // // ============ // @@ -29,12 +33,12 @@ param namePrefix string = '#_namePrefix_#' // ================= resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { name: resourceGroupName - location: resourceLocation + location: tempLocation } module nestedDependencies 'dependencies.bicep' = { scope: resourceGroup - name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies' + name: '${uniqueString(deployment().name, tempLocation)}-nestedDependencies' params: { virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}' managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}' @@ -42,7 +46,7 @@ module nestedDependencies 'dependencies.bicep' = { nsgName: 'dep-${namePrefix}-nsg-${serviceShort}' routeTableName: 'dep-${namePrefix}-rt-${serviceShort}' sqlInstancePoolName: '${namePrefix}${serviceShort}001' - location: resourceLocation + location: tempLocation } } @@ -52,10 +56,10 @@ module nestedDependencies 'dependencies.bicep' = { module testDeployment '../../../main.bicep' = { scope: resourceGroup - name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}' + name: '${uniqueString(deployment().name, tempLocation)}-test-${serviceShort}' params: { name: nestedDependencies.outputs.sqlInstancePoolName - location: resourceLocation + location: tempLocation subnetResourceId: nestedDependencies.outputs.subnetId } } diff --git a/avm/res/sql/instance-pool/tests/e2e/waf-aligned/main.test.bicep b/avm/res/sql/instance-pool/tests/e2e/waf-aligned/main.test.bicep index ffaa2072710..943e45acec1 100644 --- a/avm/res/sql/instance-pool/tests/e2e/waf-aligned/main.test.bicep +++ b/avm/res/sql/instance-pool/tests/e2e/waf-aligned/main.test.bicep @@ -12,6 +12,7 @@ metadata description = 'This instance deploys the module in alignment with the b param resourceGroupName string = 'dep-${namePrefix}-sql.instancepool-${serviceShort}-rg' @description('Optional. The location to deploy resources to.') +#disable-next-line no-unused-params // A rotation location cannot be used for this test as the SQL Instance Pool deletion is not possible in the same deployment param resourceLocation string = deployment().location @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') @@ -21,6 +22,9 @@ param serviceShort string = 'sipwaf' @description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.') param namePrefix string = '#_namePrefix_#' +@description('Optional. The static location of the resource group & resources.') // Note, we set the location of the SQL Instance Pool to avoid conflicts with the already existing ones +param tempLocation string = 'northeurope' + // ============ // // Dependencies // // ============ // @@ -29,12 +33,12 @@ param namePrefix string = '#_namePrefix_#' // ================= resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { name: resourceGroupName - location: resourceLocation + location: tempLocation } module nestedDependencies 'dependencies.bicep' = { scope: resourceGroup - name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies' + name: '${uniqueString(deployment().name, tempLocation)}-nestedDependencies' params: { virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}' managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}' @@ -42,7 +46,7 @@ module nestedDependencies 'dependencies.bicep' = { nsgName: 'dep-${namePrefix}-nsg-${serviceShort}' routeTableName: 'dep-${namePrefix}-rt-${serviceShort}' sqlInstancePoolName: '${namePrefix}${serviceShort}001' - location: resourceLocation + location: tempLocation } } @@ -52,10 +56,10 @@ module nestedDependencies 'dependencies.bicep' = { module testDeployment '../../../main.bicep' = { scope: resourceGroup - name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}' + name: '${uniqueString(deployment().name, tempLocation)}-test-${serviceShort}' params: { name: nestedDependencies.outputs.sqlInstancePoolName - location: resourceLocation + location: tempLocation skuName: 'GP_Gen8IM' subnetResourceId: nestedDependencies.outputs.subnetId }