From 34306b852d07ff2c5385cafc5290e239b79855ed Mon Sep 17 00:00:00 2001 From: mudler-agent Date: Sat, 24 Oct 2026 18:08:54 +0200 Subject: [PATCH] fix(ci): give tables a platform so add-on packages publish (#12879) The plan job of the add-on package workflow runs the platform matrix for every add-on. On a publishing event it fails closed when an add-on has no enabled platform. The Tables platform file listed three platforms, all with enabled: false, so every master push failed the plan and nothing was published or signed. Enable the same four platforms as the other first-party add-ons (linux/amd64, linux/arm64, darwin/arm64, darwin/amd64), each with its native runner and the executable-start check. The fail-closed check in the workflow is unchanged. The tests assumed Tables was disabled. The matrix spec now requires at least one enabled platform in the checked-in Tables file. The platform spec covers Tables like the other add-ons. The shell suite builds a disabled copy of the Tables file for the two fail-closed cases. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- addons/tables/package/platforms.yaml | 10 +++++++--- pkg/addons/packaging/packaging_test.go | 11 ++++------- pkg/addons/packaging/platforms_test.go | 2 +- scripts/addons/package_test.sh | 5 +++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/addons/tables/package/platforms.yaml b/addons/tables/package/platforms.yaml index eec3860a4..d7dcd32a8 100644 --- a/addons/tables/package/platforms.yaml +++ b/addons/tables/package/platforms.yaml @@ -21,14 +21,18 @@ manifest: addons/tables/manifest.json ui: addons/tables/ui/dist platforms: - platform: linux/amd64 - enabled: false + enabled: true runner: ubuntu-24.04 native_check: executable-start - platform: linux/arm64 - enabled: false + enabled: true runner: ubuntu-24.04-arm native_check: executable-start - platform: darwin/arm64 - enabled: false + enabled: true runner: macos-14 native_check: executable-start + - platform: darwin/amd64 + enabled: true + runner: macos-15-intel + native_check: executable-start diff --git a/pkg/addons/packaging/packaging_test.go b/pkg/addons/packaging/packaging_test.go index 791515d75..9b2ca28b9 100644 --- a/pkg/addons/packaging/packaging_test.go +++ b/pkg/addons/packaging/packaging_test.go @@ -322,15 +322,12 @@ var _ = Describe("platform matrix", func() { Expect(err).NotTo(HaveOccurred()) Expect(strings.TrimSpace(out)).To(Equal(`{"include":[{"platform":"linux/amd64","runner":"r1","slug":"linux-amd64"},{"platform":"linux/arm64","runner":"r2","slug":"linux-arm64"}]}`)) }) - It("ships the checked-in matrix with every platform disabled until its native check passes", func() { + It("ships a checked-in Tables matrix with at least one enabled platform", func() { cfg, err := loadPlatforms("../../../addons/tables/package/platforms.yaml") Expect(err).NotTo(HaveOccurred()) - Expect(cfg.Platforms).NotTo(BeEmpty()) - for _, e := range cfg.Platforms { - Expect(e.Enabled).To(BeFalse(), e.Platform) - } - _, err = cfg.enabled() - Expect(err).To(HaveOccurred()) + enabled, err := cfg.enabled() + Expect(err).NotTo(HaveOccurred()) + Expect(enabled).NotTo(BeEmpty()) }) }) diff --git a/pkg/addons/packaging/platforms_test.go b/pkg/addons/packaging/platforms_test.go index 3a116842b..c0662e2b9 100644 --- a/pkg/addons/packaging/platforms_test.go +++ b/pkg/addons/packaging/platforms_test.go @@ -26,7 +26,7 @@ var releasePlatforms = map[string]string{ // request. Enabling without this record, or recording without enabling, fails. var nativeChecked = map[string]bool{"linux/amd64": true, "linux/arm64": true, "darwin/arm64": true, "darwin/amd64": true} -var packagedAddons = []string{"voice", "face", "fine-tuning", "quantization", "studio", "talk"} +var packagedAddons = []string{"tables", "voice", "face", "fine-tuning", "quantization", "studio", "talk"} var _ = Describe("the packaged add-ons", func() { for _, id := range packagedAddons { diff --git a/scripts/addons/package_test.sh b/scripts/addons/package_test.sh index 348413604..3c3597cea 100755 --- a/scripts/addons/package_test.sh +++ b/scripts/addons/package_test.sh @@ -76,7 +76,8 @@ sh scripts/addons/package.sh --layout "$work/leg" --version 1.2.3 --platform "$h grep -F 'publishable=false' "$work/out" >/dev/null && grep -F 'verified=tables 1.2.3' "$work/out" >/dev/null test -f "$work/leg/receipt.json" && test -f "$work/leg/index.json" && test -f "$work/leg/oci-layout" case_ok 'package.sh builds and verifies a local check layout' -expect_fail 'package.sh refuses a platform the matrix has not enabled' 'not enabled' sh scripts/addons/package.sh --layout "$work/leg2" --version 1.2.3 --platform "$host" --executable "$work/stub" +sed 's/enabled: true/enabled: false/' addons/tables/package/platforms.yaml >"$work/disabled.yaml" +expect_fail 'package.sh refuses a platform the matrix has not enabled' 'not enabled' sh scripts/addons/package.sh --config "$work/disabled.yaml" --layout "$work/leg2" --version 1.2.3 --platform "$host" --executable "$work/stub" expect_fail 'package.sh refuses an existing non-empty layout' 'not empty' sh scripts/addons/package.sh --layout "$work/leg" --version 1.2.3 --platform "$host" --executable "$work/stub" --local-check expect_fail 'package.sh requires its arguments' 'usage:' sh scripts/addons/package.sh --version 1.2.3 expect_fail 'package.sh refuses an invalid version' 'semantic version' sh scripts/addons/package.sh --layout "$work/leg3" --version v1 --platform "$host" --executable "$work/stub" --local-check @@ -122,7 +123,7 @@ for id in voice face fine-tuning quantization studio talk; do grep -x "./addons/$id/cmd/$id CGO_ENABLED=0" "$work/gobuild.log" >/dev/null || { echo "FAIL: $id is not built with CGO_ENABLED=0" >&2; cat "$work/gobuild.log" >&2; exit 1; } done case_ok 'package.sh builds Tables with cgo and the pure Go add-ons without' -expect_fail 'matrix fails closed while no platform is enabled' 'no enabled platform' "$tool" matrix --config addons/tables/package/platforms.yaml +expect_fail 'matrix fails closed while no platform is enabled' 'no enabled platform' "$tool" matrix --config "$work/disabled.yaml" expect_fail 'matrix fails closed without a file' 'platform matrix' "$tool" matrix --config "$work/absent.yaml" # channel.sh.