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

[CI] Remove the template explosion in the CI via a matrix #15334

Merged
merged 6 commits into from
May 30, 2023

Conversation

mandel-macaque
Copy link
Member

@mandel-macaque mandel-macaque commented May 30, 2023

Templates are being abused and is resulting in a template explosion, this means that when the templates get expanded we have 100 thousans of lines generated. Azure devops has a limit in the size of the expanded template, and once that limit is reached, the pipeline wont be able to execute.

This changes makes the problem go away since a matrix is a native object for azure pipelines and does not get expanded.

This PR only takes care of the android emulator tests. A similar PR can be found in the xamarin-macios project:

xamarin/xamarin-macios#18312

For a better idea of what we achieve, the following is the expanded template: https://gist.github.com/mandel-macaque/dda3cda899e975814e563d6e34b50192

The following is the matrix expanded version: https://gist.github.com/mandel-macaque/ddbd66bbfb09531e866ee5b9354b8604

As you can see we go from 18850 yaml lines to 8210, that is over 10000 lines less. This reduces the time it takes for the pipeline to start as well as the effort to debug it.

Templates are being abused and is resulting in a tempalte explosion,
this means that when the templates get expanded we have 100 thousans of
lines generated. Azure devops has a limit in the size of the expanded
template, and once that limit is reached, the pipeline wont be able to
execute.

This changes makes the problem go away since a matrix is a native object
for azure pipelines and does not get expanded.

This PR only takes care of the android emulator tests. A similar PR can
be found in the xamarin-macios project:

xamarin/xamarin-macios#18312
@Eilon Eilon added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label May 30, 2023
@mandel-macaque mandel-macaque marked this pull request as ready for review May 30, 2023 16:38
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_API_${{ api }}:
${{ if ge(api, 24) }}:
ANDROID_EMULATORS: "system-images;android-${{ api }};google_apis_playstore;x86"
${{ if lt(api, 24) }}:
Copy link
Contributor

Choose a reason for hiding this comment

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

You could probably also use ${{ else }} here instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, but I tried to keep it as close as the original, will do in a second PR.

Copy link
Contributor

@mjbond-msft mjbond-msft left a comment

Choose a reason for hiding this comment

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

Minor recommendation otherwise looks good

@rmarinho rmarinho merged commit 260fa08 into main May 30, 2023
@rmarinho rmarinho deleted the dev/mandel/remove-template-explosion branch May 30, 2023 17:40
mandel-macaque added a commit that referenced this pull request May 30, 2023
This PR is a continuation of #15334
the removes the exact same problem but with the iOS device tests rather
than with the android tests.

Uses the exact same approach, moves from using a template explosion to a
matrix with the diff combinations.
rmarinho pushed a commit that referenced this pull request May 31, 2023
* [CI] Remove the template explosion in the CI via a matrix

This PR is a continuation of #15334
the removes the exact same problem but with the iOS device tests rather
than with the android tests.

Uses the exact same approach, moves from using a template explosion to a
matrix with the diff combinations.

* Lower case looks much better.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants