From a92566f8ba026441e97b1de09ef817d418732356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Wed, 12 Apr 2023 08:12:24 +0100 Subject: [PATCH 1/2] make matrix builds unlimited --- ci/woodpecker/server.nix | 2 ++ ci/woodpecker/unlimited-matrix.patch | 37 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 ci/woodpecker/unlimited-matrix.patch diff --git a/ci/woodpecker/server.nix b/ci/woodpecker/server.nix index 793bbf9..bb56a1b 100644 --- a/ci/woodpecker/server.nix +++ b/ci/woodpecker/server.nix @@ -22,6 +22,8 @@ in CGO_ENABLED = 1; + patches = [./unlimited-matrix.patch]; + passthru = { inherit woodpecker-frontend; diff --git a/ci/woodpecker/unlimited-matrix.patch b/ci/woodpecker/unlimited-matrix.patch new file mode 100644 index 0000000..58b7302 --- /dev/null +++ b/ci/woodpecker/unlimited-matrix.patch @@ -0,0 +1,37 @@ +diff --git a/pipeline/frontend/yaml/matrix/matrix.go b/pipeline/frontend/yaml/matrix/matrix.go +index da5e9f24..bebad5f0 100644 +--- a/pipeline/frontend/yaml/matrix/matrix.go ++++ b/pipeline/frontend/yaml/matrix/matrix.go +@@ -22,11 +22,6 @@ import ( + "gopkg.in/yaml.v3" + ) + +-const ( +- limitTags = 10 +- limitAxis = 25 +-) +- + // Matrix represents the pipeline matrix. + type Matrix map[string][]string + +@@ -92,20 +87,10 @@ func calc(matrix Matrix) []Axis { + decr = decr / len(elems) + elem := p / decr % len(elems) + axis[tag] = elems[elem] +- +- // enforce a maximum number of tags in the pipeline matrix. +- if i > limitTags { +- break +- } + } + + // append to the list of axis. + axisList = append(axisList, axis) +- +- // enforce a maximum number of axis that should be calculated. +- if p > limitAxis { +- break +- } + } + + return axisList From 8c8a48f206035e4f07d378d1a72530c39000041e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Wed, 12 Apr 2023 08:20:13 +0100 Subject: [PATCH 2/2] thank you go for making patches extremely simple --- ci/woodpecker/unlimited-matrix.patch | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/woodpecker/unlimited-matrix.patch b/ci/woodpecker/unlimited-matrix.patch index 58b7302..4bb77d9 100644 --- a/ci/woodpecker/unlimited-matrix.patch +++ b/ci/woodpecker/unlimited-matrix.patch @@ -1,5 +1,5 @@ diff --git a/pipeline/frontend/yaml/matrix/matrix.go b/pipeline/frontend/yaml/matrix/matrix.go -index da5e9f24..bebad5f0 100644 +index da5e9f24..c3fe9896 100644 --- a/pipeline/frontend/yaml/matrix/matrix.go +++ b/pipeline/frontend/yaml/matrix/matrix.go @@ -22,11 +22,6 @@ import ( @@ -14,7 +14,13 @@ index da5e9f24..bebad5f0 100644 // Matrix represents the pipeline matrix. type Matrix map[string][]string -@@ -92,20 +87,10 @@ func calc(matrix Matrix) []Axis { +@@ -87,25 +82,15 @@ func calc(matrix Matrix) []Axis { + for p := 0; p < perm; p++ { + axis := map[string]string{} + decr := perm +- for i, tag := range tags { ++ for _, tag := range tags { + elems := matrix[tag] decr = decr / len(elems) elem := p / decr % len(elems) axis[tag] = elems[elem]