You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simplify tokenreplacement and variables in the repo #953
A contributor forks repo, sets up variables and token settings to deploy dependencies, validation and publishing resources. After making a new module or adjusting one, the contributors repo will either need to cherrypick or revert changes in their repo before doing a PR to the Azure/ResourceModules repo. These settings should maybe be moved to something that is not controlled in code?
When using the solution to set up a fork for PoC and contribution, i update .\settings.json, .github\variables\global.variables.json and .azuredevops\pipelineVariables\global.variables.yml so it reflects my own setup or align with organization naming conventions. When I then run pipelines most pipelines fail as they are referring to a "hardcoded" rg for validation, validation-rg. This is not a true variable for the time being as it requires some search and replace if the RG variables are changed in the variable files.
There are many moving parts to configure a solution for variable management in the solution:
Could this be simpler where both the token replacer and variables are managed from a single place, which does not affect the content of the git repo, making also the contribution aspect easier?
Could it be all handled in a GitHub environment/secrets or ADO variable group? Keeping it all as a unified way to manage variables, token replacement, additionalParameters, and credentials similarly across the two platforms?
Ahmad Abdalla (@ahmadabdalla) please arrange a brain-storming session to see how far you already are and if there are design decisions we need to revisit
The concept in principle is good. As it does make it easier to configure things in a unique location (settings.json) However, we need to take into consideration the following:
User experience: Most users taking the platform will choose one tool (ADO or GitHub). So, they can simply delete the whole folder that contains the CI tool and configurations associated.
Native capability: Combining variables files into that is not for example YAML based, requires us to forgo a native capability in ADO to store variables (using a dedicated YAML file). Hence might not receive the best feedback from the community as there is an additional component that have to manage (i.e. a task with custom code that sets the variables)
For GitHub: It is easy to roll out a dedicated action that sets variables from a file that we can control the format of. So, we can investigate swapping the current marketplace action with a custom one and point it to the same global variable YAML that we use for ADO but writing the logic to consume this file.
Good to understand, who are we solving this problem for? Is it us as the maintainers who are supporting multiple platforms, or is it the end user who is likely to choose one?
For 'optional' features, we can still use them as variables for now. But we need to first have a concrete definition on what is a core feature, and what is optional, so we can build the right framework to support feature flags.
Next Steps:
Understand if GHA is going to bring in the native support for variables through YAMLs like ADO.
See if we can change the PoC to get GHA to consume the same global variables YAML used in ADO.
GitHub actions now use the same file as ADO, by performing the following:
New Composite action, replacing the current marketplace one for translating variables into environment variables.
The action leverages a PowerShell module from the gallery that allows reading YAML files and converting them into hash table, which are then injected as environment variables.
Azure DevOps still uses the same native method (YAML) file as template for variables. However, the path will change given that the same file will be shared for both platforms.
Moved the global.variables.yml to the root so it can be used by both ADO and GitHub action
Activity
MariusStorhaug commentedon Feb 1, 2022
Could it be all handled in a GitHub environment/secrets or ADO variable group? Keeping it all as a unified way to manage variables, token replacement, additionalParameters, and credentials similarly across the two platforms?
rahalan commentedon Mar 3, 2022
Ahmad Abdalla (@ahmadabdalla) please arrange a brain-storming session to see how far you already are and if there are design decisions we need to revisit
ahmadabdalla commentedon Mar 10, 2022
(Point 2)
Updates based on the brainstorming session + PoC
The concept in principle is good. As it does make it easier to configure things in a unique location (settings.json) However, we need to take into consideration the following:
For GitHub: It is easy to roll out a dedicated action that sets variables from a file that we can control the format of. So, we can investigate swapping the current marketplace action with a custom one and point it to the same global variable YAML that we use for ADO but writing the logic to consume this file.
Good to understand, who are we solving this problem for? Is it us as the maintainers who are supporting multiple platforms, or is it the end user who is likely to choose one?
For 'optional' features, we can still use them as variables for now. But we need to first have a concrete definition on what is a core feature, and what is optional, so we can build the right framework to support feature flags.
Next Steps:
Cc: @MrMCake Rainer Halanek (@rahalan) Marius Storhaug (@MariusStorhaug) Erika Gressi (@eriqua) Margarita Sanz (@Msanzdelrio) Simone Bertaccini (@simonbMS)
ahmadabdalla commentedon Mar 16, 2022
Latest prototype:
global.variables.ymlto the root so it can be used by both ADO and GitHub action