From 5728163cd6ac3a4b261643572af09f0bfff89021 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:24:16 +0100 Subject: [PATCH 01/27] updatecli: dynamic specs --- .ci/updatecli.d/update-specs.yml | 89 ++++++++++---------------------- 1 file changed, 26 insertions(+), 63 deletions(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 55950c3688..1c94d1d00e 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -14,15 +14,25 @@ scms: username: '{{ requiredEnv "GIT_USER" }}' branch: main + apm-data: + kind: github + spec: + user: '{{ requiredEnv "GIT_USER" }}' + email: '{{ requiredEnv "GIT_EMAIL" }}' + owner: elastic + repository: apm-data + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GIT_USER" }}' + branch: main + sources: sha: - kind: file + kind: shell spec: - file: 'https://github.com/elastic/apm-data/commit/main.patch' - matchpattern: "^From\\s([0-9a-f]{40})\\s" - transformers: - - findsubmatch: - pattern: "[0-9a-f]{40}" + command: gh api /repos/elastic/apm-data/commits --jq '.[0].sha' + environments: + - name: GITHUB_TOKEN + - name: PATH pull_request: kind: shell dependson: @@ -32,26 +42,13 @@ sources: environments: - name: GITHUB_TOKEN - name: PATH - error.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/error.json - metadata.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/metadata.json - metricset.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/metricset.json - span.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/span.json - transaction.json: - kind: file + tarball: + kind: shell + scmid: apm-data spec: - file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/transaction.json + command: cd input/elasticapm/docs/spec/v2 && tar cvzf /tmp/tarball.tgz . + environments: + - name: PATH actions: pr: @@ -74,43 +71,9 @@ actions: * https://github.com/elastic/apm-data/commit/{{ source "sha" }} targets: - error.json: - name: error.json + files.json: scmid: default - sourceid: error.json - kind: file - spec: - file: apm-agent-core/src/test/resources/apm-server-schema/current/error.json - forcecreate: true - metadata.json: - name: metadata.json - scmid: default - sourceid: metadata.json - kind: file - spec: - file: apm-agent-core/src/test/resources/apm-server-schema/current/metadata.json - forcecreate: true - metricset.json: - name: metricset.json - scmid: default - sourceid: metricset.json - kind: file - spec: - file: apm-agent-core/src/test/resources/apm-server-schema/current/metricset.json - forcecreate: true - span.json: - name: span.json - scmid: default - sourceid: span.json - kind: file - spec: - file: apm-agent-core/src/test/resources/apm-server-schema/current/span.json - forcecreate: true - transaction.json: - name: transaction.json - scmid: default - sourceid: transaction.json - kind: file + sourceid: tarball + kind: shell spec: - file: apm-agent-core/src/test/resources/apm-server-schema/current/transaction.json - forcecreate: true + command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf /tmp/tarball.tgz From 61bb0def529ae3c7d6f9bfbae317ccd76ab8ccc4 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:28:15 +0100 Subject: [PATCH 02/27] partially revert --- .ci/updatecli.d/update-specs.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 1c94d1d00e..4f769eb73f 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -27,12 +27,13 @@ scms: sources: sha: - kind: shell + kind: file spec: - command: gh api /repos/elastic/apm-data/commits --jq '.[0].sha' - environments: - - name: GITHUB_TOKEN - - name: PATH + file: 'https://github.com/elastic/apm-data/commit/main.patch' + matchpattern: "^From\\s([0-9a-f]{40})\\s" + transformers: + - findsubmatch: + pattern: "[0-9a-f]{40}" pull_request: kind: shell dependson: From f839cce0105a459c445a12a055957787d2700d11 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:32:21 +0100 Subject: [PATCH 03/27] use unique name --- .ci/updatecli.d/update-specs.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 4f769eb73f..6ef5d07f8c 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -46,8 +46,10 @@ sources: tarball: kind: shell scmid: apm-data + dependson: + - sha spec: - command: cd input/elasticapm/docs/spec/v2 && tar cvzf /tmp/tarball.tgz . + command: cd input/elasticapm/docs/spec/v2 && tar cvzf /tmp/tarball-{{ source "sha" }}.tgz . environments: - name: PATH @@ -72,9 +74,10 @@ actions: * https://github.com/elastic/apm-data/commit/{{ source "sha" }} targets: - files.json: + agent-json-schema: + name: APM agent json schema {{ source "sha" }} scmid: default - sourceid: tarball + sourceid: sha kind: shell spec: - command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf /tmp/tarball.tgz + command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf /tmp/tarball-{{ source "sha" }}.tgz From 1d042c0a9b80485ce005bf37a3c34249faa457b8 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:35:31 +0100 Subject: [PATCH 04/27] use same name --- .ci/updatecli.d/update-specs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 6ef5d07f8c..413c2be8c0 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -49,7 +49,7 @@ sources: dependson: - sha spec: - command: cd input/elasticapm/docs/spec/v2 && tar cvzf /tmp/tarball-{{ source "sha" }}.tgz . + command: cd input/elasticapm/docs/spec/v2 && tar cvzf /tmp/tarball.tgz . environments: - name: PATH @@ -80,4 +80,4 @@ targets: sourceid: sha kind: shell spec: - command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf /tmp/tarball-{{ source "sha" }}.tgz + command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf /tmp/tarball.tgz From 8c31e56448df421d682ebc7ed3d11a32eac9619e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:40:34 +0100 Subject: [PATCH 05/27] use workspace to store the artifact --- .ci/updatecli.d/update-specs.yml | 4 ++-- .github/workflows/updatecli.yml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 413c2be8c0..616a6d52b3 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -49,7 +49,7 @@ sources: dependson: - sha spec: - command: cd input/elasticapm/docs/spec/v2 && tar cvzf /tmp/tarball.tgz . + command: cd input/elasticapm/docs/spec/v2 && tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . environments: - name: PATH @@ -80,4 +80,4 @@ targets: sourceid: sha kind: shell spec: - command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf /tmp/tarball.tgz + command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index da856a81fe..d78ecd6593 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -26,3 +26,8 @@ jobs: vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} slackChannel: "#apm-agent-java" + - if: always() + uses: actions/upload-artifact@v3 + with: + name: specs + path: tarball.tgz From 1968605c620f596a9a509f539098d3091d6c5bcf Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:40:53 +0100 Subject: [PATCH 06/27] avoid spamming --- .github/workflows/updatecli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index d78ecd6593..b66627467f 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -25,7 +25,7 @@ jobs: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - slackChannel: "#apm-agent-java" + slackChannel: "#on-week-oblt-productivity" - if: always() uses: actions/upload-artifact@v3 with: From 51ed7567033e86aba9be53ac2338ab4b433457d4 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:41:15 +0100 Subject: [PATCH 07/27] testing --- .github/workflows/updatecli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index b66627467f..1a54a5f549 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -18,7 +18,7 @@ jobs: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - pipeline: .ci/updatecli.d + pipeline: .ci/updatecli.d/update-specs.yml - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current with: From bbefd63a50802c3d396b59d74fe20b6149cc6e1b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:44:08 +0100 Subject: [PATCH 08/27] avoid --- .github/workflows/updatecli.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index 1a54a5f549..968cded0cf 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -19,6 +19,7 @@ jobs: vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} pipeline: .ci/updatecli.d/update-specs.yml + notifySlackChannel: "#on-week-oblt-productivity" - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current with: From c1e1e833ad47aa4bdc33c48ce9698a3c3666f961 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 16:44:14 +0100 Subject: [PATCH 09/27] use a different source --- .ci/updatecli.d/update-specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 616a6d52b3..58c46711f9 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -77,7 +77,7 @@ targets: agent-json-schema: name: APM agent json schema {{ source "sha" }} scmid: default - sourceid: sha + sourceid: tarball kind: shell spec: command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz From 828a177f03ffc371d0ae91dd6da2330fd2481eaf Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 17:38:42 +0100 Subject: [PATCH 10/27] use script file --- .ci/scripts/update-specs.sh | 9 +++++++++ .ci/updatecli.d/update-specs.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 .ci/scripts/update-specs.sh diff --git a/.ci/scripts/update-specs.sh b/.ci/scripts/update-specs.sh new file mode 100755 index 0000000000..bac4c53a09 --- /dev/null +++ b/.ci/scripts/update-specs.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Bash strict mode +set -eo pipefail + +cd apm-agent-core/src/test/resources/apm-server-schema/current +ls -l . +tar -xvzf $1 || true +ls -ltra . diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 58c46711f9..82d489b4d1 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -80,4 +80,4 @@ targets: sourceid: tarball kind: shell spec: - command: cd apm-agent-core/src/test/resources/apm-server-schema/current && tar xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz + command: .ci/scripts/update-specs.sh {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz From 7191385c254ec95731aa5bd683dd2a7c98660c3b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 17:39:46 +0100 Subject: [PATCH 11/27] fix deprecated --- .ci/updatecli.d/update-specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 82d489b4d1..0593cffe6a 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -58,7 +58,7 @@ actions: kind: "github/pullrequest" scmid: default sourceid: sha - title: '[Automation] Update JSON schema specs' + name: '[Automation] Update JSON schema specs' spec: automerge: false draft: false From 632c2e72ec90ac8c9e66784844fa213d315ecea6 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 17:43:10 +0100 Subject: [PATCH 12/27] use env --- .ci/updatecli.d/update-specs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 0593cffe6a..fb8ebba04a 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -43,7 +43,7 @@ sources: environments: - name: GITHUB_TOKEN - name: PATH - tarball: + agent-specs-tarball: kind: shell scmid: apm-data dependson: @@ -77,7 +77,10 @@ targets: agent-json-schema: name: APM agent json schema {{ source "sha" }} scmid: default - sourceid: tarball + sourceid: agent-specs-tarball kind: shell spec: command: .ci/scripts/update-specs.sh {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz + environments: + - name: PATH + - name: HOME From 1fb0160fec1b4a3d8b80a4de5db8d6922b5279f9 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 17:53:40 +0100 Subject: [PATCH 13/27] use the pipeline itself --- .ci/scripts/update-specs.sh | 9 --------- .ci/updatecli.d/update-specs.yml | 10 ++++------ 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100755 .ci/scripts/update-specs.sh diff --git a/.ci/scripts/update-specs.sh b/.ci/scripts/update-specs.sh deleted file mode 100755 index bac4c53a09..0000000000 --- a/.ci/scripts/update-specs.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Bash strict mode -set -eo pipefail - -cd apm-agent-core/src/test/resources/apm-server-schema/current -ls -l . -tar -xvzf $1 || true -ls -ltra . diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index fb8ebba04a..4066420057 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -1,6 +1,5 @@ name: update-specs pipelineid: update-schema-specs -title: synchronize schema specs scms: default: @@ -49,9 +48,10 @@ sources: dependson: - sha spec: - command: cd input/elasticapm/docs/spec/v2 && tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . + command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . environments: - name: PATH + workdir: input/elasticapm/docs/spec/v2 actions: pr: @@ -80,7 +80,5 @@ targets: sourceid: agent-specs-tarball kind: shell spec: - command: .ci/scripts/update-specs.sh {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz - environments: - - name: PATH - - name: HOME + command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz + workdir: apm-agent-core/src/test/resources/apm-server-schema/current From 47978a0b16dee487d769f29377140863df0aa16d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:01:25 +0100 Subject: [PATCH 14/27] solve sourceid input being appended --- .ci/updatecli.d/update-specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli.d/update-specs.yml index 4066420057..ebe43ecd6b 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli.d/update-specs.yml @@ -80,5 +80,5 @@ targets: sourceid: agent-specs-tarball kind: shell spec: - command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz + command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended workdir: apm-agent-core/src/test/resources/apm-server-schema/current From 10276b079e6272771cf58df86d5ecbfa6a332aa1 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:08:00 +0100 Subject: [PATCH 15/27] dynamic gherkin specs --- .ci/updatecli.d/update-gherkin-specs.yml | 98 +++++++----------------- 1 file changed, 26 insertions(+), 72 deletions(-) diff --git a/.ci/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli.d/update-gherkin-specs.yml index c55adeaa25..48d762da24 100644 --- a/.ci/updatecli.d/update-gherkin-specs.yml +++ b/.ci/updatecli.d/update-gherkin-specs.yml @@ -1,6 +1,5 @@ name: update-gherkin-specs pipelineid: update-gherkin-specs -title: synchronize gherkin specs scms: default: @@ -13,6 +12,16 @@ scms: token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' branch: main + apm: + kind: github + spec: + user: '{{ requiredEnv "GIT_USER" }}' + email: '{{ requiredEnv "GIT_EMAIL" }}' + owner: elastic + repository: apm + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GIT_USER" }}' + branch: main sources: sha: @@ -32,36 +41,22 @@ sources: environments: - name: GITHUB_TOKEN - name: PATH - api_key.feature: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/api_key.feature - azure_app_service_metadata.feature: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/azure_app_service_metadata.feature - azure_functions_metadata.feature: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/azure_functions_metadata.feature - otel_bridge.feature: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/otel_bridge.feature - outcome.feature: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/outcome.feature - user_agent.feature: - kind: file + agents-gherkin-specs-tarball: + kind: shell + scmid: apm + dependson: + - sha spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/user_agent.feature + command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . + environments: + - name: PATH + workdir: tests/agents/gherkin-specs actions: pr: kind: "github/pullrequest" scmid: default - title: '[Automation] Update Gherkin specs' + name: '[Automation] Update Gherkin specs' spec: automerge: false draft: false @@ -76,53 +71,12 @@ actions: * {{ source "pull_request" }} * https://github.com/elastic/apm/commit/{{ source "sha" }} - targets: - api_key.feature: - name: api_key.feature + agent-gherkin-specs: + name: APM agent gherkin specs {{ source "sha" }} scmid: default - sourceid: api_key.feature - kind: file - spec: - file: apm-agent-core/src/test/resources/specs/api_key.feature - forcecreate: true - azure_app_service_metadata.feature: - name: azure_app_service_metadata.feature - scmid: default - sourceid: azure_app_service_metadata.feature - kind: file - spec: - file: apm-agent-core/src/test/resources/specs/azure_app_service_metadata.feature - forcecreate: true - azure_functions_metadata.feature: - name: azure_functions_metadata.feature - scmid: default - sourceid: azure_functions_metadata.feature - kind: file - spec: - file: apm-agent-core/src/test/resources/specs/azure_functions_metadata.feature - forcecreate: true - otel_bridge.feature: - name: otel_bridge.feature - scmid: default - sourceid: otel_bridge.feature - kind: file - spec: - file: apm-agent-core/src/test/resources/specs/otel_bridge.feature - forcecreate: true - outcome.feature: - name: outcome.feature - scmid: default - sourceid: outcome.feature - kind: file - spec: - file: apm-agent-core/src/test/resources/specs/outcome.feature - forcecreate: true - user_agent.feature: - name: user_agent.feature - scmid: default - sourceid: user_agent.feature - kind: file + sourceid: agents-gherkin-specs-tarball + kind: shell spec: - file: apm-agent-core/src/test/resources/specs/user_agent.feature - forcecreate: true + command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended + workdir: apm-agent-core/src/test/resources/specs From 984c2672e08321aaa61a24ce2e48aade3da6cc6a Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:08:10 +0100 Subject: [PATCH 16/27] dynamic json specs --- .ci/updatecli.d/update-json-specs.yml | 103 +++++++------------------- 1 file changed, 27 insertions(+), 76 deletions(-) diff --git a/.ci/updatecli.d/update-json-specs.yml b/.ci/updatecli.d/update-json-specs.yml index 08900fb82b..77749440ad 100644 --- a/.ci/updatecli.d/update-json-specs.yml +++ b/.ci/updatecli.d/update-json-specs.yml @@ -1,6 +1,5 @@ name: update-json-specs pipelineid: update-json-specs -title: synchronize json specs scms: default: @@ -13,6 +12,16 @@ scms: token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' branch: main + apm: + kind: github + spec: + user: '{{ requiredEnv "GIT_USER" }}' + email: '{{ requiredEnv "GIT_EMAIL" }}' + owner: elastic + repository: apm + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GIT_USER" }}' + branch: main sources: sha: @@ -32,39 +41,22 @@ sources: environments: - name: GITHUB_TOKEN - name: PATH - container_metadata_discovery.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/container_metadata_discovery.json - service_resource_inference.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/service_resource_inference.json - span_types.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/span_types.json - sql_signature_examples.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/sql_signature_examples.json - sql_token_examples.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/sql_token_examples.json - w3c_distributed_tracing.json: - kind: file - spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/w3c_distributed_tracing.json - wildcard_matcher_tests.json: - kind: file + agents-json-specs-tarball: + kind: shell + scmid: apm + dependson: + - sha spec: - file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/wildcard_matcher_tests.json + command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . + environments: + - name: PATH + workdir: tests/agents/json-specs + actions: pr: kind: "github/pullrequest" scmid: default - title: '[Automation] Update JSON specs' + name: '[Automation] Update JSON specs' spec: automerge: false draft: false @@ -80,52 +72,11 @@ actions: * https://github.com/elastic/apm/commit/{{ source "sha" }} targets: - container_metadata_discovery.json: - name: container_metadata_discovery.json - scmid: default - sourceid: container_metadata_discovery.json - kind: file - spec: - file: apm-agent-core/src/test/resources/json-specs/container_metadata_discovery.json - service_resource_inference.json: - name: service_resource_inference.json - scmid: default - sourceid: service_resource_inference.json - kind: file - spec: - file: apm-agent-core/src/test/resources/json-specs/service_resource_inference.json - span_types.json: - name: span_types.json - scmid: default - sourceid: span_types.json - kind: file - spec: - file: apm-agent-core/src/test/resources/json-specs/span_types.json - sql_signature_examples.json: - name: sql_signature_examples.json + agent-json-specs: + name: APM agent json specs {{ source "sha" }} scmid: default - sourceid: sql_signature_examples.json - kind: file - spec: - file: apm-agent-plugin-sdk/src/test/resources/json-specs/sql_signature_examples.json - sql_token_examples.json: - name: sql_token_examples.json - scmid: default - sourceid: sql_token_examples.json - kind: file - spec: - file: apm-agent-plugin-sdk/src/test/resources/json-specs/sql_token_examples.json - w3c_distributed_tracing.json: - name: w3c_distributed_tracing.json - scmid: default - sourceid: w3c_distributed_tracing.json - kind: file - spec: - file: apm-agent-core/src/test/resources/json-specs/w3c_distributed_tracing.json - wildcard_matcher_tests.json: - name: wildcard_matcher_tests.json - scmid: default - sourceid: wildcard_matcher_tests.json - kind: file + sourceid: agents-json-specs-tarball + kind: shell spec: - file: apm-agent-core/src/test/resources/json-specs/wildcard_matcher_tests.json + command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended + workdir: apm-agent-core/src/test/resources/json-specs From 8979f842c12954fb046eb0472b52fa5bacfa57ae Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:08:36 +0100 Subject: [PATCH 17/27] revert --- .github/workflows/updatecli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index 968cded0cf..eb02346be5 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -18,7 +18,7 @@ jobs: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - pipeline: .ci/updatecli.d/update-specs.yml + pipeline: .ci/updatecli.d notifySlackChannel: "#on-week-oblt-productivity" - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current From 904908e52d000b8b83a52f461f87d5a0279b27fe Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:32:01 +0100 Subject: [PATCH 18/27] use values --- .../updatecli.d/update-gherkin-specs.yml | 20 ++++++++--------- .../updatecli.d/update-json-specs.yml | 22 +++++++++---------- .../updatecli.d/update-specs.yml | 22 +++++++++---------- .ci/updatecli/values.yml | 14 ++++++++++++ .github/workflows/updatecli.yml | 3 ++- 5 files changed, 48 insertions(+), 33 deletions(-) rename .ci/{ => updatecli}/updatecli.d/update-gherkin-specs.yml (75%) rename .ci/{ => updatecli}/updatecli.d/update-json-specs.yml (71%) rename .ci/{ => updatecli}/updatecli.d/update-specs.yml (70%) create mode 100644 .ci/updatecli/values.yml diff --git a/.ci/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml similarity index 75% rename from .ci/updatecli.d/update-gherkin-specs.yml rename to .ci/updatecli/updatecli.d/update-gherkin-specs.yml index 48d762da24..a0c5e4c54c 100644 --- a/.ci/updatecli.d/update-gherkin-specs.yml +++ b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml @@ -7,27 +7,27 @@ scms: spec: user: '{{ requiredEnv "GIT_USER" }}' email: '{{ requiredEnv "GIT_EMAIL" }}' - owner: elastic - repository: apm-agent-java + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' - branch: main + branch: "{{ .github.branch }}" apm: kind: github spec: user: '{{ requiredEnv "GIT_USER" }}' email: '{{ requiredEnv "GIT_EMAIL" }}' - owner: elastic - repository: apm + owner: "{{ .github.owner }}" + repository: "{{ .github.apm_repository }}" token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' - branch: main + branch: "{{ .github.branch }}" sources: sha: kind: file spec: - file: 'https://github.com/elastic/apm/commit/main.patch' + file: 'https://github.com/{{ .github.owner }}/{{ .github.apm_repository }}/commit/{{ .github.branch }}.patch' matchpattern: "^From\\s([0-9a-f]{40})\\s" transformers: - findsubmatch: @@ -37,7 +37,7 @@ sources: dependson: - sha spec: - command: gh api /repos/elastic/apm/commits/{{ source "sha" }}/pulls --jq '.[].html_url' + command: gh api /repos/{{ .github.owner }}/{{ .github.apm_repository }}/commits/{{ source "sha" }}/pulls --jq '.[].html_url' environments: - name: GITHUB_TOKEN - name: PATH @@ -50,7 +50,7 @@ sources: command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . environments: - name: PATH - workdir: tests/agents/gherkin-specs + workdir: "{{ .specs.apm_gherkin_path }}" actions: pr: @@ -79,4 +79,4 @@ targets: kind: shell spec: command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended - workdir: apm-agent-core/src/test/resources/specs + workdir: "{{ .apm_agent.gherkin_specs_path }}" diff --git a/.ci/updatecli.d/update-json-specs.yml b/.ci/updatecli/updatecli.d/update-json-specs.yml similarity index 71% rename from .ci/updatecli.d/update-json-specs.yml rename to .ci/updatecli/updatecli.d/update-json-specs.yml index 77749440ad..9fdb08c155 100644 --- a/.ci/updatecli.d/update-json-specs.yml +++ b/.ci/updatecli/updatecli.d/update-json-specs.yml @@ -7,27 +7,27 @@ scms: spec: user: '{{ requiredEnv "GIT_USER" }}' email: '{{ requiredEnv "GIT_EMAIL" }}' - owner: elastic - repository: apm-agent-java + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' - branch: main + branch: "{{ .github.branch }}" apm: kind: github spec: user: '{{ requiredEnv "GIT_USER" }}' email: '{{ requiredEnv "GIT_EMAIL" }}' - owner: elastic - repository: apm + owner: "{{ .github.owner }}" + repository: "{{ .github.apm_repository }}" token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' - branch: main + branch: "{{ .github.branch }}" sources: sha: kind: file spec: - file: 'https://github.com/elastic/apm/commit/main.patch' + file: 'https://github.com/{{ .github.owner }}/{{ .github.apm_repository }}/commit/{{ .github.branch }}.patch' matchpattern: "^From\\s([0-9a-f]{40})\\s" transformers: - findsubmatch: @@ -37,7 +37,7 @@ sources: dependson: - sha spec: - command: gh api /repos/elastic/apm/commits/{{ source "sha" }}/pulls --jq '.[].html_url' + command: gh api /repos/{{ .github.owner }}/{{ .github.apm_repository }}/commits/{{ source "sha" }}/pulls --jq '.[].html_url' environments: - name: GITHUB_TOKEN - name: PATH @@ -50,7 +50,7 @@ sources: command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . environments: - name: PATH - workdir: tests/agents/json-specs + workdir: "{{ .specs.apm_json_path }}" actions: pr: @@ -69,7 +69,7 @@ actions: ### Why *Changeset* * {{ source "pull_request" }} - * https://github.com/elastic/apm/commit/{{ source "sha" }} + * https://github.com/{{ .github.owner }}/{{ .github.apm_repository }}/commit/{{ source "sha" }} targets: agent-json-specs: @@ -79,4 +79,4 @@ targets: kind: shell spec: command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended - workdir: apm-agent-core/src/test/resources/json-specs + workdir: "{{ .apm_agent.json_specs_path }}" diff --git a/.ci/updatecli.d/update-specs.yml b/.ci/updatecli/updatecli.d/update-specs.yml similarity index 70% rename from .ci/updatecli.d/update-specs.yml rename to .ci/updatecli/updatecli.d/update-specs.yml index ebe43ecd6b..3972c5a5dd 100644 --- a/.ci/updatecli.d/update-specs.yml +++ b/.ci/updatecli/updatecli.d/update-specs.yml @@ -7,28 +7,28 @@ scms: spec: user: '{{ requiredEnv "GIT_USER" }}' email: '{{ requiredEnv "GIT_EMAIL" }}' - owner: elastic - repository: apm-agent-java + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' - branch: main + branch: "{{ .github.branch }}" apm-data: kind: github spec: user: '{{ requiredEnv "GIT_USER" }}' email: '{{ requiredEnv "GIT_EMAIL" }}' - owner: elastic - repository: apm-data + owner: "{{ .github.owner }}" + repository: "{{ .github.apm_data_repository }}" token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GIT_USER" }}' - branch: main + branch: "{{ .github.branch }}" sources: sha: kind: file spec: - file: 'https://github.com/elastic/apm-data/commit/main.patch' + file: 'https://github.com/{{ .github.owner }}/{{ .github.apm_data_repository }}/commit/{{ .github.branch }}.patch' matchpattern: "^From\\s([0-9a-f]{40})\\s" transformers: - findsubmatch: @@ -38,7 +38,7 @@ sources: dependson: - sha spec: - command: gh api /repos/elastic/apm-data/commits/{{ source "sha" }}/pulls --jq '.[].html_url' + command: gh api /repos/{{ .github.owner }}/{{ .github.apm_data_repository }}/commits/{{ source "sha" }}/pulls --jq '.[].html_url' environments: - name: GITHUB_TOKEN - name: PATH @@ -51,7 +51,7 @@ sources: command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . environments: - name: PATH - workdir: input/elasticapm/docs/spec/v2 + workdir: "{{ .specs.apm_data_path }}" actions: pr: @@ -71,7 +71,7 @@ actions: ### Why *Changeset* * {{ source "pull_request" }} - * https://github.com/elastic/apm-data/commit/{{ source "sha" }} + * https://github.com/{{ .github.owner }}/{{ .github.apm_data_repository }}/commit/{{ source "sha" }} targets: agent-json-schema: @@ -81,4 +81,4 @@ targets: kind: shell spec: command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended - workdir: apm-agent-core/src/test/resources/apm-server-schema/current + workdir: "{{ .apm_agent.server_schema_specs_path }}" diff --git a/.ci/updatecli/values.yml b/.ci/updatecli/values.yml new file mode 100644 index 0000000000..38a4f19bc2 --- /dev/null +++ b/.ci/updatecli/values.yml @@ -0,0 +1,14 @@ +github: + owner: "v1v" + repository: "apm-agent-java" + apm_repository: "apm" + apm_data_repository: "apm-data" + branch: "main" +specs: + apm_data_path: "input/elasticapm/docs/spec/v2" + apm_json_path: "tests/agents/json-specs" + apm_gherkin_path: "tests/agents/gherkin-specs" +apm_agent: + gherkin_specs_path: "apm-agent-core/src/test/resources/specs" + json_specs_path: "apm-agent-core/src/test/resources/json-specs" + server_schema_specs_path: "apm-agent-core/src/test/resources/apm-server-schema/current" \ No newline at end of file diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index eb02346be5..acd8e492b9 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -18,7 +18,8 @@ jobs: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - pipeline: .ci/updatecli.d + pipeline: .ci/updatecli/updatecli.d + values: .ci/updatecli/values.yml notifySlackChannel: "#on-week-oblt-productivity" - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current From 35deb8e77561466d94231d535725c047f9611342 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:40:03 +0100 Subject: [PATCH 19/27] use single quotes --- .ci/updatecli/updatecli.d/update-gherkin-specs.yml | 4 ++-- .ci/updatecli/updatecli.d/update-json-specs.yml | 4 ++-- .ci/updatecli/updatecli.d/update-specs.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml index a0c5e4c54c..5226a5fb86 100644 --- a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +++ b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml @@ -75,8 +75,8 @@ targets: agent-gherkin-specs: name: APM agent gherkin specs {{ source "sha" }} scmid: default - sourceid: agents-gherkin-specs-tarball + sourceid: sha kind: shell spec: - command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended' workdir: "{{ .apm_agent.gherkin_specs_path }}" diff --git a/.ci/updatecli/updatecli.d/update-json-specs.yml b/.ci/updatecli/updatecli.d/update-json-specs.yml index 9fdb08c155..8bfa59c72c 100644 --- a/.ci/updatecli/updatecli.d/update-json-specs.yml +++ b/.ci/updatecli/updatecli.d/update-json-specs.yml @@ -75,8 +75,8 @@ targets: agent-json-specs: name: APM agent json specs {{ source "sha" }} scmid: default - sourceid: agents-json-specs-tarball + sourceid: sha kind: shell spec: - command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended' workdir: "{{ .apm_agent.json_specs_path }}" diff --git a/.ci/updatecli/updatecli.d/update-specs.yml b/.ci/updatecli/updatecli.d/update-specs.yml index 3972c5a5dd..1e6d0e35b1 100644 --- a/.ci/updatecli/updatecli.d/update-specs.yml +++ b/.ci/updatecli/updatecli.d/update-specs.yml @@ -77,8 +77,8 @@ targets: agent-json-schema: name: APM agent json schema {{ source "sha" }} scmid: default - sourceid: agent-specs-tarball + sourceid: sha kind: shell spec: - command: tar -xvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended' workdir: "{{ .apm_agent.server_schema_specs_path }}" From 2844d778fb403367a601e1b37e6ce7d0a0744a1f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:45:30 +0100 Subject: [PATCH 20/27] use production --- .ci/updatecli/values.yml | 2 +- .github/workflows/updatecli.yml | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.ci/updatecli/values.yml b/.ci/updatecli/values.yml index 38a4f19bc2..5d1e74685f 100644 --- a/.ci/updatecli/values.yml +++ b/.ci/updatecli/values.yml @@ -1,5 +1,5 @@ github: - owner: "v1v" + owner: "elastic" repository: "apm-agent-java" apm_repository: "apm" apm_data_repository: "apm-data" diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index acd8e492b9..1bfd2967b3 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -20,16 +20,10 @@ jobs: vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} pipeline: .ci/updatecli/updatecli.d values: .ci/updatecli/values.yml - notifySlackChannel: "#on-week-oblt-productivity" - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current with: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - slackChannel: "#on-week-oblt-productivity" - - if: always() - uses: actions/upload-artifact@v3 - with: - name: specs - path: tarball.tgz + slackChannel: "#apm-agent-java" From 533c8a1b672a66e1c95c940417a3b6b5f92b8c35 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:47:04 +0100 Subject: [PATCH 21/27] cosmetic --- .ci/updatecli/updatecli.d/update-gherkin-specs.yml | 4 ++-- .ci/updatecli/updatecli.d/update-json-specs.yml | 4 ++-- .ci/updatecli/updatecli.d/update-specs.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml index 5226a5fb86..872596bced 100644 --- a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +++ b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml @@ -47,7 +47,7 @@ sources: dependson: - sha spec: - command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . + command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/gherkin-specs.tgz . environments: - name: PATH workdir: "{{ .specs.apm_gherkin_path }}" @@ -78,5 +78,5 @@ targets: sourceid: sha kind: shell spec: - command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended' + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/gherkin-specs.tgz && git --no-pager diff # required to ignore the sourceid being appended' workdir: "{{ .apm_agent.gherkin_specs_path }}" diff --git a/.ci/updatecli/updatecli.d/update-json-specs.yml b/.ci/updatecli/updatecli.d/update-json-specs.yml index 8bfa59c72c..5a88ff28d5 100644 --- a/.ci/updatecli/updatecli.d/update-json-specs.yml +++ b/.ci/updatecli/updatecli.d/update-json-specs.yml @@ -47,7 +47,7 @@ sources: dependson: - sha spec: - command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . + command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-specs.tgz . environments: - name: PATH workdir: "{{ .specs.apm_json_path }}" @@ -78,5 +78,5 @@ targets: sourceid: sha kind: shell spec: - command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended' + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-specs.tgz && git --no-pager diff # required to ignore the sourceid being appended' workdir: "{{ .apm_agent.json_specs_path }}" diff --git a/.ci/updatecli/updatecli.d/update-specs.yml b/.ci/updatecli/updatecli.d/update-specs.yml index 1e6d0e35b1..67c0eab5eb 100644 --- a/.ci/updatecli/updatecli.d/update-specs.yml +++ b/.ci/updatecli/updatecli.d/update-specs.yml @@ -48,7 +48,7 @@ sources: dependson: - sha spec: - command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz . + command: tar cvzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-schema.tgz . environments: - name: PATH workdir: "{{ .specs.apm_data_path }}" @@ -66,7 +66,7 @@ actions: - "automation" description: |- ### What - APM agent json schema automatic sync + APM agent json server schema automatic sync ### Why *Changeset* @@ -75,10 +75,10 @@ actions: targets: agent-json-schema: - name: APM agent json schema {{ source "sha" }} + name: APM agent json server schema {{ source "sha" }} scmid: default sourceid: sha kind: shell spec: - command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/tarball.tgz && git --no-pager diff # required to ignore the sourceid being appended' + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-schema.tgz && git --no-pager diff # required to ignore the sourceid being appended' workdir: "{{ .apm_agent.server_schema_specs_path }}" From e18b699135c201dd23b9e69d7026e3f792c1a118 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:47:37 +0100 Subject: [PATCH 22/27] Revert "use production" This reverts commit 2844d778fb403367a601e1b37e6ce7d0a0744a1f. --- .ci/updatecli/values.yml | 2 +- .github/workflows/updatecli.yml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.ci/updatecli/values.yml b/.ci/updatecli/values.yml index 5d1e74685f..38a4f19bc2 100644 --- a/.ci/updatecli/values.yml +++ b/.ci/updatecli/values.yml @@ -1,5 +1,5 @@ github: - owner: "elastic" + owner: "v1v" repository: "apm-agent-java" apm_repository: "apm" apm_data_repository: "apm-data" diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index 1bfd2967b3..acd8e492b9 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -20,10 +20,16 @@ jobs: vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} pipeline: .ci/updatecli/updatecli.d values: .ci/updatecli/values.yml + notifySlackChannel: "#on-week-oblt-productivity" - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current with: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - slackChannel: "#apm-agent-java" + slackChannel: "#on-week-oblt-productivity" + - if: always() + uses: actions/upload-artifact@v3 + with: + name: specs + path: tarball.tgz From 2970e2def548121bb5391ffbb3aef78118478aae Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:47:57 +0100 Subject: [PATCH 23/27] use production --- .ci/updatecli/values.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/updatecli/values.yml b/.ci/updatecli/values.yml index 38a4f19bc2..5d1e74685f 100644 --- a/.ci/updatecli/values.yml +++ b/.ci/updatecli/values.yml @@ -1,5 +1,5 @@ github: - owner: "v1v" + owner: "elastic" repository: "apm-agent-java" apm_repository: "apm" apm_data_repository: "apm-data" From e646d68d344beb7c7d9494fa743b96ff3161ed9a Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 18:48:38 +0100 Subject: [PATCH 24/27] notify the right teams --- .github/workflows/updatecli.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index acd8e492b9..1bfd2967b3 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -20,16 +20,10 @@ jobs: vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} pipeline: .ci/updatecli/updatecli.d values: .ci/updatecli/values.yml - notifySlackChannel: "#on-week-oblt-productivity" - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current with: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - slackChannel: "#on-week-oblt-productivity" - - if: always() - uses: actions/upload-artifact@v3 - with: - name: specs - path: tarball.tgz + slackChannel: "#apm-agent-java" From abb4c6fd10866a170d210906b50328002c628cac Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Jan 2024 21:32:11 +0100 Subject: [PATCH 25/27] use the title for the PR --- .ci/updatecli/updatecli.d/update-gherkin-specs.yml | 2 +- .ci/updatecli/updatecli.d/update-json-specs.yml | 2 +- .ci/updatecli/updatecli.d/update-specs.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml index 872596bced..dd5be98263 100644 --- a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +++ b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml @@ -56,7 +56,6 @@ actions: pr: kind: "github/pullrequest" scmid: default - name: '[Automation] Update Gherkin specs' spec: automerge: false draft: false @@ -70,6 +69,7 @@ actions: *Changeset* * {{ source "pull_request" }} * https://github.com/elastic/apm/commit/{{ source "sha" }} + title: '[Automation] Update Gherkin specs' targets: agent-gherkin-specs: diff --git a/.ci/updatecli/updatecli.d/update-json-specs.yml b/.ci/updatecli/updatecli.d/update-json-specs.yml index 5a88ff28d5..148241d907 100644 --- a/.ci/updatecli/updatecli.d/update-json-specs.yml +++ b/.ci/updatecli/updatecli.d/update-json-specs.yml @@ -56,7 +56,6 @@ actions: pr: kind: "github/pullrequest" scmid: default - name: '[Automation] Update JSON specs' spec: automerge: false draft: false @@ -70,6 +69,7 @@ actions: *Changeset* * {{ source "pull_request" }} * https://github.com/{{ .github.owner }}/{{ .github.apm_repository }}/commit/{{ source "sha" }} + title: '[Automation] Update JSON specs' targets: agent-json-specs: diff --git a/.ci/updatecli/updatecli.d/update-specs.yml b/.ci/updatecli/updatecli.d/update-specs.yml index 67c0eab5eb..0be8fa56a8 100644 --- a/.ci/updatecli/updatecli.d/update-specs.yml +++ b/.ci/updatecli/updatecli.d/update-specs.yml @@ -58,7 +58,6 @@ actions: kind: "github/pullrequest" scmid: default sourceid: sha - name: '[Automation] Update JSON schema specs' spec: automerge: false draft: false @@ -72,6 +71,7 @@ actions: *Changeset* * {{ source "pull_request" }} * https://github.com/{{ .github.owner }}/{{ .github.apm_data_repository }}/commit/{{ source "sha" }} + title: '[Automation] Update JSON server schema specs' targets: agent-json-schema: From 8e866912a0c454dde3aaf93ae4fa61468bce07a7 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Jan 2024 09:29:25 +0100 Subject: [PATCH 26/27] updatecli: avoid appending the sourceid see https://www.updatecli.io/docs/plugins/resource/shell/\#_shell_condition --- .ci/updatecli/updatecli.d/update-specs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/updatecli/updatecli.d/update-specs.yml b/.ci/updatecli/updatecli.d/update-specs.yml index 0be8fa56a8..2b3f34ef80 100644 --- a/.ci/updatecli/updatecli.d/update-specs.yml +++ b/.ci/updatecli/updatecli.d/update-specs.yml @@ -77,8 +77,8 @@ targets: agent-json-schema: name: APM agent json server schema {{ source "sha" }} scmid: default - sourceid: sha + disablesourceinput: true kind: shell spec: - command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-schema.tgz && git --no-pager diff # required to ignore the sourceid being appended' + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-schema.tgz && git --no-pager diff' workdir: "{{ .apm_agent.server_schema_specs_path }}" From 0e283532a7490b7d1367bba434cb3cf9668b46db Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Jan 2024 09:43:12 +0100 Subject: [PATCH 27/27] updatecli: avoid appending the sourceid see https://www.updatecli.io/docs/plugins/resource/shell/\#_shell_condition --- .ci/updatecli/updatecli.d/update-gherkin-specs.yml | 4 ++-- .ci/updatecli/updatecli.d/update-json-specs.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml index dd5be98263..4515026c32 100644 --- a/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +++ b/.ci/updatecli/updatecli.d/update-gherkin-specs.yml @@ -75,8 +75,8 @@ targets: agent-gherkin-specs: name: APM agent gherkin specs {{ source "sha" }} scmid: default - sourceid: sha + disablesourceinput: true kind: shell spec: - command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/gherkin-specs.tgz && git --no-pager diff # required to ignore the sourceid being appended' + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/gherkin-specs.tgz && git --no-pager diff' workdir: "{{ .apm_agent.gherkin_specs_path }}" diff --git a/.ci/updatecli/updatecli.d/update-json-specs.yml b/.ci/updatecli/updatecli.d/update-json-specs.yml index 148241d907..0856990f96 100644 --- a/.ci/updatecli/updatecli.d/update-json-specs.yml +++ b/.ci/updatecli/updatecli.d/update-json-specs.yml @@ -75,8 +75,8 @@ targets: agent-json-specs: name: APM agent json specs {{ source "sha" }} scmid: default - sourceid: sha + disablesourceinput: true kind: shell spec: - command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-specs.tgz && git --no-pager diff # required to ignore the sourceid being appended' + command: 'tar -xzf {{ requiredEnv "GITHUB_WORKSPACE" }}/json-specs.tgz && git --no-pager diff' workdir: "{{ .apm_agent.json_specs_path }}"