From 754b35aaee30b89db982dca2a5fad7f2a636441f Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 17:49:44 +0100 Subject: [PATCH 1/7] log download --- .github/workflows/benchmark.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 49ef91de9be4..6a9fec0c7283 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -80,7 +80,7 @@ jobs: - name: Upload wheel sizes artifact (main only) if: github.ref_name == 'main' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-size path: | @@ -88,7 +88,7 @@ jobs: wheel_sizes.txt - name: Download main wheel size - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-size continue-on-error: true @@ -96,6 +96,7 @@ jobs: - name: Extract previous wheel size id: load_previous_size run: | + ls -R if [[ -f wheel_sizes.txt ]]; then PREVIOUS_WHEEL_SIZE=$(tail -n 1 wheel_sizes.txt | awk '{ print $2 }') echo "PREVIOUS_WHEEL_SIZE=$PREVIOUS_WHEEL_SIZE" >> $GITHUB_ENV From e166b201e79372bb571e461b2c3ee284e7fab5a0 Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 17:59:29 +0100 Subject: [PATCH 2/7] c --- .github/workflows/benchmark.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 6a9fec0c7283..b66359656bea 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -103,6 +103,7 @@ jobs: else echo "PREVIOUS_WHEEL_SIZE=Unknown" >> $GITHUB_ENV fi + continue-on-error: true - name: Comment wheel size uses: actions/github-script@v7 @@ -129,7 +130,7 @@ jobs: repo: context.repo.repo, body: commentBody }); - + continue-on-error: true - name: Run benchmark tests uses: CodSpeedHQ/action@v3 From f4d52422a289d02bfc94517e04cc33c0730cd34b Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 18:02:44 +0100 Subject: [PATCH 3/7] c --- .github/workflows/benchmark.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b66359656bea..578ed427556d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -96,7 +96,6 @@ jobs: - name: Extract previous wheel size id: load_previous_size run: | - ls -R if [[ -f wheel_sizes.txt ]]; then PREVIOUS_WHEEL_SIZE=$(tail -n 1 wheel_sizes.txt | awk '{ print $2 }') echo "PREVIOUS_WHEEL_SIZE=$PREVIOUS_WHEEL_SIZE" >> $GITHUB_ENV From a3cade39db5841012c0d4205577fb42400f666cd Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 19:17:38 +0100 Subject: [PATCH 4/7] c --- .github/workflows/benchmark.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 578ed427556d..ed14083c6763 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -77,15 +77,14 @@ jobs: run: | WHEEL_SIZE=$(ls -l py-polars/polars/polars*.so | awk '{ print $5 }') echo "WHEEL_SIZE=$WHEEL_SIZE" >> $GITHUB_ENV + echo "$GITHUB_RUN_ID $WHEEL_SIZE" > wheel_sizes.txt - name: Upload wheel sizes artifact (main only) if: github.ref_name == 'main' uses: actions/upload-artifact@v4 with: name: wheel-size - path: | - echo "$GITHUB_RUN_ID $WHEEL_SIZE" > wheel_sizes.txt - wheel_sizes.txt + path: wheel_sizes.txt - name: Download main wheel size uses: actions/download-artifact@v4 From f1be282f4a228b212524af5a917fd986420c1706 Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 19:18:34 +0100 Subject: [PATCH 5/7] don't comment on main --- .github/workflows/benchmark.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ed14083c6763..ce3b03faf2c2 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -93,6 +93,7 @@ jobs: continue-on-error: true - name: Extract previous wheel size + if: github.ref_name != 'main' id: load_previous_size run: | if [[ -f wheel_sizes.txt ]]; then @@ -105,6 +106,7 @@ jobs: - name: Comment wheel size uses: actions/github-script@v7 + if: github.ref_name != 'main' with: script: | const previousSize = process.env.PREVIOUS_WHEEL_SIZE || 'Unknown'; From a6335f613fe7942f119fd3d394a35975fc41065f Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 19:46:06 +0100 Subject: [PATCH 6/7] update comment --- .github/workflows/benchmark.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ce3b03faf2c2..fa8df85e2406 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -124,12 +124,34 @@ jobs: commentBody += `\nThis represents a **${increase.toFixed(2)}% increase** in size.`; } - github.rest.issues.createComment({ - issue_number: context.issue.number, + const { data: comments } = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, - body: commentBody + issue_number: context.issue.number, }); + + // Look for an existing comment + const existingComment = comments.find(comment => + comment.body.includes('### :gear: Wheel Size Comparison') + ); + + if (existingComment) { + // Update the existing comment + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: existingComment.id, + body: commentBody, + }); + } else { + // Create a new comment + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: commentBody, + }); + } continue-on-error: true - name: Run benchmark tests From 90955a8f1ce6d85a9e6607d4eae0df2820bd9297 Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 3 Jan 2025 20:06:16 +0100 Subject: [PATCH 7/7] c --- .github/workflows/benchmark.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index fa8df85e2406..b4b7ad7691b8 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -77,6 +77,10 @@ jobs: run: | WHEEL_SIZE=$(ls -l py-polars/polars/polars*.so | awk '{ print $5 }') echo "WHEEL_SIZE=$WHEEL_SIZE" >> $GITHUB_ENV + + - name: Wheel size txt + if: github.ref_name == 'main' + run: | echo "$GITHUB_RUN_ID $WHEEL_SIZE" > wheel_sizes.txt - name: Upload wheel sizes artifact (main only) @@ -116,7 +120,7 @@ jobs: const previousSizeMB = previousSize !== 'Unknown' ? (previousSize / 1024 / 1024).toFixed(4) : 'Unknown'; const currentSizeMB = currentSize !== 'Unknown' ? (currentSize / 1024 / 1024).toFixed(4) : 'Unknown'; - let commentBody = `The uncompressed binary size was **${previousSizeMB} MB**.\nThe uncompressed binary size after this PR is **${currentSizeMB} MB**.`; + let commentBody = `The previous uncompressed lib size was **${previousSizeMB} MB**.\nThe current uncompressed lib size after this PR is **${currentSizeMB} MB**.`; // Calculate percentage increase if both sizes are available if (previousSize !== 'Unknown' && currentSize !== '') { @@ -132,7 +136,7 @@ jobs: // Look for an existing comment const existingComment = comments.find(comment => - comment.body.includes('### :gear: Wheel Size Comparison') + comment.body.includes('The previous uncompressed lib size was') ); if (existingComment) {