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

[Fixes] Resource removal stage attempts to remove dependency resources #1780

Merged
merged 1 commit into from
Aug 14, 2022

Conversation

ahmadabdalla
Copy link
Contributor

@ahmadabdalla ahmadabdalla commented Aug 13, 2022

Closes #1781

Closes #1782

Description

Add support for token replacement for the dependency resources during the token replacement step in the deployment. The reason is that the removal step relies on dependency resources parameter files tokens to be replaced, and given that we do not have a value for the localToken_namePrefix, it will be replaced by empty thus impacting dependency resources risk being removed. Replacing the tokens for dependency files before the removal step kicks in guarantees that there are no tokens that need to be swapped

Future feature suggestion:

  • Add support in the 'Test-ModuleLocally' script to allow for resource removal.

Pipeline references

For module/pipeline changes, please create and attach the status badge of your successful run.

Pipeline
RecoveryServices: Vaults
Authorization: PolicyAssignments
ServiceBus: Namespaces
AppConfiguration: ConfigurationStores
Insights: PrivateLinkScopes
DataFactory: Factories

Before

image

After

image

image

ADO

image

image

Type of Change

  • Bugfix (non-breaking change which fixes an issue)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • My corresponding pipelines / checks run clean and green without any errors or warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (readme)
  • I did format my code

@ahmadabdalla ahmadabdalla added bug Something isn't working [prio] high importance of the issue: high priority [cat] pipelines category: pipelines [cat] github category: GitHub [cat] azure devops category: Azure DevOps labels Aug 13, 2022
@ahmadabdalla ahmadabdalla added this to the Release 0.7 milestone Aug 13, 2022
@ahmadabdalla ahmadabdalla added this to Ready for review in Backlog via automation Aug 13, 2022
@github-actions
Copy link

github-actions bot commented Aug 13, 2022

Unit Test Results

    1 files  ±  0      1 suites  ±0   1m 10s ⏱️ +25s
164 tests +77  157 ✔️ +71  7 💤 +7  0  - 1 
165 runs  +77  158 ✔️ +71  7 💤 +7  0  - 1 

Results for commit 974344c. ± Comparison against base commit c05d706.

This pull request removes 87 and adds 164 tests. Note that renamed tests count towards both.
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.ContainerService/managedClusters/agentPools] used resource type [managedClusters/agentPools] should use one of the recent API version(s). Currently using [2021-08-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.ContainerService/managedClusters] used resource type [diagnosticsettings] should use one of the recent API version(s). Currently using [2021-05-01-preview]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.ContainerService/managedClusters] used resource type [locks] should use one of the recent API version(s). Currently using [2017-04-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.ContainerService/managedClusters] used resource type [managedClusters/agentPools] should use one of the recent API version(s). Currently using [2021-08-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.ContainerService/managedClusters] used resource type [managedClusters] should use one of the recent API version(s). Currently using [2022-04-02-preview]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.ContainerService/managedClusters] used resource type [roleassignments] should use one of the recent API version(s). Currently using [2022-04-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.ContainerService/managedClusters/agentPools] All apiVersion properties should be set to a static, hard-coded value
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.ContainerService/managedClusters/agentPools] All non-required parameters in template file should not have description that start with "Required."
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.ContainerService/managedClusters/agentPools] All parameters in parameters files exist in template file (deploy.json)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.ContainerService/managedClusters/agentPools] All required parameters in template file (deploy.json) should exist in parameters files
…
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories/integrationRuntime] used resource type [factories/integrationRuntimes] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories/managedVirtualNetwork/managedPrivateEndpoints] used resource type [factories/managedVirtualNetworks/managedPrivateEndpoints] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories/managedVirtualNetwork] used resource type [factories/managedVirtualNetworks/managedPrivateEndpoints] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories/managedVirtualNetwork] used resource type [factories/managedVirtualNetworks] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories] used resource type [diagnosticsettings] should use one of the recent API version(s). Currently using [2021-05-01-preview]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories] used resource type [factories/integrationRuntimes] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories] used resource type [factories/managedVirtualNetworks/managedPrivateEndpoints] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories] used resource type [factories/managedVirtualNetworks] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories] used resource type [factories] should use one of the recent API version(s). Currently using [2018-06-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DataFactory/factories] used resource type [locks] should use one of the recent API version(s). Currently using [2017-04-01]
…

♻️ This comment has been updated with latest results.

@ahmadabdalla ahmadabdalla marked this pull request as ready for review August 13, 2022 13:13
@ahmadabdalla ahmadabdalla requested a review from a team as a code owner August 13, 2022 13:13
@AlexanderSehr AlexanderSehr changed the title [Bug Fix] Resource removal stage attempts to remove dependency resources [Fixes] Resource removal stage attempts to remove dependency resources Aug 14, 2022
@ahmadabdalla ahmadabdalla merged commit addc027 into main Aug 14, 2022
Backlog automation moved this from Ready for review to Done Aug 14, 2022
@ahmadabdalla ahmadabdalla deleted the users/ahmad/bugFix_resourceRemove branch August 14, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working [cat] azure devops category: Azure DevOps [cat] github category: GitHub [cat] pipelines category: pipelines [prio] high importance of the issue: high priority
Projects
Status: Done
2 participants