From eccf7ccab938269154c0b52e3689621651d2466f Mon Sep 17 00:00:00 2001 From: Josh Black Date: Wed, 19 Nov 2025 15:48:34 -0600 Subject: [PATCH 1/2] ci: remove integration tests recommend step --- .../workflows/recommend-integration-tests.yml | 71 ------------------- 1 file changed, 71 deletions(-) delete mode 100644 .github/workflows/recommend-integration-tests.yml diff --git a/.github/workflows/recommend-integration-tests.yml b/.github/workflows/recommend-integration-tests.yml deleted file mode 100644 index eea0e22938a..00000000000 --- a/.github/workflows/recommend-integration-tests.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Recommend integration tests -on: - pull_request: - -jobs: - recommend: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 - with: - node-version-file: '.nvmrc' - - - 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) - if [ -z "$DIFF" ]; then - echo "diff=" >> $GITHUB_OUTPUT - else - echo "diff=true" >> $GITHUB_OUTPUT - fi - - - name: Has diff? - run: echo ${{ steps.source-files.outputs.diff != '' }} - - - name: Add label and comment - if: ${{ steps.source-files.outputs.diff != '' }} - uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const INTEGRATION_LABEL_NAMES = { - // synced with https://github.com/primer/react/labels?q=integration-tests - skipped: 'integration-tests: skipped manually', - recommended: 'integration-tests: recommended', - failing: 'integration-tests: failing', - passing: 'integration-tests: passing' - } - - const issue = { - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo - } - - const labels = await github.paginate(github.rest.issues.listLabelsOnIssue, issue); - const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests')) - const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing) - - if (integrationLabels.length === 0) { - // recommend integration tests - await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) - await github.rest.issues.createComment({ - ...issue, - body: '\n\n :wave: Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the [integration workflow](https://gh.io/testing_primer_at_dotcom). Or, apply the `integration-tests: skipped manually` label to skip these checks.' - }) - } else if (hasPassingLabel) { - // recommend running integration tests again as there are new commits that might change the status - // note: we don't remove 'integration-tests: passing' label because this is only a suggestion/nudge - await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) - await github.rest.issues.createComment({ - ...issue, - body: '\n\n :wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the [integration workflow](https://gh.io/testing_primer_at_dotcom). Or, apply the `integration-tests: skipped manually` label to skip these checks.' - }) - } From 1069337210295b3b479aaf1f8da2f665dcd044bf Mon Sep 17 00:00:00 2001 From: Josh Black Date: Wed, 19 Nov 2025 15:49:04 -0600 Subject: [PATCH 2/2] ci: remove integration result comment, this is handled through status checks now --- .../check-for-integration-result-comment.yml | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 .github/workflows/check-for-integration-result-comment.yml diff --git a/.github/workflows/check-for-integration-result-comment.yml b/.github/workflows/check-for-integration-result-comment.yml deleted file mode 100644 index 053798e9fe9..00000000000 --- a/.github/workflows/check-for-integration-result-comment.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Check for integration result comment - -on: - issue_comment: - types: [created, edited] - -jobs: - # note: this workflow always passes, it does not fail when integration tests are failing - check-for-integration-result-comment: - if: github.event.issue.pull_request - runs-on: ubuntu-latest - steps: - - name: Get integration result comment - uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const INTEGRATION_LABEL_NAMES = { - // synced with https://github.com/primer/react/labels?q=integration-tests - skipped: 'integration-tests: skipped manually', - recommended: 'integration-tests: recommended', - failing: 'integration-tests: failing', - passing: 'integration-tests: passing' - }; - - const issue = { - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo - }; - - const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue(issue); - const existingIntegrationLabels = currentLabels - .map(label => label.name) - .filter(label => label.startsWith('integration-tests:')); - - if (existingIntegrationLabels.includes(INTEGRATION_LABEL_NAMES.skipped)) return; - - const result = await github.rest.issues.listComments(issue); - const integrationComments = result.data.filter( - comment => - comment.user.login == 'primer-integration[bot]' && - comment.body.includes('