Skip to content

Commit ab6ecc2

Browse files
authored
Add update-spec updatecli workflow (#3153)
* Add update-spec updatecli workflow * Add to OpenTelemetry workflow * Remove deprecated log.json file
1 parent 2c0ab3d commit ab6ecc2

File tree

4 files changed

+134
-88
lines changed

4 files changed

+134
-88
lines changed

Diff for: .ci/update-specs.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: update-specs
2+
3+
title: synchronize schema specs
4+
5+
scms:
6+
default:
7+
kind: github
8+
spec:
9+
user: '{{ requiredEnv "GIT_USER" }}'
10+
email: '{{ requiredEnv "GIT_EMAIL" }}'
11+
owner: elastic
12+
repository: apm-agent-nodejs
13+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
14+
username: '{{ requiredEnv "GIT_USER" }}'
15+
branch: main
16+
17+
sources:
18+
sha:
19+
kind: file
20+
spec:
21+
file: 'https://github.com/elastic/apm-data/commit/main.patch'
22+
matchpattern: "^From\\s([0-9a-f]{40})\\s"
23+
error.json:
24+
kind: file
25+
spec:
26+
file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/error.json
27+
metadata.json:
28+
kind: file
29+
spec:
30+
file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/metadata.json
31+
metricset.json:
32+
kind: file
33+
spec:
34+
file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/metricset.json
35+
span.json:
36+
kind: file
37+
spec:
38+
file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/span.json
39+
transaction.json:
40+
kind: file
41+
spec:
42+
file: https://raw.githubusercontent.com/elastic/apm-data/main/input/elasticapm/docs/spec/v2/transaction.json
43+
44+
actions:
45+
pr:
46+
kind: "github/pullrequest"
47+
scmid: default
48+
sourceid: sha
49+
spec:
50+
automerge: false
51+
draft: false
52+
labels:
53+
- "automation"
54+
description: |-
55+
### What
56+
APM agent json schema automatic sync
57+
### Why
58+
*Changeset*
59+
* https://github.com/elastic/apm-data/commit/{{ source "sha" }}
60+
61+
targets:
62+
error.json:
63+
name: error.json
64+
scmid: default
65+
sourceid: error.json
66+
kind: file
67+
spec:
68+
file: test/integration/api-schema/apm-server-schema/error.json
69+
forcecreate: true
70+
metadata.json:
71+
name: metadata.json
72+
scmid: default
73+
sourceid: metadata.json
74+
kind: file
75+
spec:
76+
file: test/integration/api-schema/apm-server-schema/metadata.json
77+
forcecreate: true
78+
metricset.json:
79+
name: metricset.json
80+
scmid: default
81+
sourceid: metricset.json
82+
kind: file
83+
spec:
84+
file: test/integration/api-schema/apm-server-schema/metricset.json
85+
forcecreate: true
86+
span.json:
87+
name: span.json
88+
scmid: default
89+
sourceid: span.json
90+
kind: file
91+
spec:
92+
file: test/integration/api-schema/apm-server-schema/span.json
93+
forcecreate: true
94+
transaction.json:
95+
name: transaction.json
96+
scmid: default
97+
sourceid: transaction.json
98+
kind: file
99+
spec:
100+
file: test/integration/api-schema/apm-server-schema/transaction.json
101+
forcecreate: true

Diff for: .github/workflows/opentelemetry.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: OpenTelemetry Export Trace
22

33
on:
44
workflow_run:
5-
workflows: [Edge, Test, Lint, Snapshoty]
5+
workflows: [Edge, Test, Lint, Snapshoty, update-specs]
66
types: [completed]
77

88
jobs:

Diff for: .github/workflows/update-specs.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: update-specs
2+
3+
on:
4+
workflow_dispatch: ~
5+
schedule:
6+
- cron: '0 6 * * *'
7+
8+
permissions:
9+
pull-requests: write
10+
contents: write
11+
12+
jobs:
13+
bump:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Setup Git
18+
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
19+
- name: Install Updatecli in the runner
20+
uses: updatecli/updatecli-action@453502948b442d7b9a923de7b40cc7ce8628505c
21+
- name: Run Updatecli
22+
env:
23+
GITHUB_TOKEN: ${{ github.token }}
24+
BRANCH_NAME: ${{ github.ref_name }}
25+
run: updatecli apply --config ./.ci/update-specs.yml
26+
- if: failure()
27+
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
28+
with:
29+
vaultUrl: ${{ secrets.VAULT_ADDR }}
30+
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
31+
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
32+
slackChannel: "#apm-agent-node"

Diff for: test/integration/api-schema/apm-server-schema/log.json

-87
This file was deleted.

0 commit comments

Comments
 (0)