f2calv / yamlizr

Azure DevOps Designer-to-YAML Pipeline CLI CodeGen Tool w/GitHub Actions Generation
MIT License
69 stars 16 forks source link

Failure to migrate release pipelines, without much information #144

Closed fredericDelaporte closed 1 year ago

fredericDelaporte commented 2 years ago

Hello,

Using version 1.0.18, with the following command line on our Azure DevOps repository, we get failures on all our release pipelines, without any detail about what is going wrong.

Commande line:

yamlizr generate -pat redactedOut -org redactedOut -proj redactedOut -out .\Release

I only get for each release pipeline an information stating "Processing failed". I would expect to have some more details about what has failed, but I cannot find any.

Commande line output:

                        _ _
  _   _  __ _ _ __ ___ | (_)_____ __
 | | | |/ _` | '_ ` _ \| | |_  / '__|
 | |_| | (_| | | | | | | | |/ /| |
  \__, |\__,_|_| |_| |_|_|_/___|_|
  |___/

For documentaton/support;
- https://github.com/f2calv/yamlizr (Azure Pipelines)
- https://github.com/samsmithnz/AzurePipelinesToGitHubActionsConverter (GitHub Actions)

To update/refresh this tool;
   dotnet tool update --global yamlizr

Connecting to Azure DevOps REST API, https://dev.azure.com/redactedOut ... connected :)
Retrieving Azure DevOps Project 'redactedOut' ...  retrieved :)
Directory '.\Release\redactedOut' does not exist, create? [Y/n]
100,00% 16 build definition reference(s) retrieved.                                                  00:00:00 / 00:00:00
100,00% 15 release definition(s) retrieved.                                                          00:00:00 / 00:00:00
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
100,00% 275 installed extension(s) retrieved.                                                        00:00:00 / 00:00:00
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
100,00% 1 variable group(s) retrieved.                                                               00:00:00 / 00:00:00
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
100,00% Retrieved 16 of 16 full build definition(s).                                                 00:00:00 / 00:00:00
100,00% YamlPipelineGenerator processed 15 of 15 build definition(s).                                00:00:00 / 00:00:00
100,00% YamlPipelineGenerator processed 15 of 15 release definition(s).                              00:00:02 / 00:00:00
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
100,00% yamlizr persisted 15 of 15 build pipeline(s) to disk.                                        00:00:00 / 00:00:00
100,00% Persisting 0 release pipeline(s) to disk...                                                  00:00:00 / 00:00:01
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Persisting task group YAML templates... done.
15 error(s) encountered when running Azure Designer -> Azure Pipeline conversion;
- Processing release definition id 1 'BackOffice CI' failed
- Processing release definition id 2 'Front CI' failed
- Processing release definition id 3 'Extranet CI' failed
- Processing release definition id 4 'API CI' failed
- Processing release definition id 5 'Batch CI' failed
- Processing release definition id 6 'BackOffice R7' failed
- Processing release definition id 7 'API R7' failed
- Processing release definition id 8 'Extranet R7' failed
- Processing release definition id 9 'Front R7' failed
- Processing release definition id 10 'Batch R7' failed
- Processing release definition id 11 'API Preprod (Patch)' failed
- Processing release definition id 12 'BackOffice Preprod (Patch)' failed
- Processing release definition id 13 'Extranet Preprod (Patch)' failed
- Processing release definition id 14 'Front Preprod (Patch)' failed
- Processing release definition id 27 'Batch Preprod (Patch)' failed
Total of 20 YAML file(s) created.
Exiting...

OS: Windows 11 Professional dotnet --version: 6.0.202 Run from VS Studio 2022 developer PowerShell (VS in admin mode) and directly from a PowerShell cli (admin mode too): same output. Pat freshly created according to https://github.com/f2calv/yamlizr#installationset-up.

fredericDelaporte commented 2 years ago

I have attempted a debug session. (I do that by making sure the target directory does not exists, which causes the utility to stop on a directory creation prompt, letting me attach to it with "just my code disabled".) It seems it cannot find any job in GenReleaseStages function. The _release member has its Environments, which have a deploy phase in DeployPhases, but its PhaseType is MachineGroupBaseDeployment which is filtered out by GenJobs, which seems to process only AgentBaseDeployment phases.

Tricking the thing by setting each phase type to AgentBaseDeployment before the filtering seems to work, but I have not yet checked the result is actually usable. (And it is cumbersome to migrate releases with such a hack to do.)

fredericDelaporte commented 2 years ago

The tool, was still a good help, using this hack. Not production ready, but still valuable. So maybe the PhaseType filtering should just be relaxed a bit.

f2calv commented 1 year ago

Firstly the tool is not designed to be production ready as is stated in the README.

Disclaimer: Do not consider any of the YAML generated by this tool to be 'production ready'. Do your own testing/research and post any issues and/or make a PR!

I have made a PR https://github.com/f2calv/yamlizr/pull/153 that addresses this so there is now a --phasetype argument, i.e. "--phasetype MachineGroupBasedDeployment"