From bb9011d65dcbfcd56fb5fb405509163a3c54f744 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:01:16 +1200 Subject: [PATCH 1/3] [CI] Label PR too-big if it has more than 1000 lines changed (#9744) --- .github/workflows/auto-label-pr.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-label-pr.yml b/.github/workflows/auto-label-pr.yml index c3e1c641ce..f1321a86ee 100644 --- a/.github/workflows/auto-label-pr.yml +++ b/.github/workflows/auto-label-pr.yml @@ -56,6 +56,7 @@ env: valve SMALL_PR_THRESHOLD: 30 MAX_LABELS: 15 + TOO_BIG_THRESHOLD: 1000 jobs: label: @@ -147,6 +148,7 @@ jobs: const platformComponents = `${{ env.PLATFORM_COMPONENTS }}`.split('\n').filter(p => p.trim().length > 0).map(p => p.trim()); const smallPrThreshold = parseInt('${{ env.SMALL_PR_THRESHOLD }}'); const maxLabels = parseInt('${{ env.MAX_LABELS }}'); + const tooBigThreshold = parseInt('${{ env.TOO_BIG_THRESHOLD }}'); // Strategy: Merge to release or beta branch const baseRef = context.payload.pull_request.base.ref; @@ -402,18 +404,34 @@ jobs: console.log('Computed labels:', finalLabels.join(', ')); - // Don't set more than max labels - if (finalLabels.length > maxLabels) { + // Check if PR is allowed to be too big + const allowedTooBig = currentLabels.includes('mega-pr'); + + // Check if PR is too big (either too many labels or too many line changes) + const tooManyLabels = finalLabels.length > maxLabels; + const tooManyChanges = totalChanges > tooBigThreshold; + + if ((tooManyLabels || tooManyChanges) && !allowedTooBig) { const originalLength = finalLabels.length; - console.log(`Not setting ${originalLength} labels because out of range`); + console.log(`PR is too big - Labels: ${originalLength}, Changes: ${totalChanges}`); finalLabels = ['too-big']; + // Create appropriate review message + let reviewBody; + if (tooManyLabels && tooManyChanges) { + reviewBody = `This PR is too large with ${totalChanges} line changes and affects ${originalLength} different components/areas. Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.`; + } else if (tooManyLabels) { + reviewBody = `This PR affects ${originalLength} different components/areas. Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.`; + } else { + reviewBody = `This PR is too large with ${totalChanges} line changes. Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.`; + } + // Request changes on the PR await github.rest.pulls.createReview({ owner, repo, pull_number: pr_number, - body: `This PR is too large and affects ${originalLength} different components/areas. Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.`, + body: reviewBody, event: 'REQUEST_CHANGES' }); } From 06bd1472deab2c957e4f1d021b850d1481b2779a Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:10:47 +1200 Subject: [PATCH 2/3] [CI] Keep original labels when PR has too many lines (#9745) --- .github/workflows/auto-label-pr.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-label-pr.yml b/.github/workflows/auto-label-pr.yml index f1321a86ee..488a72ffb3 100644 --- a/.github/workflows/auto-label-pr.yml +++ b/.github/workflows/auto-label-pr.yml @@ -414,7 +414,14 @@ jobs: if ((tooManyLabels || tooManyChanges) && !allowedTooBig) { const originalLength = finalLabels.length; console.log(`PR is too big - Labels: ${originalLength}, Changes: ${totalChanges}`); - finalLabels = ['too-big']; + + // If too big due to line changes only, keep original labels and add too-big + // If too big due to too many labels, replace with just too-big + if (tooManyChanges && !tooManyLabels) { + finalLabels.push('too-big'); + } else { + finalLabels = ['too-big']; + } // Create appropriate review message let reviewBody; From ff59e37d8d3a23ca43682c9c16a0ae54db3375be Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 20 Jul 2025 14:23:34 -1000 Subject: [PATCH 3/3] fixes --- esphome/components/api/api_connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index c95992e172..602a0256cf 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1,5 +1,11 @@ #include "api_connection.h" #ifdef USE_API +#ifdef USE_API_NOISE +#include "api_frame_helper_noise.h" +#endif +#ifdef USE_API_PLAINTEXT +#include "api_frame_helper_plaintext.h" +#endif #include #include #include