diff --git a/.ci/updatecli.d/update-gherkin-specs.yml b/.ci/updatecli.d/update-gherkin-specs.yml new file mode 100644 index 000000000..f3fc4217b --- /dev/null +++ b/.ci/updatecli.d/update-gherkin-specs.yml @@ -0,0 +1,117 @@ +name: update-gherkin-specs +pipelineid: update-gherkin-specs +title: synchronize gherkin specs + +scms: + default: + kind: github + spec: + user: '{{ requiredEnv "GIT_USER" }}' + email: '{{ requiredEnv "GIT_EMAIL" }}' + owner: elastic + repository: apm-agent-ruby + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GIT_USER" }}' + branch: main + +sources: + sha: + kind: file + spec: + file: 'https://github.com/elastic/apm/commit/main.patch' + matchpattern: "^From\\s([0-9a-f]{40})\\s" + transformers: + - findsubmatch: + pattern: "[0-9a-f]{40}" + + 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 + spec: + file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/user_agent.feature + +actions: + pr: + kind: "github/pullrequest" + scmid: default + title: '[Automation] Update Gherkin specs' + spec: + automerge: false + draft: false + labels: + - "automation" + description: |- + ### What + APM agent Gherkin specs automatic sync + ### Why + *Changeset* + * https://github.com/elastic/apm/commit/{{ source "sha" }} + +targets: + api_key.feature: + name: api_key.feature + scmid: default + sourceid: api_key.feature + kind: file + spec: + file: features/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: features/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: features/azure_functions_metadata.feature + forcecreate: true + otel_bridge.feature: + name: otel_bridge.feature + scmid: default + sourceid: otel_bridge.feature + kind: file + spec: + file: features/otel_bridge.feature + forcecreate: true + outcome.feature: + name: outcome.feature + scmid: default + sourceid: outcome.feature + kind: file + spec: + file: features/outcome.feature + forcecreate: true + user_agent.feature: + name: user_agent.feature + scmid: default + sourceid: user_agent.feature + kind: file + spec: + file: features/user_agent.feature + forcecreate: true diff --git a/.ci/updatecli.d/update-json-specs.yml b/.ci/updatecli.d/update-json-specs.yml new file mode 100644 index 000000000..2c3cfec61 --- /dev/null +++ b/.ci/updatecli.d/update-json-specs.yml @@ -0,0 +1,121 @@ +name: update-json-specs +pipelineid: update-json-specs +title: synchronize json specs + +scms: + default: + kind: github + spec: + user: '{{ requiredEnv "GIT_USER" }}' + email: '{{ requiredEnv "GIT_EMAIL" }}' + owner: elastic + repository: apm-agent-ruby + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GIT_USER" }}' + branch: main + +sources: + sha: + kind: file + spec: + file: 'https://github.com/elastic/apm/commit/main.patch' + matchpattern: "^From\\s([0-9a-f]{40})\\s" + transformers: + - findsubmatch: + pattern: "[0-9a-f]{40}" + + cgroup_parsing.json: + kind: file + spec: + file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/cgroup_parsing.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 + spec: + file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/wildcard_matcher_tests.json +actions: + pr: + kind: "github/pullrequest" + scmid: default + title: '[Automation] Update JSON specs' + spec: + automerge: false + draft: false + labels: + - "automation" + description: |- + ### What + APM agent specs automatic sync + ### Why + *Changeset* + * https://github.com/elastic/apm/commit/{{ source "sha" }} + +targets: + cgroup_parsing.json: + name: cgroup_parsing.json + scmid: default + sourceid: cgroup_parsing.json + kind: file + spec: + file: spec/fixtures/cgroup_parsing.json + service_resource_inference.json: + name: service_resource_inference.json + scmid: default + sourceid: service_resource_inference.json + kind: file + spec: + file: spec/fixtures/service_resource_inference.json + span_types.json: + name: span_types.json + scmid: default + sourceid: span_types.json + kind: file + spec: + file: spec/fixtures/span_types.json + sql_signature_examples.json: + name: sql_signature_examples.json + scmid: default + sourceid: sql_signature_examples.json + kind: file + spec: + file: spec/fixtures/sql_signature_examples.json + sql_token_examples.json: + name: sql_token_examples.json + scmid: default + sourceid: sql_token_examples.json + kind: file + spec: + file: spec/fixtures/sql_token_examples.json + w3c_distributed_tracing.json: + name: w3c_distributed_tracing.json + scmid: default + sourceid: w3c_distributed_tracing.json + kind: file + spec: + file: spec/fixtures/w3c_distributed_tracing.json + wildcard_matcher_tests.json: + name: wildcard_matcher_tests.json + scmid: default + sourceid: wildcard_matcher_tests.json + kind: file + spec: + file: spec/fixtures/wildcard_matcher_tests.json diff --git a/.ci/update-specs.yml b/.ci/updatecli.d/update-specs.yml similarity index 100% rename from .ci/update-specs.yml rename to .ci/updatecli.d/update-specs.yml diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml new file mode 100644 index 000000000..3d88f4efc --- /dev/null +++ b/.github/workflows/opentelemetry.yml @@ -0,0 +1,18 @@ +--- +name: OpenTelemetry Export Trace + +on: + workflow_run: + workflows: + - updatecli + types: [completed] + +jobs: + otel-export-trace: + runs-on: ubuntu-latest + steps: + - uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current + with: + vaultUrl: ${{ secrets.VAULT_ADDR }} + vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} + vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} diff --git a/.github/workflows/update-specs.yml b/.github/workflows/updatecli.yml similarity index 86% rename from .github/workflows/update-specs.yml rename to .github/workflows/updatecli.yml index 50179ace3..3746cc907 100644 --- a/.github/workflows/update-specs.yml +++ b/.github/workflows/updatecli.yml @@ -1,4 +1,4 @@ -name: update-specs +name: updatecli on: workflow_dispatch: ~ @@ -14,13 +14,11 @@ jobs: steps: - uses: actions/checkout@v3 - uses: elastic/apm-pipeline-library/.github/actions/updatecli@current - env: - BRANCH_NAME: ${{ github.ref_name }} with: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - pipeline: ./.ci/update-specs.yml + pipeline: .ci/updatecli.d - if: failure() uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current with: