Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate specs update to updatecli #3053

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .ci/updatecli.d/update-gherkin-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: update-gherkin-specs
pipelineid: update-gherkin-specs

scms:
default:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
owner: elastic
repository: apm-agent-java
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
spec:
title: Update Gherkin specs
automerge: false
draft: false
labels:
- "automation"
description: |-
### What
APM agent 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: 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
spec:
file: apm-agent-core/src/test/resources/specs/user_agent.feature
forcecreate: true
120 changes: 120 additions & 0 deletions .ci/updatecli.d/update-json-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: update-jsons-specs
pipelineid: update-jsons-specs

scms:
default:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
owner: elastic
repository: apm-agent-java
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
spec:
title: Update JSON specs
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: apm-agent-core/src/test/resources/json-specs/cgroup_parsing.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
scmid: default
sourceid: sql_signature_examples.json
kind: file
spec:
file: apm-agent-core/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-core/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
spec:
file: apm-agent-core/src/test/resources/json-specs/wildcard_matcher_tests.json
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/opentelemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflows:
- test
- test-reporter
- update-specs
- updatecli
types: [completed]

jobs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: update-specs
name: updatecli

on:
workflow_dispatch: ~
Expand All @@ -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:
Expand Down