ci: upload performance report to rustfs/dashboard reports/YYYY-MM-DD.md (#6843)

* ci: upload performance report to rustfs/dashboard reports/YYYY-MM-DD.md

* ci: update token comment to dashboard

* ci: english-only report metadata in performance workflow
This commit is contained in:
hector
2026-08-29 15:50:46 +08:00
committed by GitHub
parent e009eab4f1
commit 84c5f2170f
+20 -15
View File
@@ -78,7 +78,7 @@ env:
RUSTFS_NIGHTLY_PACKAGE_URL: ${{ vars.RUSTFS_NIGHTLY_PACKAGE_URL || 'https://dl.rustfs.com/artifacts/rustfs/packages/nightly/rustfs-nightly-latest.deb' }} RUSTFS_NIGHTLY_PACKAGE_URL: ${{ vars.RUSTFS_NIGHTLY_PACKAGE_URL || 'https://dl.rustfs.com/artifacts/rustfs/packages/nightly/rustfs-nightly-latest.deb' }}
# Fixed benchmark result directory so later steps can read summary.md # Fixed benchmark result directory so later steps can read summary.md
RUSTFS_RESULT_DIR: /tmp/rustfs-perf-results RUSTFS_RESULT_DIR: /tmp/rustfs-perf-results
# Cross-repo token for writing to rustfs/backlog (set in repo settings) # Cross-repo token for uploading reports to rustfs/dashboard (set in repo settings)
PF_TESTING_GH_TOKEN: ${{ secrets.PF_TESTING_GH_TOKEN }} PF_TESTING_GH_TOKEN: ${{ secrets.PF_TESTING_GH_TOKEN }}
jobs: jobs:
@@ -149,7 +149,7 @@ jobs:
run: | run: |
./auto-testing/rustfs_performance_test.sh --step 6 -y ./auto-testing/rustfs_performance_test.sh --step 6 -y
- name: Post results to backlog issue - name: Upload report to dashboard (reports/YYYY-MM-DD.md)
if: ${{ steps.benchmark.conclusion == 'success' }} if: ${{ steps.benchmark.conclusion == 'success' }}
env: env:
GH_TOKEN: ${{ env.PF_TESTING_GH_TOKEN }} GH_TOKEN: ${{ env.PF_TESTING_GH_TOKEN }}
@@ -157,30 +157,35 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
if [ -z "${GH_TOKEN:-}" ]; then if [ -z "${GH_TOKEN:-}" ]; then
echo "PF_TESTING_GH_TOKEN is not configured; skipping issue post" echo "PF_TESTING_GH_TOKEN is not configured; skipping report upload"
exit 0 exit 0
fi fi
SUMMARY="${RESULT_DIR}/summary.md" SUMMARY="${RESULT_DIR}/summary.md"
[ -f "${SUMMARY}" ] || { echo "summary.md not found at ${SUMMARY}"; exit 1; } [ -f "${SUMMARY}" ] || { echo "summary.md not found at ${SUMMARY}"; exit 1; }
DATE="$(date -u +%Y-%m-%d)" DATE="$(date -u +%Y-%m-%d)"
REPORT_PATH="reports/${DATE}.md"
{ {
echo "## RustFS nightly build performance testing report" echo "# RustFS nightly build performance testing report"
echo "" echo ""
echo "- **日期**: ${DATE}" echo "- **Date**: ${DATE}"
echo "- **Run**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" echo "- **Run**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "- **触发方式**: ${{ github.event_name }}" echo "- **Trigger**: ${{ github.event_name }}"
echo "- **Package**: ${{ inputs.package_url || 'nightly (R2 latest)' }}"
echo "" echo ""
cat "${SUMMARY}" cat "${SUMMARY}"
} > /tmp/rustfs-perf-issue-body.md } > /tmp/rustfs-perf-report.md
TITLE="RustFS nightly build performance testing report" CONTENT="$(python3 -c 'import base64; print(base64.b64encode(open("/tmp/rustfs-perf-report.md","rb").read()).decode())')"
EXISTING="$(gh issue list --repo rustfs/backlog \ SHA="$(gh api "repos/rustfs/dashboard/contents/${REPORT_PATH}" -q '.sha' 2>/dev/null || true)"
--search "in:title \"${TITLE}\"" --state all --limit 5 \ if [ -n "${SHA}" ]; then
--json number --jq '.[0].number // empty')" jq -n --arg msg "report: ${DATE}" --arg content "${CONTENT}" --arg sha "${SHA}" \
if [ -n "${EXISTING}" ]; then '{message:$msg, content:$content, sha:$sha}' \
gh issue comment "${EXISTING}" --repo rustfs/backlog --body-file /tmp/rustfs-perf-issue-body.md | gh api --method PUT "repos/rustfs/dashboard/contents/${REPORT_PATH}" --input - >/dev/null
echo "commented on existing issue #${EXISTING}" echo "updated ${REPORT_PATH} in rustfs/dashboard"
else else
gh issue create --repo rustfs/backlog --title "${TITLE}" --body-file /tmp/rustfs-perf-issue-body.md jq -n --arg msg "report: ${DATE}" --arg content "${CONTENT}" \
'{message:$msg, content:$content}' \
| gh api --method PUT "repos/rustfs/dashboard/contents/${REPORT_PATH}" --input - >/dev/null
echo "created ${REPORT_PATH} in rustfs/dashboard"
fi fi
- name: Upload test logs & results - name: Upload test logs & results