Skip to content

Commit

Permalink
Migrate specs update to updatecli (#1402)
Browse files Browse the repository at this point in the history
* Migrate specs update to updatecli

* Fix title too long error

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

---------

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
  • Loading branch information
reakaleek and v1v committed Mar 30, 2023
1 parent 332875e commit 6fe379a
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 5 deletions.
117 changes: 117 additions & 0 deletions .ci/updatecli.d/update-gherkin-specs.yml
Original file line number Diff line number Diff line change
@@ -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-go
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
122 changes: 122 additions & 0 deletions .ci/updatecli.d/update-json-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
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-go
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: internal/testdata/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: internal/testdata/json-specs/service_resource_inference.json
span_types.json:
name: span_types.json
scmid: default
sourceid: span_types.json
kind: file
spec:
file: internal/testdata/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: internal/testdata/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: internal/testdata/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: internal/testdata/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: internal/testdata/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 @@ -5,7 +5,7 @@ on:
workflow_run:
workflows:
- ci
- 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

0 comments on commit 6fe379a

Please sign in to comment.