Skip to content

Commit c1d1568

Browse files
authored
Merge branch 'main' into error_brnahc
Signed-off-by: Minh Nguyen <[email protected]>
2 parents 24b4fc1 + 1414dd2 commit c1d1568

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/ci-comment.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Metrics Comparison and Post Comment
2+
on:
3+
workflow_run:
4+
workflows: ["E2E Tests"]
5+
types: [completed]
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
jobs:
10+
metrics-comparison:
11+
name: Compare Metrics
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.repository.default_branch }}
18+
- name: Download all metrics artifacts
19+
id : download-artifacts
20+
uses: actions/download-artifact@v4
21+
with:
22+
path: ./.metrics/
23+
run-id: ${{ github.event.workflow_run.id }}
24+
- name: Install dependencies
25+
run: |
26+
python3 -m pip install prometheus-client
27+
npm install @actions/core @actions/github
28+
- name: Compare metrics and generate summary
29+
id: compare-metrics
30+
shell: bash
31+
run: |
32+
bash ./scripts/e2e/metrics_summary.sh
33+
- name: Extract PR number from workflow_run
34+
id: extract-pr-number
35+
run: |
36+
PR_NUMBER=$(jq -r '.workflow_run.pull_requests[0].number' <<< '${{ toJSON(github.event) }}')
37+
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
38+
- name: Debug PR number
39+
run: |
40+
echo "Event JSON: ${{ toJSON(github.event) }}"
41+
echo "Extracted PR: ${{ steps.extract-pr-number.outputs.pr_number }}"
42+
- name: Post PR comment with combined metrics summary
43+
if: steps.compare-metrics.outputs.DIFF_FOUND == 'true'
44+
uses: thollander/actions-comment-pull-request@v3
45+
with:
46+
file-path: ./.metrics/combined_summary.md
47+
github-token: '${{ secrets.GITHUB_TOKEN }}'
48+
comment-tag: "## Metrics Comparison Summary"
49+
pr-number: ${{ steps.extract-pr-number.outputs.pr_number }}

.github/workflows/ci-e2e-all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ jobs:
2020
uses: ./.github/workflows/ci-e2e-elasticsearch.yml
2121
opensearch:
2222
uses: ./.github/workflows/ci-e2e-opensearch.yml
23+

0 commit comments

Comments
 (0)