Skip to content

Commit fc19f9b

Browse files
committed
debug: check base and merge commit results (4)
1 parent 7015b22 commit fc19f9b

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

.github/workflows/benchmark-pr.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ jobs:
2828
OWNER: ${{ github.repository_owner }}
2929
REPOSITORY: ${{ github.event.repository.name }}
3030
PR_NUMBER: ${{ github.event.pull_request.number }}
31-
BASE_COMMIT_HASH: ${{ github.event.pull_request.base.sha }}
32-
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
33-
MERGE_BASE_COMMIT_HASH: '' # placeholder so that we have autocomplete and logs
31+
GITHUB_SHA: ${{ github.sha }}
3432

3533
steps:
3634
- name: Checkout and setup environment
@@ -51,13 +49,6 @@ jobs:
5149
- name: Run page load benchmarks
5250
run: yarn test:e2e:benchmark
5351

54-
# - name: Get merge base commit hash
55-
# if: ${{ github.event_name == 'pull_request' }}
56-
# run: |
57-
# merge_base_commit_hash="$(git merge-base "${BASE_COMMIT_HASH}" "${GITHUB_SHA}")"
58-
# echo "MERGE_BASE_COMMIT_HASH=${merge_base_commit_hash}" >> "${GITHUB_ENV}"
59-
# echo "The merge base commit hash is '${merge_base_commit_hash}'"
60-
6152
- name: Compare and comment
6253
if: ${{ github.event_name == 'pull_request' }}
6354
run: yarn tsx development/benchmark-pr-comment.ts

development/benchmark-pr-comment.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -531,27 +531,14 @@ function generateBenchmarkComment(
531531
* @throws {Error} When GitHub API request fails or required environment variables are missing.
532532
*/
533533
async function main(): Promise<void> {
534-
const {
535-
PR_COMMENT_TOKEN,
536-
OWNER,
537-
REPOSITORY,
538-
PR_NUMBER,
539-
GITHUB_SHA,
540-
BASE_COMMIT_HASH,
541-
MERGE_BASE_COMMIT_HASH,
542-
} = process.env as Record<string, string>;
534+
const { PR_COMMENT_TOKEN, OWNER, REPOSITORY, PR_NUMBER, GITHUB_SHA } =
535+
process.env as Record<string, string>;
543536
const N_COMMITS = 10;
544537
const SHORT_SHA1 = GITHUB_SHA.slice(0, 7);
545-
const SHORT_SHA_BASE = BASE_COMMIT_HASH.slice(0, 7);
546-
const SHORT_SHA_MERGE = MERGE_BASE_COMMIT_HASH.slice(0, 7);
547538

548539
console.log({
549540
GITHUB_SHA,
550-
BASE_COMMIT_HASH,
551-
MERGE_BASE_COMMIT_HASH,
552541
SHORT_SHA1,
553-
SHORT_SHA_BASE,
554-
SHORT_SHA_MERGE,
555542
});
556543

557544
if (!PR_NUMBER) {
@@ -584,7 +571,7 @@ async function main(): Promise<void> {
584571
return;
585572
}
586573

587-
benchmarkData.commit = `${SHORT_SHA1}--${SHORT_SHA_BASE}--${SHORT_SHA_MERGE}`;
574+
benchmarkData.commit = SHORT_SHA1;
588575
const referenceData = await fetchLatestMainBenchmarkData(N_COMMITS);
589576

590577
const commentBody = generateBenchmarkComment(benchmarkData, referenceData);

0 commit comments

Comments
 (0)