From dc46894d8d4cf8762d1a7d173274fb2669496b79 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:37:23 +0000 Subject: [PATCH 1/5] Update integration test workflow labels Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com> --- .../workflows/recommend-integration-tests.yml | 28 ++++++++++++++++--- .github/workflows/status-checks.yml | 4 +-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/recommend-integration-tests.yml b/.github/workflows/recommend-integration-tests.yml index 5790c18c436..edfabb03a69 100644 --- a/.github/workflows/recommend-integration-tests.yml +++ b/.github/workflows/recommend-integration-tests.yml @@ -20,7 +20,11 @@ jobs: - name: Get source files changes id: source-files run: | - DIFF=$(git diff --name-only origin/main | grep 'packages/react' | grep -Ev '.stories.tsx|.stories.module.css|.docs.json' || true) + DIFF=$(git diff --name-only origin/main -- \ + packages/react \ + packages/postcss-preset-primer \ + packages/rollup-plugin-import-css \ + | grep -Ev '\.stories\.tsx$|\.stories\.module\.css$|\.docs\.json$' || true) if [ -z "$DIFF" ]; then echo "diff=" >> $GITHUB_OUTPUT else @@ -31,8 +35,9 @@ jobs: run: echo ${{ steps.source-files.outputs.diff != '' }} - name: Add label and comment - if: ${{ steps.source-files.outputs.diff != '' }} uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 + env: + HAS_RELEVANT_DIFF: ${{ steps.source-files.outputs.diff != '' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -41,7 +46,8 @@ jobs: skipped: 'integration-tests: skipped manually', recommended: 'integration-tests: recommended', failing: 'integration-tests: failing', - passing: 'integration-tests: passing' + passing: 'integration-tests: passing', + ignored: 'integration-tests: ignored' } const issue = { @@ -52,9 +58,23 @@ jobs: const labels = await github.paginate(github.rest.issues.listLabelsOnIssue, issue); const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests')) + const integrationLabelNames = new Set(integrationLabels.map(label => label.name)) const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing) + const hasIgnoredLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.ignored) + const hasRelevantDiff = process.env.HAS_RELEVANT_DIFF === 'true' - if (integrationLabels.length === 0) { + if (!hasRelevantDiff) { + if (!hasIgnoredLabel) { + await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.ignored]}) + } + return + } + + if (hasIgnoredLabel) { + await github.rest.issues.removeLabel({...issue, name: INTEGRATION_LABEL_NAMES.ignored}) + } + + if (integrationLabels.length === 0 || integrationLabelNames.has(INTEGRATION_LABEL_NAMES.ignored)) { // recommend integration tests await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) await github.rest.issues.createComment({ diff --git a/.github/workflows/status-checks.yml b/.github/workflows/status-checks.yml index 5079b1682a8..274cf06577b 100644 --- a/.github/workflows/status-checks.yml +++ b/.github/workflows/status-checks.yml @@ -17,7 +17,7 @@ permissions: jobs: github-ui: runs-on: ubuntu-latest - if: "${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'integration-tests: skipped manually')) || github.event_name == 'merge_group' || (github.event_name == 'issue_comment' && github.event.issue.pull_request != null) }}" + if: "${{ (github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'integration-tests: skipped manually') || contains(github.event.pull_request.labels.*.name, 'integration-tests: ignored'))) || github.event_name == 'merge_group' || (github.event_name == 'issue_comment' && github.event.issue.pull_request != null) }}" steps: - name: Generate token for primer id: generate_primer_token @@ -35,7 +35,7 @@ jobs: run: | # Get the timeline event ID for the label being added EVENT_ID=$(gh api "/repos/primer/react/issues/$PR_NUMBER/timeline" \ - --jq '.[] | select(.event == "labeled" and .label.name == "integration-tests: skipped manually") | .id' \ + --jq '.[] | select(.event == "labeled" and (.label.name == "integration-tests: skipped manually" or .label.name == "integration-tests: ignored")) | .id' \ | tail -n 1) # Construct the HTML URL from the event ID From 55bb1cd6c65538a87f1f7c55641b7defe17d1efd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:40:46 +0000 Subject: [PATCH 2/5] Refine integration ignored label handling Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com> --- .github/workflows/recommend-integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/recommend-integration-tests.yml b/.github/workflows/recommend-integration-tests.yml index edfabb03a69..9171e8ba215 100644 --- a/.github/workflows/recommend-integration-tests.yml +++ b/.github/workflows/recommend-integration-tests.yml @@ -58,9 +58,9 @@ jobs: const labels = await github.paginate(github.rest.issues.listLabelsOnIssue, issue); const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests')) - const integrationLabelNames = new Set(integrationLabels.map(label => label.name)) const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing) const hasIgnoredLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.ignored) + const onlyIgnoredLabel = integrationLabels.length === 1 && hasIgnoredLabel const hasRelevantDiff = process.env.HAS_RELEVANT_DIFF === 'true' if (!hasRelevantDiff) { @@ -74,7 +74,7 @@ jobs: await github.rest.issues.removeLabel({...issue, name: INTEGRATION_LABEL_NAMES.ignored}) } - if (integrationLabels.length === 0 || integrationLabelNames.has(INTEGRATION_LABEL_NAMES.ignored)) { + if (integrationLabels.length === 0 || onlyIgnoredLabel) { // recommend integration tests await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) await github.rest.issues.createComment({ From 108a1de73f21d06bcd9985311c0cf26449055fd3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:44:36 +0000 Subject: [PATCH 3/5] Rename ignored integration label flag Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com> --- .github/workflows/recommend-integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/recommend-integration-tests.yml b/.github/workflows/recommend-integration-tests.yml index 9171e8ba215..96271e8004c 100644 --- a/.github/workflows/recommend-integration-tests.yml +++ b/.github/workflows/recommend-integration-tests.yml @@ -60,7 +60,7 @@ jobs: const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests')) const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing) const hasIgnoredLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.ignored) - const onlyIgnoredLabel = integrationLabels.length === 1 && hasIgnoredLabel + const hasOnlyIgnoredLabel = integrationLabels.length === 1 && hasIgnoredLabel const hasRelevantDiff = process.env.HAS_RELEVANT_DIFF === 'true' if (!hasRelevantDiff) { @@ -74,7 +74,7 @@ jobs: await github.rest.issues.removeLabel({...issue, name: INTEGRATION_LABEL_NAMES.ignored}) } - if (integrationLabels.length === 0 || onlyIgnoredLabel) { + if (integrationLabels.length === 0 || hasOnlyIgnoredLabel) { // recommend integration tests await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) await github.rest.issues.createComment({ From c538efb80000e1e6315eacce9d0c18215c268ab3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:48:11 +0000 Subject: [PATCH 4/5] Clarify integration package scope Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com> --- .github/workflows/recommend-integration-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/recommend-integration-tests.yml b/.github/workflows/recommend-integration-tests.yml index 96271e8004c..9fb2e4b67fd 100644 --- a/.github/workflows/recommend-integration-tests.yml +++ b/.github/workflows/recommend-integration-tests.yml @@ -20,6 +20,7 @@ jobs: - name: Get source files changes id: source-files run: | + # Include @primer/react and the local packages that can affect its generated runtime output. DIFF=$(git diff --name-only origin/main -- \ packages/react \ packages/postcss-preset-primer \ @@ -60,7 +61,8 @@ jobs: const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests')) const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing) const hasIgnoredLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.ignored) - const hasOnlyIgnoredLabel = integrationLabels.length === 1 && hasIgnoredLabel + const hasOnlyIgnoredLabel = + integrationLabels.length === 1 && integrationLabels[0].name === INTEGRATION_LABEL_NAMES.ignored const hasRelevantDiff = process.env.HAS_RELEVANT_DIFF === 'true' if (!hasRelevantDiff) { From 972f57082a3d9653a8b0e171d700e0eb225a5653 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 14:40:35 +0000 Subject: [PATCH 5/5] Include e2e snapshots in integration recommendations Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com> --- .github/workflows/recommend-integration-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/recommend-integration-tests.yml b/.github/workflows/recommend-integration-tests.yml index 9fb2e4b67fd..85a8e46553c 100644 --- a/.github/workflows/recommend-integration-tests.yml +++ b/.github/workflows/recommend-integration-tests.yml @@ -20,8 +20,9 @@ jobs: - name: Get source files changes id: source-files run: | - # Include @primer/react and the local packages that can affect its generated runtime output. + # Include @primer/react, e2e snapshots, and the local packages that can affect its generated runtime output. DIFF=$(git diff --name-only origin/main -- \ + .playwright/snapshots \ packages/react \ packages/postcss-preset-primer \ packages/rollup-plugin-import-css \