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

Implemented a first version to allow for custom removal scripts & retry #431

Merged
merged 33 commits into from
Nov 10, 2021

Conversation

AlexanderSehr
Copy link
Contributor

@AlexanderSehr AlexanderSehr commented Nov 6, 2021

Change

  • Implemented a first version to allow for custom removal scripts & retry
  • Moved the removal scripts to utilities to enable reference by non-GitHub pipelines & custom execution
  • Cleaned up pipelines & added reference to custom removal for vWan & netApp
  • Refactored removal scripts to align approaches & reduce code

Tested multiple times with

  • Compute: Virtualmachines
  • NetApp: Netappaccounts
  • Resources: Resourcegroups
  • Network: Virtualwans

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (Wiki)

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

@AlexanderSehr AlexanderSehr enabled auto-merge (squash) November 6, 2021 21:41
@AlexanderSehr AlexanderSehr self-assigned this Nov 6, 2021
@AlexanderSehr AlexanderSehr added [cat] modules category: modules [cat] pipelines category: pipelines [prio] high importance of the issue: high priority bug Something isn't working enhancement New feature or request labels Nov 6, 2021
@AlexanderSehr AlexanderSehr added this to the v 0.3 milestone Nov 6, 2021
@github-actions
Copy link

github-actions bot commented Nov 6, 2021

Unit Test Results

  1 files  ±  0    1 suites  ±0   21s ⏱️ +5s
31 tests +27  31 ✔️ +27  0 💤 ±  0  0 ±0 
39 runs  +  3  31 ✔️ +27  8 💤  - 24  0 ±0 

Results for commit 96e99b7. ± Comparison against base commit 6cd1d7f.

This pull request removes 4 and adds 31 tests. Note that renamed tests count towards both.
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Api version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Network/privateEndpoints] used resource type [locks] should use on of the recent API version(s). Currently using [2016-09-01]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Api version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Network/privateEndpoints] used resource type [privateEndpoints/privateDnsZoneGroups] should use on of the recent API version(s). Currently using [2021-03-01]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Api version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Network/privateEndpoints] used resource type [privateEndpoints] should use on of the recent API version(s). Currently using [2021-03-01]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Api version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Network/privateEndpoints] used resource type [roleassignments] should use on of the recent API version(s). Currently using [2020-04-01-preview]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] All apiVersion properties should be set to a static, hard-coded value
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] All parameters in parameters files exist in template file (deploy.json)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] All required parameters in template file (deploy.json) should exist in parameters files
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] All resources that have a Location property should refer to the Location parameter 'parameters('Location')'
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] CUA ID deployment should be present in the template
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] If delete lock is implemented, the template should have a lock parameter with the default value of [NotSpecified]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] Output names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] Parameter files should not contain subscriptionId original value and but a token string
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] Parameter names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Compute/virtualMachines] Standard outputs should be provided (e.g. resourceName, resourceId, resouceGroupName)
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

@MariusStorhaug MariusStorhaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments. Also:

  • Missing docs on some PowerShell functions.
  • Missing subscription and managementGroup scope for removal (if im not mistaken). (Guess this is for the next version.

utilities/resourceRemoval/Remove-vWan.ps1 Outdated Show resolved Hide resolved
utilities/resourceRemoval/Remove-NetAppAccount.ps1 Outdated Show resolved Hide resolved
utilities/resourceRemoval/Remove-vWan.ps1 Outdated Show resolved Hide resolved
utilities/resourceRemoval/Remove-DeployedModule.ps1 Outdated Show resolved Hide resolved
utilities/resourceRemoval/Remove-DeployedModule.ps1 Outdated Show resolved Hide resolved
@AlexanderSehr AlexanderSehr marked this pull request as draft November 8, 2021 06:20
auto-merge was automatically disabled November 8, 2021 06:20

Pull request was converted to draft

@AlexanderSehr AlexanderSehr marked this pull request as ready for review November 9, 2021 17:06
Copy link
Contributor

@MariusStorhaug MariusStorhaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All comments seem to be solved. Green pipelines which are also a good indicator of working solution. Lets see if this solves our faulty workflows and removal steps! Approved.

@MariusStorhaug MariusStorhaug merged commit 49e0d68 into main Nov 10, 2021
@MariusStorhaug MariusStorhaug deleted the users/alsehr/removalPoC branch November 10, 2021 20:02
ahmadabdalla added a commit that referenced this pull request Nov 10, 2021
* Update Dependency pipeline after child restructure (#448)
* Implemented a first version to allow for custom removal scripts & retry (#431)
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] modules category: modules [cat] pipelines category: pipelines enhancement New feature or request [prio] high importance of the issue: high priority
Projects
None yet
2 participants