From e58a19b485fb3f8e7d268f4a14d39d6560d186b7 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 7 Aug 2024 13:17:00 +0200 Subject: [PATCH 1/6] Add missing -min and -max suffix Without these, we end up having duplicated metrics as jmx exporter exposes multiple beans through the same metrics name: - `kafka_consumer_fetch_manager_records_lead_min` --> `kafka_consumer_fetch_manager_records_lead` - `kafka_consumer_fetch_manager_records_lag_max` --> `kafka_consumer_fetch_manager_records_lag` It seems this is a "known" and accepted behavior of JMX exporter, see https://github.com/prometheus/jmx_exporter/issues/609. Issue: ZENKO-4869 --- solution/kafka-connect/kafka-connect.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/kafka-connect/kafka-connect.yaml b/solution/kafka-connect/kafka-connect.yaml index 9b9e401d94..4e8e9a1c4a 100644 --- a/solution/kafka-connect/kafka-connect.yaml +++ b/solution/kafka-connect/kafka-connect.yaml @@ -21,7 +21,7 @@ rules: #kafka.producer:type=producer-topic-metrics,client-id="{clientid}",topic="{topic}"", partition="{partition}" #kafka.consumer:type=consumer-fetch-manager-metrics,client-id="{clientid}",topic="{topic}"", partition="{partition}" - - pattern: kafka.(.+)<>(.+-total|.+-rate|.+-avg|.+-replica|.+-lag|.+-lead) + - pattern: kafka.(.+)<>(.+-total|.+-rate|.+-avg|.+-max|.+-min|.+-replica|.+-lag|.+-lead) name: kafka_$2_$6 labels: clientId: "$3" From f2619782d83c6022eddadcf38e3b4eb6323eaa21 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 7 Aug 2024 14:37:59 +0200 Subject: [PATCH 2/6] Fix computation of prev version number Sorting was sorting numbers in 'natural' order. Issue: ZENKO-4869 --- .github/scripts/get-previous-tag.js | 6 +++++- tests/workflows/getPreviousTag.spec.js | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/scripts/get-previous-tag.js b/.github/scripts/get-previous-tag.js index afa3b461e6..616ce46fb7 100644 --- a/.github/scripts/get-previous-tag.js +++ b/.github/scripts/get-previous-tag.js @@ -12,7 +12,11 @@ function getPreviousTag(version, allReleases) { // Find the latest release with the same prefix previous_tags = allReleases.filter(r => r.tag_name.startsWith(version)); if (previous_tags.length > 0) { - return previous_tags.sort().reverse()[0].tag_name; + // Use a custom sort function, to ensure 'natural' sort of numeric parts + const compare = new Intl.Collator(undefined, { numeric: true }).compare; + return previous_tags.sort( + (a, b) => compare(a.tag_name, b.tag_name) + ).reverse()[0].tag_name; } } } diff --git a/tests/workflows/getPreviousTag.spec.js b/tests/workflows/getPreviousTag.spec.js index 835567a8e3..542097034c 100644 --- a/tests/workflows/getPreviousTag.spec.js +++ b/tests/workflows/getPreviousTag.spec.js @@ -13,6 +13,25 @@ it('should return the previous tag', async () => { expect(tag).toBe("1.2.0"); }); +it('should return the previous tag out of order', async () => { + const tag = getPreviousTag("1.2.1", [ + { tag_name: "1.1.2" }, { tag_name: "1.2.0" }, { tag_name: "1.1.1" }, + { tag_name: "1.1.0" }, { tag_name: "1.3.0" } + ]); + expect(tag).toBe("1.2.0"); +}); + +it('should return previous tag when > 10', async () => { + const tag = getPreviousTag("1.1.12", [ + { tag_name: "1.1.0" }, { tag_name: "1.1.1" }, { tag_name: "1.1.2" }, + { tag_name: "1.1.3" }, { tag_name: "1.1.4" }, { tag_name: "1.1.5" }, + { tag_name: "1.1.6" }, { tag_name: "1.1.7" }, { tag_name: "1.1.8" }, + { tag_name: "1.1.9" }, { tag_name: "1.1.10" }, { tag_name: "1.1.11" }, + { tag_name: "1.2.0" }, { tag_name: "1.3.0" } + ]); + expect(tag).toBe("1.1.11"); +}); + it('should return the previous rc tag', async () => { const tag = getPreviousTag("1.2.1-rc.2", [ { tag_name: "1.1.0" }, { tag_name: "1.1.1" }, { tag_name: "1.1.2-rc.1" }, From 5cc9d8ad3d997b21f2e86421f03c8c8b6641bbdc Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 7 Aug 2024 14:38:30 +0200 Subject: [PATCH 3/6] Add ACT_VERBOSE option in workflow tests Issue: ZENKO-4869 --- tests/workflows/release.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/workflows/release.spec.ts b/tests/workflows/release.spec.ts index 7a7dba893d..f7582e47e0 100644 --- a/tests/workflows/release.spec.ts +++ b/tests/workflows/release.spec.ts @@ -146,6 +146,7 @@ test.each([ const result = await act.runEvent("workflow_dispatch", { logFile: process.env.ACT_LOG ? "act-release-"+expect.getState().currentTestName+".log" : undefined, + verbose: process.env.ACT_VERBOSE ? true : false, mockApi: [ // Mock artifact promotion: copy, retrieve workflow run and set index mockapi.mock.artifacts.root From fcd5036d149b8767d8fc5b37f387fb4b64cff55c Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 7 Aug 2024 14:39:01 +0200 Subject: [PATCH 4/6] Release Zenko 2.6.62 Issue: ZENKO-4869 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 177d3e0d73..b3d94b847e 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -VERSION="2.6.61" +VERSION="2.6.62" VERSION_SUFFIX= From 4a3b36eb940232dd896f33cc7d59612719f29999 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 7 Aug 2024 14:47:24 +0200 Subject: [PATCH 5/6] Release Zenko 2.7.58 Issue: ZENKO-4869 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9c98fdccf0..d0d7613d7a 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -VERSION="2.7.57" +VERSION="2.7.58" VERSION_SUFFIX= From af1868c9cf8c0e36a92e0fa23ac9d90837d3079a Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Wed, 7 Aug 2024 14:48:48 +0200 Subject: [PATCH 6/6] Release Zenko 2.8.38 Issue: ZENKO-4869 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9b0062046f..253de34241 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -VERSION="2.8.37" +VERSION="2.8.38" VERSION_SUFFIX=