From ab92f984729d5a0dbb4f641939e6d4d36ef07ba9 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 16 Jul 2026 21:02:45 +0900 Subject: [PATCH] refacotr(gh): rename some files --- ... frontend-browser-diagnostics.inspect.mts} | 0 ...er-diagnostics.render-additional-html.mts} | 5 +- ...rontend-browser-diagnostics.render-md.mts} | 9 ++-- ... frontend-browser-diagnostics.inspect.yml} | 52 +++++++++---------- ...> frontend-browser-diagnostics.report.yml} | 18 +++---- 5 files changed, 39 insertions(+), 45 deletions(-) rename .github/scripts/{measure-frontend-browser-comparison.mts => frontend-browser-diagnostics.inspect.mts} (100%) rename .github/scripts/{frontend-browser-detailed-html.mts => frontend-browser-diagnostics.render-additional-html.mts} (98%) rename .github/scripts/{frontend-browser-report.mts => frontend-browser-diagnostics.render-md.mts} (98%) rename .github/workflows/{frontend-browser-metrics-report.yml => frontend-browser-diagnostics.inspect.yml} (69%) rename .github/workflows/{frontend-browser-metrics-report-comment.yml => frontend-browser-diagnostics.report.yml} (62%) diff --git a/.github/scripts/measure-frontend-browser-comparison.mts b/.github/scripts/frontend-browser-diagnostics.inspect.mts similarity index 100% rename from .github/scripts/measure-frontend-browser-comparison.mts rename to .github/scripts/frontend-browser-diagnostics.inspect.mts diff --git a/.github/scripts/frontend-browser-detailed-html.mts b/.github/scripts/frontend-browser-diagnostics.render-additional-html.mts similarity index 98% rename from .github/scripts/frontend-browser-detailed-html.mts rename to .github/scripts/frontend-browser-diagnostics.render-additional-html.mts index 34240eefc6..86f70e7ebd 100644 --- a/.github/scripts/frontend-browser-detailed-html.mts +++ b/.github/scripts/frontend-browser-diagnostics.render-additional-html.mts @@ -6,7 +6,7 @@ import { readFile, writeFile } from 'node:fs/promises'; import { pathToFileURL } from 'node:url'; import * as util from './utility.mts'; -import type { BrowserMeasurementSample, BrowserMetricsReport } from './frontend-browser-report.mts'; +import type { BrowserMeasurementSample, BrowserMetricsReport } from './frontend-browser-diagnostics.render-md.mts'; import type { NetworkRequest } from './chrome.mts'; type DiffDirection = 'added' | 'removed'; @@ -434,9 +434,6 @@ function renderHtml(base: BrowserMetricsReport, head: BrowserMetricsReport) { async function main() { const [baseFile, headFile, outputFile] = process.argv.slice(2); - if (baseFile == null || headFile == null || outputFile == null) { - throw new Error('Usage: node frontend-browser-detailed-html.mts '); - } const base = JSON.parse(await readFile(baseFile, 'utf8')) as BrowserMetricsReport; const head = JSON.parse(await readFile(headFile, 'utf8')) as BrowserMetricsReport; diff --git a/.github/scripts/frontend-browser-report.mts b/.github/scripts/frontend-browser-diagnostics.render-md.mts similarity index 98% rename from .github/scripts/frontend-browser-report.mts rename to .github/scripts/frontend-browser-diagnostics.render-md.mts index 1ecfbe14db..b67a790102 100644 --- a/.github/scripts/frontend-browser-report.mts +++ b/.github/scripts/frontend-browser-diagnostics.render-md.mts @@ -324,12 +324,12 @@ export function renderFrontendBrowserReport(base: BrowserMetricsReport, head: Br : `${base.sampleCount} base sample(s), ${head.sampleCount} head sample(s)`; const heapSnapshotTable = heapSnapshotUtil.renderHeapSnapshotTable(toHeapSnapshotReport(base), toHeapSnapshotReport(head)); const lines = [ - '## 🖥 Frontend Browser Metrics', - '', - 'Only metrics showing significant changes are displayed.', + '## 🖥 Frontend Browser Diagnostics Report', '', renderSummaryTable(base, head), '', + 'Only metrics showing significant changes are displayed.', + '', //`> Measured ${sampleSummary} with fresh headless Chrome profiles, browser cache disabled, service workers bypassed, and forced V8 GC before each heap snapshot. Base/Head values are medians; Δ median is the median of paired Head - Base sample deltas; percent uses Δ median / Base median; ± and Δ MAD are median absolute deviations. Scenario: sign up, dismiss the initial account setup dialog, create the first timeline note, then wait until that note is visible.`, //'', detailedHtmlUrl == null || detailedHtmlUrl === '' ? null : `[View details](${detailedHtmlUrl})`, @@ -367,9 +367,6 @@ export function renderFrontendBrowserReport(base: BrowserMetricsReport, head: Br async function main() { const [baseFile, headFile, outputFile] = process.argv.slice(2); - if (baseFile == null || headFile == null || outputFile == null) { - throw new Error('Usage: node frontend-browser-report.mts '); - } const base = JSON.parse(await readFile(baseFile, 'utf8')) as BrowserMetricsReport; const head = JSON.parse(await readFile(headFile, 'utf8')) as BrowserMetricsReport; diff --git a/.github/workflows/frontend-browser-metrics-report.yml b/.github/workflows/frontend-browser-diagnostics.inspect.yml similarity index 69% rename from .github/workflows/frontend-browser-metrics-report.yml rename to .github/workflows/frontend-browser-diagnostics.inspect.yml index 863c7bb155..444c54040b 100644 --- a/.github/workflows/frontend-browser-metrics-report.yml +++ b/.github/workflows/frontend-browser-diagnostics.inspect.yml @@ -1,4 +1,4 @@ -name: frontend-browser-metrics-report +name: Frontend browser diagnostics (inspect) on: pull_request: @@ -23,20 +23,20 @@ on: - .node-version - .github/misskey/test.yml - .github/scripts/utility.mts - - .github/scripts/frontend-browser-detailed-html.mts - - .github/scripts/frontend-browser-report.mts - .github/scripts/heap-snapshot-util.mts - - .github/scripts/measure-frontend-browser-comparison.mts - .github/scripts/chrome.mts - - .github/workflows/frontend-browser-metrics-report.yml - - .github/workflows/frontend-browser-metrics-report-comment.yml + - .github/scripts/frontend-browser-diagnostics.render-additional-html.mts + - .github/scripts/frontend-browser-diagnostics.render-md.mts + - .github/scripts/frontend-browser-diagnostics.inspect.mts + - .github/workflows/frontend-browser-diagnostics.inspect.yml + - .github/workflows/frontend-browser-diagnostics.report.yml permissions: contents: read pull-requests: read concurrency: - group: frontend-browser-metrics-report-${{ github.event.pull_request.number }} + group: frontend-browser-diagnostics-inspect-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: @@ -125,33 +125,33 @@ jobs: FRONTEND_BROWSER_METRICS_SAMPLE_COUNT: 5 MK_ENABLE_CROSS_ORIGIN_ISOLATION: "true" run: | - REPORT_DIR="$RUNNER_TEMP/frontend-browser-metrics-report" + REPORT_DIR="$RUNNER_TEMP/frontend-browser-diagnostics" mkdir -p "$REPORT_DIR" - node after/.github/scripts/measure-frontend-browser-comparison.mts before after "$REPORT_DIR/before-browser.json" "$REPORT_DIR/after-browser.json" "$REPORT_DIR/head-heap-snapshot.heapsnapshot" + node after/.github/scripts/frontend-browser-diagnostics.inspect.mts before after "$REPORT_DIR/before-browser.json" "$REPORT_DIR/after-browser.json" "$REPORT_DIR/head-heap-snapshot.heapsnapshot" - name: Upload browser head heap snapshot id: upload-browser-head-heap-snapshot uses: actions/upload-artifact@v7 with: name: frontend-browser-metrics-head-heap-snapshot - path: ${{ runner.temp }}/frontend-browser-metrics-report/head-heap-snapshot.heapsnapshot + path: ${{ runner.temp }}/frontend-browser-diagnostics/head-heap-snapshot.heapsnapshot if-no-files-found: error retention-days: 7 - name: Generate browser detailed html shell: bash run: | - REPORT_DIR="$RUNNER_TEMP/frontend-browser-metrics-report" + REPORT_DIR="$RUNNER_TEMP/frontend-browser-diagnostics" test -s "$REPORT_DIR/before-browser.json" test -s "$REPORT_DIR/after-browser.json" - node after/.github/scripts/frontend-browser-detailed-html.mts "$REPORT_DIR/before-browser.json" "$REPORT_DIR/after-browser.json" "$REPORT_DIR/frontend-browser-detailed-html.html" + node after/.github/scripts/frontend-browser-diagnostics.render-additional-html.mts "$REPORT_DIR/before-browser.json" "$REPORT_DIR/after-browser.json" "$REPORT_DIR/frontend-browser-detailed-html.html" - name: Upload browser detailed html id: upload-browser-detailed-html uses: actions/upload-artifact@v7 with: name: frontend-browser-metrics-detailed-html - path: ${{ runner.temp }}/frontend-browser-metrics-report/frontend-browser-detailed-html.html + path: ${{ runner.temp }}/frontend-browser-diagnostics/frontend-browser-detailed-html.html if-no-files-found: error archive: false retention-days: 7 @@ -165,10 +165,10 @@ jobs: FRONTEND_BROWSER_HEAD_HEAP_SNAPSHOT_ARTIFACT_URL: ${{ steps.upload-browser-head-heap-snapshot.outputs.artifact-url }} FRONTEND_BROWSER_DETAILED_HTML_ARTIFACT_URL: ${{ steps.upload-browser-detailed-html.outputs.artifact-url }} run: | - REPORT_DIR="$RUNNER_TEMP/frontend-browser-metrics-report" + REPORT_DIR="$RUNNER_TEMP/frontend-browser-diagnostics" test -s "$REPORT_DIR/before-browser.json" test -s "$REPORT_DIR/after-browser.json" - node after/.github/scripts/frontend-browser-report.mts "$REPORT_DIR/before-browser.json" "$REPORT_DIR/after-browser.json" "$REPORT_DIR/frontend-browser-metrics-report.md" + node after/.github/scripts/frontend-browser-diagnostics.render-md.mts "$REPORT_DIR/before-browser.json" "$REPORT_DIR/after-browser.json" "$REPORT_DIR/frontend-browser-diagnostics.md" printf '%s\n' "$PR_NUMBER" > "$REPORT_DIR/pr-number.txt" printf '%s\n' "$BASE_SHA" > "$REPORT_DIR/base-sha.txt" printf '%s\n' "$HEAD_SHA" > "$REPORT_DIR/head-sha.txt" @@ -177,24 +177,24 @@ jobs: - name: Check browser metrics report shell: bash run: | - REPORT_DIR="$RUNNER_TEMP/frontend-browser-metrics-report" - test -s "$REPORT_DIR/frontend-browser-metrics-report.md" + REPORT_DIR="$RUNNER_TEMP/frontend-browser-diagnostics" + test -s "$REPORT_DIR/frontend-browser-diagnostics.md" test -s "$REPORT_DIR/frontend-browser-detailed-html.html" test -s "$REPORT_DIR/pr-number.txt" test -s "$REPORT_DIR/head-sha.txt" - cat "$REPORT_DIR/frontend-browser-metrics-report.md" >> "$GITHUB_STEP_SUMMARY" + cat "$REPORT_DIR/frontend-browser-diagnostics.md" >> "$GITHUB_STEP_SUMMARY" - name: Upload browser metrics report uses: actions/upload-artifact@v7 with: - name: frontend-browser-metrics-report + name: frontend-browser-diagnostics path: | - ${{ runner.temp }}/frontend-browser-metrics-report/before-browser.json - ${{ runner.temp }}/frontend-browser-metrics-report/after-browser.json - ${{ runner.temp }}/frontend-browser-metrics-report/frontend-browser-metrics-report.md - ${{ runner.temp }}/frontend-browser-metrics-report/pr-number.txt - ${{ runner.temp }}/frontend-browser-metrics-report/base-sha.txt - ${{ runner.temp }}/frontend-browser-metrics-report/head-sha.txt - ${{ runner.temp }}/frontend-browser-metrics-report/pr-url.txt + ${{ runner.temp }}/frontend-browser-diagnostics/before-browser.json + ${{ runner.temp }}/frontend-browser-diagnostics/after-browser.json + ${{ runner.temp }}/frontend-browser-diagnostics/frontend-browser-diagnostics.md + ${{ runner.temp }}/frontend-browser-diagnostics/pr-number.txt + ${{ runner.temp }}/frontend-browser-diagnostics/base-sha.txt + ${{ runner.temp }}/frontend-browser-diagnostics/head-sha.txt + ${{ runner.temp }}/frontend-browser-diagnostics/pr-url.txt if-no-files-found: error retention-days: 7 diff --git a/.github/workflows/frontend-browser-metrics-report-comment.yml b/.github/workflows/frontend-browser-diagnostics.report.yml similarity index 62% rename from .github/workflows/frontend-browser-metrics-report-comment.yml rename to .github/workflows/frontend-browser-diagnostics.report.yml index 0312092a5b..7edc9f36c6 100644 --- a/.github/workflows/frontend-browser-metrics-report-comment.yml +++ b/.github/workflows/frontend-browser-diagnostics.report.yml @@ -1,9 +1,9 @@ -name: frontend-browser-metrics-report-comment +name: Frontend browser diagnostics (report) on: workflow_run: workflows: - - frontend-browser-metrics-report + - Frontend browser diagnostics (inspect) types: - completed @@ -15,18 +15,18 @@ permissions: jobs: comment: - name: Comment frontend browser metrics report + name: Comment frontend browser diagnostics report if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest concurrency: - group: frontend-browser-metrics-report-comment-${{ github.event.workflow_run.id }} + group: frontend-browser-diagnostics-report-${{ github.event.workflow_run.id }} cancel-in-progress: true steps: - name: Download browser metrics report uses: actions/download-artifact@v8 with: - name: frontend-browser-metrics-report - path: ${{ runner.temp }}/frontend-browser-metrics-report + name: frontend-browser-diagnostics + path: ${{ runner.temp }}/frontend-browser-diagnostics github-token: ${{ github.token }} repository: ${{ github.repository }} run-id: ${{ github.event.workflow_run.id }} @@ -34,11 +34,11 @@ jobs: - name: Load PR number id: load-pr-number shell: bash - run: echo "pr-number=$(cat "$RUNNER_TEMP/frontend-browser-metrics-report/pr-number.txt")" >> "$GITHUB_OUTPUT" + run: echo "pr-number=$(cat "$RUNNER_TEMP/frontend-browser-diagnostics/pr-number.txt")" >> "$GITHUB_OUTPUT" - name: Comment on pull request uses: thollander/actions-comment-pull-request@v3 with: pr-number: ${{ steps.load-pr-number.outputs.pr-number }} - comment-tag: frontend_browser_metrics_report - file-path: ${{ runner.temp }}/frontend-browser-metrics-report/frontend-browser-metrics-report.md + comment-tag: frontend_browser_diagnostics + file-path: ${{ runner.temp }}/frontend-browser-diagnostics/frontend-browser-diagnostics.md