-
-
Notifications
You must be signed in to change notification settings - Fork 50
95 lines (85 loc) · 3.19 KB
/
Copy pathpr-observability-summary.yml
File metadata and controls
95 lines (85 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: PR observability summary
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
pr_number:
description: PR number to summarise (dispatch only)
required: true
concurrency:
group: pr-observability-${{ github.event.pull_request.number || github.event.inputs.pr_number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
summary:
name: Sticky observability comment
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
security-events: read
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- name: Harden runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
disable-sudo: true
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up uv
uses: ./.github/actions/bootstrap
with:
python-version: '3.13'
- name: Install bernstein
run: |
uv sync --group dev
- name: Run doctor observe (JSON)
id: observe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_PROJECT_KEY: ${{ vars.SONAR_PROJECT_KEY }}
BERNSTEIN_GLITCHTIP_TOKEN: ${{ secrets.BERNSTEIN_GLITCHTIP_TOKEN }}
BERNSTEIN_GLITCHTIP_BASE_URL: ${{ vars.BERNSTEIN_GLITCHTIP_BASE_URL }}
BERNSTEIN_GLITCHTIP_ORG: ${{ vars.BERNSTEIN_GLITCHTIP_ORG }}
DTRACK_URL: ${{ vars.DTRACK_URL }}
DTRACK_TOKEN: ${{ secrets.DTRACK_TOKEN }}
DTRACK_PROJECT: ${{ vars.DTRACK_PROJECT }}
run: |
set -euo pipefail
mkdir -p .ci/observability
uv run bernstein doctor observe --json --no-persist \
> .ci/observability/observe.json || true
- name: Build PR summary markdown
id: build
env:
PR_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
PR_BRANCH: ${{ github.event.pull_request.head.ref || '' }}
run: |
set -euo pipefail
uv run python scripts/observability/build_pr_summary.py \
--observe .ci/observability/observe.json \
--pr "$PR_NUMBER" \
--branch "$PR_BRANCH" \
--out .ci/observability/pr_summary.md
{
echo 'body<<OBSERVABILITY_EOF'
cat .ci/observability/pr_summary.md
echo 'OBSERVABILITY_EOF'
} >> "$GITHUB_OUTPUT"
- name: Post sticky comment
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
header: bernstein-observability
message: ${{ steps.build.outputs.body }}