From b3c12a755b6f1d35c85acd51c1b3a2a65dac3b51 Mon Sep 17 00:00:00 2001 From: jneo8 Date: Thu, 2 Jan 2025 15:00:43 +0800 Subject: [PATCH] fix: exclude legacy `all` architecture in base processing Ensure that the `all` architecture is ignored during promotion to avoid processing legacy or unsupported configurations. This resolves issues with handling bases that use the `all` architecture. --- dist/promote-charm/index.js | 5 ++++- src/actions/promote-charm/promote-charm.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dist/promote-charm/index.js b/dist/promote-charm/index.js index 6aeb6b7a..b8a1f222 100644 --- a/dist/promote-charm/index.js +++ b/dist/promote-charm/index.js @@ -42519,7 +42519,10 @@ class PromoteCharmAction { } getRevisions(name, track, channel, bases) { return __awaiter(this, void 0, void 0, function* () { - return Promise.all(bases.map((base) => __awaiter(this, void 0, void 0, function* () { + // Filter out bases with architecture "all" + const filteredBases = bases.filter((base) => base.architecture !== 'all'); + // Map filtered bases to their revision information + return Promise.all(filteredBases.map((base) => __awaiter(this, void 0, void 0, function* () { return this.charmcraft.getRevisionInfoFromChannelJson(name, track, channel, base); }))); }); diff --git a/src/actions/promote-charm/promote-charm.ts b/src/actions/promote-charm/promote-charm.ts index 4c6ce840..d0841bd6 100644 --- a/src/actions/promote-charm/promote-charm.ts +++ b/src/actions/promote-charm/promote-charm.ts @@ -32,8 +32,12 @@ export class PromoteCharmAction { channel: string, bases: Base[], ): Promise { + // Filter out bases with architecture "all" + const filteredBases = bases.filter((base) => base.architecture !== 'all'); + + // Map filtered bases to their revision information return Promise.all( - bases.map(async (base: Base) => + filteredBases.map(async (base: Base) => this.charmcraft.getRevisionInfoFromChannelJson( name, track,