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

Update Azure DevTest Lab API to "2018-10-15-preview" #2523

Merged
merged 16 commits into from
Jan 4, 2023

Conversation

ahmadabdalla
Copy link
Contributor

Description

On the back of #2518

  • Updated the parent module 'lab' to the latest API (2018-10-15-preview). And added the available properties and features.
    • note: the latest API version introduces system assigned identity, hence it's either a system assigned or both system and user, but not NONE like other resources.

image

See documentation for more details

  • Added a custom logic in the removal script dedicated for DevTest Lab use case:

    • DTL creates its own locks on resources, specifically on the virtual network and dependency storage account. When the DTL resource is removed, the lock on the VNET gets removed, but leaves it on the storage account, thus impacting the removal process. Added logic to detect locks created by DTL and only remove those as they are not provisioned by the templates, but by the DTL service.
  • Added cost child module.

  • Updated notification channel child resource - name to have allowed names: autoshutdown, costThreshold, as per the API documentation examples:

Pipeline references

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

Pipeline
DevTestLab: Labs

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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 enhancement New feature or request [cat] modules category: modules labels Jan 4, 2023
@ahmadabdalla ahmadabdalla added this to the Release v0.9.0 milestone Jan 4, 2023
@ahmadabdalla ahmadabdalla self-assigned this Jan 4, 2023
@github-actions
Copy link

github-actions bot commented Jan 4, 2023

Test Results

    1 files  ±    0      1 suites  ±0   1m 44s ⏱️ + 1m 23s
274 tests +227  267 ✔️ +221  7 💤 +6  0 ±0 
281 runs  +227  273 ✔️ +221  8 💤 +6  0 ±0 

Results for commit f9cbf69. ± Comparison against base commit 254a756.

This pull request removes 47 and adds 274 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.Consumption/budgets] used resource type [budgets] should use one of the recent API version(s). Currently using [2021-10-01]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Consumption/budgets] 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.Consumption/budgets] 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.Consumption/budgets] 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.Consumption/budgets] All required parameters in template file (deploy.json) should exist in parameters files
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Consumption/budgets] CUA ID deployment should be present in the template
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Consumption/budgets] Conditional parameters' description should contain 'Required if' followed by the condition making the parameter required.
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Consumption/budgets] If delete lock is implemented, the template should have a lock parameter with the default value of ['']
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Consumption/budgets] Location output should be returned for resources that use it
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Consumption/budgets] Output names should be camel-cased (no dashes or underscores and must start with lower-case letter)
…
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs/artifactSources] used resource type [labs/artifactsources] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs/costs] used resource type [labs/costs] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs/notificationChannels] used resource type [labs/notificationchannels] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs/policySets/policies] used resource type [labs/policysets/policies] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs/schedules] used resource type [labs/schedules] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs/virtualNetworks] used resource type [labs/virtualnetworks] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs] used resource type [labs/artifactsources] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs] used resource type [labs/costs] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs] used resource type [labs/notificationchannels] should use one of the recent API version(s). Currently using [2018-09-15]
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.DevTestLab/labs] used resource type [labs/policysets/policies] should use one of the recent API version(s). Currently using [2018-09-15]
…
This pull request removes 1 skipped test and adds 7 skipped tests. Note that renamed tests count towards both.
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ File/folder tests..test folder.[Microsoft.Consumption/budgets] JSON test files in the .test folder should be valid json
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.DevTestLab/labs/artifactSources] Variable names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.DevTestLab/labs/costs] Variable names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.DevTestLab/labs/notificationChannels] Variable names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.DevTestLab/labs/policySets/policies] Variable names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.DevTestLab/labs/schedules] Variable names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.DevTestLab/labs/virtualNetworks] Variable names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/utilities/pipelines/staticValidation/module.tests.ps1 ‑ File/folder tests..test folder.[Microsoft.DevTestLab/labs] JSON test files in the .test folder should be valid json

♻️ This comment has been updated with latest results.

@ahmadabdalla ahmadabdalla marked this pull request as ready for review January 4, 2023 05:54
@ahmadabdalla ahmadabdalla requested a review from a team as a code owner January 4, 2023 05:54
Copy link
Contributor

@AlexanderSehr AlexanderSehr left a comment

Choose a reason for hiding this comment

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

The API Specs file was updated 3 days ago. If the latest logic works - it should be safe to undo the changes now ad they 'should' not be applied anymore

@ahmadabdalla
Copy link
Contributor Author

The API Specs file was updated 3 days ago. If the latest logic works - it should be safe to undo the changes now ad they 'should' not be applied anymore

Undo complete :) .

@ahmadabdalla ahmadabdalla merged commit 4da0314 into main Jan 4, 2023
@ahmadabdalla ahmadabdalla deleted the users/ahmad/2518_dtlApiUpdate branch January 4, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[cat] modules category: modules enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug Report]: Update Azure DevTest Lab Module to API Version '2018-10-15-preview' failing the Static tests
2 participants