Skip to content

Consolidated ADO and GHA to use a single variables file for environment variables - #1182

Merged
Ahmad Abdalla (ahmadabdalla) merged 15 commits into
mainfrom
users/ahmad/configFiles
Mar 31, 2022
Merged

Ahmad Abdalla (ahmadabdalla) merged 15 commits into
mainfrom
users/ahmad/configFiles

Conversation

@ahmadabdalla

@ahmadabdalla Ahmad Abdalla (ahmadabdalla) commented Mar 25, 2022 •

Copy link
Copy Markdown
Contributor

Closes #953

Moved to a common and consolidated global.variables.yml file that works for both GHA and ADO.

Key Tasks

  • Removed duplicates and have a single location to update environment variables for both CI platforms.
  • Maintain existing native capability of ADO to use YAML files for variable templates.
  • Created a new composite GHA that reads a YAML list containing key value pairs, like the ADO variable file. With two tasks:
    • Uses the existing 'Setup Agent' feature to install the powershell-yaml module from the PowerShell gallery
    • Reads the variable YAML file using a newly developed generic script Add-YamlListToFile that deserializes the YAML List into a key value pair that is outputted to a file

Changes needed to support this feature:

GitHub Module Workflows

  • new Env: Variable that point to the path of the 'global.variables.yml`.
  • Replace the marketplace action deep-mm/[email protected] with our new composite action.
  • Move away from the variables that use the word default so that we align both CI platforms.

Azure DevOps Module Pipelines

  • Change the path of the template variable to the new root path so that the file works for both ADO and GHA.
  • Move away from the variables that use the word default so that we align both CI platforms.

Global Variable File

  • Reorganized the variables and added sections to help distinguish the two CI platforms specific variables
  • Removed the word default to that we align both CI platforms.
  • Removed the ADO modulePath: arm/$(moduleName) variable as it causes conflict with GHA, but not impacting ADO.

Design

image

Testing

  • Fully tested for GHA and ADO Module Pipeline and Dependency Pipeline

.Platform: Dependencies

Authorization: PolicyAssignments

image

@ahmadabdalla Ahmad Abdalla (ahmadabdalla) added enhancement New feature or request [cat] pipelines category: pipelines [cat] github category: GitHub [cat] azure devops category: Azure DevOps labels Mar 25, 2022
@github-actions

github-actions Bot commented Mar 25, 2022 •

Copy link
Copy Markdown

Unit Test Results

  1 files  ±  0  1 suites  ±0   38s ⏱️ ±0s
  3 tests  -   3  3 ✔️  - 3    0 💤 ±  0  0 ❌ ±0 
99 runs  +29  3 ✔️  - 3  96 💤 +32  0 ❌ ±0 

Results for commit a8370d1. ± Comparison against base commit 47f4f6d.

This pull request removes 6 and adds 3 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.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/arm/.global/global.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/arm/.global/global.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/arm/.global/global.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/arm/.global/global.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 [2021-11-01-preview]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.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 [2021-04-01-preview]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Resources/tags/resourceGroups] used resource type [tags] should use one of the recent API version(s). Currently using [2019-10-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.Resources/tags/subscriptions] used resource type [tags] should use one of the recent API version(s). Currently using [2019-10-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.Resources/tags] used resource type [tags] should use one of the recent API version(s). Currently using [2019-10-01]

♻️ This comment has been updated with latest results.

@ahmadabdalla
Ahmad Abdalla (ahmadabdalla) marked this pull request as ready for review March 28, 2022 06:58
Comment thread global.variables.yml Resolved
@ahmadabdalla
Ahmad Abdalla (ahmadabdalla) deleted the users/ahmad/configFiles branch March 31, 2022 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[cat] azure devops category: Azure DevOps [cat] github category: GitHub [cat] pipelines category: pipelines enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Simplify tokenreplacement and variables in the repo

3 participants