Skip to content

Commit 492de74

Browse files
committed
.sync: Fix Mu DevOps version in Mu pipelines
Project Mu pipelines use pipelines templates as a repository resource from mu_devops. Currently, a pipeline build pulls the latest commit from the `main` branch. This means the version of mu_devops is "floating" in that pipelines immediately pick up the latest change. To improve build traceability and stability, this change moves the "leaf" pipeline YAML files to use fixed/release versions of content in the mu_devops repo. This change updates all pipeline files to use the version specified in one place - `.sync/Version.njk` during the file sync process to downstream repos. Example flow: 1. Make a new Mu DevOps release (e.g. "v1.0.0") 2. Update `.sync/Version.njk` to set `mu_devops` to `"v1.0.0"` Step (2) causes the following automated actions to take place after the change is merged into `mu_devops/main`: 1. All sync files (e.g. an Azure Pipeline file) that depend on this version get the new value substituted 2. All sync files with the substituted value are synced to their respective repos (PRs created with the change) 3. After the PRs in those repos are merged, they use the new version of Mu DevOps in their pipelines Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent 23a54b2 commit 492de74

17 files changed

Lines changed: 93 additions & 14 deletions

File tree

.sync/Files.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,66 +31,82 @@ group:
3131
- files:
3232
- source: .sync/azure_pipelines/custom/mu_feature_config/Ubuntu-GCC5.yml
3333
dest: .azurepipelines/Ubuntu-GCC5.yml
34+
template: true
3435
- source: .sync/azure_pipelines/custom/mu_feature_config/Windows-VS.yml
3536
dest: .azurepipelines/Windows-VS.yml
37+
template: true
3638
repos: |
3739
microsoft/mu_feature_config
3840
3941
# Azure Pipelines - Custom - microsoft/mu_feature_ipmi
4042
- files:
4143
- source: .sync/azure_pipelines/custom/mu_feature_ipmi/Ubuntu-GCC5.yml
4244
dest: .azurepipelines/Ubuntu-GCC5.yml
45+
template: true
4346
- source: .sync/azure_pipelines/custom/mu_feature_ipmi/Windows-VS.yml
4447
dest: .azurepipelines/Windows-VS.yml
48+
template: true
4549
repos: |
4650
microsoft/mu_feature_ipmi
4751
4852
# Azure Pipelines - Custom - microsoft/mu_feature_mm_supv
4953
- files:
5054
- source: .sync/azure_pipelines/custom/mu_feature_mm_supv/Ubuntu-GCC5.yml
5155
dest: .azurepipelines/Ubuntu-GCC5.yml
56+
template: true
5257
- source: .sync/azure_pipelines/custom/mu_feature_mm_supv/Windows-VS.yml
5358
dest: .azurepipelines/Windows-VS.yml
59+
template: true
5460
repos: |
5561
microsoft/mu_feature_mm_supv
5662
5763
# Azure Pipelines - Custom - microsoft/mu_oem_sample
5864
- files:
5965
- source: .sync/azure_pipelines/custom/mu_oem_sample/Ubuntu-GCC5.yml
6066
dest: .azurepipelines/Ubuntu-GCC5.yml
67+
template: true
6168
- source: .sync/azure_pipelines/custom/mu_oem_sample/Windows-VS.yml
6269
dest: .azurepipelines/Windows-VS.yml
70+
template: true
6371
repos: |
6472
microsoft/mu_oem_sample
6573
6674
# Azure Pipelines - Custom - microsoft/mu_tiano_platforms
6775
- files:
6876
- source: .sync/azure_pipelines/custom/mu_tiano_platforms/Ubuntu-GCC5.yml
6977
dest: .azurepipelines/Ubuntu-GCC5.yml
78+
template: true
7079
- source: .sync/azure_pipelines/custom/mu_tiano_platforms/Windows-VS.yml
7180
dest: .azurepipelines/Windows-VS.yml
81+
template: true
7282
repos: |
7383
microsoft/mu_tiano_platforms
7484
7585
# Azure Pipelines - Matrix Dependent - All
7686
- files:
7787
- source: .sync/azure_pipelines/matrix_dependent/Ubuntu-CLANGPDB.yml
7888
dest: .azurepipelines/Ubuntu-CLANGPDB.yml
89+
template: true
7990
- source: .sync/azure_pipelines/matrix_dependent/Ubuntu-GCC5.yml
8091
dest: .azurepipelines/Ubuntu-GCC5.yml
92+
template: true
8193
- source: .sync/azure_pipelines/matrix_dependent/Windows-CLANGPDB.yml
8294
dest: .azurepipelines/Windows-CLANGPDB.yml
95+
template: true
8396
- source: .sync/azure_pipelines/matrix_dependent/Windows-VS.yml
8497
dest: .azurepipelines/Windows-VS.yml
98+
template: true
8599
repos: |
86100
microsoft/mu_basecore
87101
88102
# Azure Pipelines - Matrix Dependent - GCC & VS Only
89103
- files:
90104
- source: .sync/azure_pipelines/matrix_dependent/Ubuntu-GCC5.yml
91105
dest: .azurepipelines/Ubuntu-GCC5.yml
106+
template: true
92107
- source: .sync/azure_pipelines/matrix_dependent/Windows-VS.yml
93108
dest: .azurepipelines/Windows-VS.yml
109+
template: true
94110
repos: |
95111
microsoft/mu_common_intel_min_platform
96112
microsoft/mu_plus

.sync/ReadMe.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ How to Configure File Syncing
3434
All of the file synchronization settings are maintained in the `/.sync/Files.yml`_ configuration file. Refer to the file
3535
to see the current synchronization settings and to modify settings.
3636

37+
Any resource versions that might be substituted into files during the sync process are defined in `/.sync/Version.njk`.
38+
3739
.. _/.sync/Files.yml: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml

.sync/Version.njk

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{#
2+
Mu DevOps Dependency Version Control
3+
4+
=====================================================================================================================
5+
About
6+
=====================================================================================================================
7+
This file centralizes definitions of versions placed into files synced from Mu DevOps to other repos before the
8+
files are synced.
9+
10+
=====================================================================================================================
11+
`mu_devops` Example:
12+
=====================================================================================================================
13+
`mu_devops` defines the git tag value of Mu DevOps that will be synced (via file sync) to repos that depend on this
14+
repo. More simply, this updates the version of Mu DevOps used across all Project Mu repos.
15+
16+
Example flow:
17+
1. Make a new Mu DevOps release (e.g. "v1.0.0")
18+
2. Update this file to set `mu_devops` to "v1.0.0"
19+
20+
Step (2) causes the following automated actions to take place after the change is merged:
21+
1. All sync files (e.g. an Azure Pipeline file) that depend on this version get the new value substituted
22+
2. All sync files with the substituted value are synced to their respective repos (PRs created with the change)
23+
3. After the PRs in those repos are merged, they use the new version of Mu DevOps
24+
25+
---------------------------------------------------------------------------------------------------------------------
26+
Note: This file is not actually synced. It controls the version used in other files that are synced.
27+
28+
Copyright (c) Microsoft Corporation.
29+
SPDX-License-Identifier: BSD-2-Clause-Patent
30+
#}
31+
32+
{# The git ref value that files dependent on this repo will use. #}
33+
{% set mu_devops = "v0.1.0" %}

.sync/azure_pipelines/custom/mu_feature_config/Ubuntu-GCC5.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-arm-64-x86-64

.sync/azure_pipelines/custom/mu_feature_config/Windows-VS.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-x86-64

.sync/azure_pipelines/custom/mu_feature_ipmi/Ubuntu-GCC5.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-arm64-x86-64

.sync/azure_pipelines/custom/mu_feature_ipmi/Windows-VS.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-arm64-x86-64

.sync/azure_pipelines/custom/mu_feature_mm_supv/Ubuntu-GCC5.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-x86-64

.sync/azure_pipelines/custom/mu_feature_mm_supv/Windows-VS.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-x86-64

.sync/azure_pipelines/custom/mu_oem_sample/Ubuntu-GCC5.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
# SPDX-License-Identifier: BSD-2-Clause-Patent
1212
##
1313

14+
{% import '../../../Version.njk' as sync_version -%}
15+
1416
resources:
1517
repositories:
1618
- repository: mu_devops
1719
type: github
1820
endpoint: microsoft
1921
name: microsoft/mu_devops
20-
ref: main
22+
ref: refs/tags/{{ sync_version.mu_devops }}
2123

2224
variables:
2325
- group: architectures-arm-64-x86-64

0 commit comments

Comments
 (0)