From 7e8c51c37badbc1fdc050157b86955f94923d1c5 Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 28 Oct 2026 10:42:59 +0000 Subject: [PATCH 1/3] Add Azure Linux 4.0 CI test coverage Mirror all five Azure Linux 3.0 amd64 innerloop configurations on Azure Linux 4.0: Go crypto, system crypto with and without cgo, and FIPS for both system crypto modes. Register the published CI image, route jobs to it, regenerate pipeline resources, and add coverage regression tests and documentation. Preserve all existing jobs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../cmd/pipelineymlgen/pipelineymlgen_test.go | 52 +++++++++++++++++++ eng/pipeline/README.md | 5 ++ eng/pipeline/data/containers.yml | 2 + eng/pipeline/pr-outerloop-pipeline.yml | 2 + eng/pipeline/pr-pipeline.yml | 2 + eng/pipeline/rolling-innerloop-pipeline.yml | 2 + eng/pipeline/rolling-pipeline.yml | 2 + .../stages/go-builder-matrix-stages.yml | 5 ++ eng/pipeline/stages/run-stage.yml | 2 + 9 files changed, 74 insertions(+) diff --git a/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go b/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go index 92686da5632..a65e983f0ee 100644 --- a/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go +++ b/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go @@ -5,7 +5,11 @@ package main import ( + "os" "os/exec" + "path/filepath" + "slices" + "strings" "testing" ) @@ -16,3 +20,51 @@ func TestGoInfraPipelineGenReproducible(t *testing.T) { t.Fatalf("pipelineymlgen reproduciblility check failed: %v\nOutput:\n%s\nRun 'pwsh eng/run.ps1 pipelineymlgen' if differences are expected.", err, out) } } + +func TestAzureLinux4Coverage(t *testing.T) { + read := func(path string) string { + t.Helper() + data, err := os.ReadFile(filepath.Join("../../../../eng/pipeline", path)) + if err != nil { + t.Fatal(err) + } + return string(data) + } + + var azureLinux3, azureLinux4 []string + for line := range strings.SplitSeq(read("stages/go-builder-matrix-stages.yml"), "\n") { + if strings.Contains(line, "distro: azurelinux3") { + azureLinux3 = append(azureLinux3, strings.ReplaceAll(strings.TrimSpace(line), "azurelinux3", "azurelinux4")) + } + if strings.Contains(line, "distro: azurelinux4") { + azureLinux4 = append(azureLinux4, strings.TrimSpace(line)) + } + } + if len(azureLinux4) != 5 || !slices.Equal(azureLinux3, azureLinux4) { + t.Fatalf("Azure Linux 4 jobs must match all five Azure Linux 3 configurations:\nwant %v\ngot %v", azureLinux3, azureLinux4) + } + + routing := read("stages/run-stage.yml") + if !strings.Contains(routing, "${{ elseif eq(parameters.builder.distro, 'azurelinux4') }}:\n container: azurelinux4") { + t.Fatal("Azure Linux 4 jobs must select the azurelinux4 container") + } + + const image = "mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default" + for _, path := range []string{ + "data/containers.yml", + "pr-pipeline.yml", + "pr-outerloop-pipeline.yml", + "rolling-innerloop-pipeline.yml", + "rolling-pipeline.yml", + } { + t.Run(path, func(t *testing.T) { + data := read(path) + if strings.Count(data, "image: "+image) != 1 { + t.Fatal("expected exactly one Azure Linux 4 amd64 image resource") + } + if !strings.Contains(data, "azurelinux4:") && !strings.Contains(data, "container: azurelinux4") { + t.Fatal("missing azurelinux4 container resource") + } + }) + } +} diff --git a/eng/pipeline/README.md b/eng/pipeline/README.md index 72d18b09f21..11743e09901 100644 --- a/eng/pipeline/README.md +++ b/eng/pipeline/README.md @@ -32,3 +32,8 @@ The subdirectories hold AzDO pipeline YAML templates, based on type of template. Quick link: [`stages/go-builder-matrix-stages.yml`](stages/go-builder-matrix-stages.yml) defines the set of builders that should run based on the scenario. + +The innerloop matrix tests Azure Linux 3.0 and 4.0 on amd64 with Go crypto, +system crypto (with and without cgo), and FIPS mode for both system crypto configurations. +Container images are defined in [`data/containers.yml`](data/containers.yml); +update that source and regenerate the pipelines when adding an image. diff --git a/eng/pipeline/data/containers.yml b/eng/pipeline/data/containers.yml index 55cd66438aa..f55c2e045d5 100644 --- a/eng/pipeline/data/containers.yml +++ b/eng/pipeline/data/containers.yml @@ -8,3 +8,5 @@ image: mcr.microsoft.com/microsoft-go/infra-images:cbl-mariner-2.0-arm64-default - container: azurelinux3 image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-3.0-amd64-default +- container: azurelinux4 + image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default diff --git a/eng/pipeline/pr-outerloop-pipeline.yml b/eng/pipeline/pr-outerloop-pipeline.yml index ef48796126b..3911a260a70 100644 --- a/eng/pipeline/pr-outerloop-pipeline.yml +++ b/eng/pipeline/pr-outerloop-pipeline.yml @@ -36,6 +36,8 @@ resources: image: mcr.microsoft.com/microsoft-go/infra-images:cbl-mariner-2.0-arm64-default - container: azurelinux3 image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-3.0-amd64-default + - container: azurelinux4 + image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default stages: - template: stages/go-builder-matrix-stages.yml parameters: diff --git a/eng/pipeline/pr-pipeline.yml b/eng/pipeline/pr-pipeline.yml index 62da956dd7f..68065aa5bc4 100644 --- a/eng/pipeline/pr-pipeline.yml +++ b/eng/pipeline/pr-pipeline.yml @@ -36,6 +36,8 @@ resources: image: mcr.microsoft.com/microsoft-go/infra-images:cbl-mariner-2.0-arm64-default - container: azurelinux3 image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-3.0-amd64-default + - container: azurelinux4 + image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default stages: - template: stages/go-builder-matrix-stages.yml parameters: diff --git a/eng/pipeline/rolling-innerloop-pipeline.yml b/eng/pipeline/rolling-innerloop-pipeline.yml index 5297f593be7..40a6ca57ff6 100644 --- a/eng/pipeline/rolling-innerloop-pipeline.yml +++ b/eng/pipeline/rolling-innerloop-pipeline.yml @@ -58,6 +58,8 @@ extends: image: mcr.microsoft.com/microsoft-go/infra-images:cbl-mariner-2.0-arm64-default azurelinux3: image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-3.0-amd64-default + azurelinux4: + image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default stages: - template: stages/go-builder-matrix-stages.yml parameters: diff --git a/eng/pipeline/rolling-pipeline.yml b/eng/pipeline/rolling-pipeline.yml index da7e5ae6767..3c367389f6b 100644 --- a/eng/pipeline/rolling-pipeline.yml +++ b/eng/pipeline/rolling-pipeline.yml @@ -53,6 +53,8 @@ extends: image: mcr.microsoft.com/microsoft-go/infra-images:cbl-mariner-2.0-arm64-default azurelinux3: image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-3.0-amd64-default + azurelinux4: + image: mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default stages: - template: stages/go-builder-matrix-stages.yml parameters: diff --git a/eng/pipeline/stages/go-builder-matrix-stages.yml b/eng/pipeline/stages/go-builder-matrix-stages.yml index 1ec7fca9b95..180d1b702d3 100644 --- a/eng/pipeline/stages/go-builder-matrix-stages.yml +++ b/eng/pipeline/stages/go-builder-matrix-stages.yml @@ -92,6 +92,7 @@ stages: - { nosystemcrypto: true, os: linux, arch: amd64, config: test } - { nosystemcrypto: true, os: linux, arch: amd64, config: test, distro: ubuntu } - { nosystemcrypto: true, os: linux, arch: amd64, config: test, distro: azurelinux3 } + - { nosystemcrypto: true, os: linux, arch: amd64, config: test, distro: azurelinux4 } - { os: linux, arch: amd64, config: test } - { os: linux, arch: amd64, config: test, fips: true } - { os: linux, arch: amd64, config: nocgo, fips: true } @@ -101,6 +102,10 @@ stages: - { os: linux, arch: amd64, config: nocgo, distro: azurelinux3 } - { os: linux, arch: amd64, config: test, distro: azurelinux3, fips: true } - { os: linux, arch: amd64, config: nocgo, distro: azurelinux3, fips: true } + - { os: linux, arch: amd64, config: test, distro: azurelinux4 } + - { os: linux, arch: amd64, config: nocgo, distro: azurelinux4 } + - { os: linux, arch: amd64, config: test, distro: azurelinux4, fips: true } + - { os: linux, arch: amd64, config: nocgo, distro: azurelinux4, fips: true } - { nosystemcrypto: true, os: windows, arch: amd64, config: devscript } - { nosystemcrypto: true, os: windows, arch: amd64, config: test } - { nosystemcrypto: true, os: windows, arch: 386, hostArch: amd64, config: test } diff --git a/eng/pipeline/stages/run-stage.yml b/eng/pipeline/stages/run-stage.yml index 1a7898d24b1..bf66b8b91b1 100644 --- a/eng/pipeline/stages/run-stage.yml +++ b/eng/pipeline/stages/run-stage.yml @@ -76,6 +76,8 @@ stages: container: ubuntu2204 ${{ elseif eq(parameters.builder.distro, 'azurelinux3') }}: container: azurelinux3 + ${{ elseif eq(parameters.builder.distro, 'azurelinux4') }}: + container: azurelinux4 ${{ else }}: container: mariner2 ${{ elseif eq(parameters.builder.hostArch, 'arm64') }}: From 3f68fb3131a522baac9a0a65e095e01583654911 Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 28 Oct 2026 10:44:16 +0000 Subject: [PATCH 2/3] Remove Azure Linux 4 matrix regression tests Keep the existing pipeline generation reproducibility test unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../cmd/pipelineymlgen/pipelineymlgen_test.go | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go b/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go index a65e983f0ee..92686da5632 100644 --- a/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go +++ b/eng/_util/cmd/pipelineymlgen/pipelineymlgen_test.go @@ -5,11 +5,7 @@ package main import ( - "os" "os/exec" - "path/filepath" - "slices" - "strings" "testing" ) @@ -20,51 +16,3 @@ func TestGoInfraPipelineGenReproducible(t *testing.T) { t.Fatalf("pipelineymlgen reproduciblility check failed: %v\nOutput:\n%s\nRun 'pwsh eng/run.ps1 pipelineymlgen' if differences are expected.", err, out) } } - -func TestAzureLinux4Coverage(t *testing.T) { - read := func(path string) string { - t.Helper() - data, err := os.ReadFile(filepath.Join("../../../../eng/pipeline", path)) - if err != nil { - t.Fatal(err) - } - return string(data) - } - - var azureLinux3, azureLinux4 []string - for line := range strings.SplitSeq(read("stages/go-builder-matrix-stages.yml"), "\n") { - if strings.Contains(line, "distro: azurelinux3") { - azureLinux3 = append(azureLinux3, strings.ReplaceAll(strings.TrimSpace(line), "azurelinux3", "azurelinux4")) - } - if strings.Contains(line, "distro: azurelinux4") { - azureLinux4 = append(azureLinux4, strings.TrimSpace(line)) - } - } - if len(azureLinux4) != 5 || !slices.Equal(azureLinux3, azureLinux4) { - t.Fatalf("Azure Linux 4 jobs must match all five Azure Linux 3 configurations:\nwant %v\ngot %v", azureLinux3, azureLinux4) - } - - routing := read("stages/run-stage.yml") - if !strings.Contains(routing, "${{ elseif eq(parameters.builder.distro, 'azurelinux4') }}:\n container: azurelinux4") { - t.Fatal("Azure Linux 4 jobs must select the azurelinux4 container") - } - - const image = "mcr.microsoft.com/microsoft-go/infra-images:azurelinux-4.0-amd64-default" - for _, path := range []string{ - "data/containers.yml", - "pr-pipeline.yml", - "pr-outerloop-pipeline.yml", - "rolling-innerloop-pipeline.yml", - "rolling-pipeline.yml", - } { - t.Run(path, func(t *testing.T) { - data := read(path) - if strings.Count(data, "image: "+image) != 1 { - t.Fatal("expected exactly one Azure Linux 4 amd64 image resource") - } - if !strings.Contains(data, "azurelinux4:") && !strings.Contains(data, "container: azurelinux4") { - t.Fatal("missing azurelinux4 container resource") - } - }) - } -} From f00e1a761b735d21552b565a815d4d8085e05357 Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 28 Oct 2026 10:44:56 +0000 Subject: [PATCH 3/3] Remove Azure Linux coverage README addition Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipeline/README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/eng/pipeline/README.md b/eng/pipeline/README.md index 11743e09901..72d18b09f21 100644 --- a/eng/pipeline/README.md +++ b/eng/pipeline/README.md @@ -32,8 +32,3 @@ The subdirectories hold AzDO pipeline YAML templates, based on type of template. Quick link: [`stages/go-builder-matrix-stages.yml`](stages/go-builder-matrix-stages.yml) defines the set of builders that should run based on the scenario. - -The innerloop matrix tests Azure Linux 3.0 and 4.0 on amd64 with Go crypto, -system crypto (with and without cgo), and FIPS mode for both system crypto configurations. -Container images are defined in [`data/containers.yml`](data/containers.yml); -update that source and regenerate the pipelines when adding an image.