diff --git a/.github/actions/slack/action.yml b/.github/actions/slack/action.yml deleted file mode 100644 index e1b49f33b78b..000000000000 --- a/.github/actions/slack/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Notify slack on failure' -description: 'Notifying Slack of failure' - -inputs: - JOB_NAME: - description: 'Name of the job' - required: true - SLACK_BOT_TOKEN: - required: true - -runs: - using: 'composite' - steps: - - name: Notify about failed test - uses: slackapi/slack-github-action@f234e852e1ff9c0a5f1d26da7fce48631c5cc199 # v=v1.24.0 - with: - channel-id: 'C015EBF2XB6' - slack-message: '${{ inputs.JOB_NAME }} job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' - env: - SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33fe180471c8..c5a3b0740b62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,11 +44,6 @@ jobs: run: pnpm tslint - name: Check for circular dependencies run: pnpm -s ts-circular-deps:check - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'Lint check' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} api_golden_checks: runs-on: ubuntu-latest @@ -67,11 +62,6 @@ jobs: run: pnpm install --frozen-lockfile - name: Check API Goldens run: pnpm bazel test goldens/... - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'API Golden Checks' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} e2e: runs-on: ubuntu-latest @@ -90,11 +80,6 @@ jobs: run: pnpm install --frozen-lockfile - name: Run e2e tests run: pnpm e2e --flaky_test_attempts=2 - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'E2E test' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} integration: runs-on: ubuntu-latest @@ -114,11 +99,6 @@ jobs: - name: Run integration tests run: pnpm integration-tests continue-on-error: true - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'Integration test' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} test: runs-on: ubuntu-latest-16core @@ -137,11 +117,6 @@ jobs: run: pnpm install --frozen-lockfile - name: Run tests run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'Test' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} build: runs-on: ubuntu-latest-16core @@ -160,11 +135,6 @@ jobs: run: pnpm install --frozen-lockfile - name: Run tests run: bazel build --build_tag_filters=-docs-package,-release-package -- src/... - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'Build' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} publish_snapshots: runs-on: ubuntu-latest-4core @@ -191,11 +161,6 @@ jobs: run: ./scripts/circleci/publish-snapshots.sh env: SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }} - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'Snapshot publishing' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} deploy_doc_site: runs-on: ubuntu-latest-4core @@ -225,11 +190,6 @@ jobs: CIRCLE_SHA1: ${{ github.sha }} DOCS_SITE_GCP_SERVICE_KEY: ${{ secrets.DOCS_SITE_GCP_SERVICE_KEY }} DOCS_DEPLOY_GITHUB_TOKEN: ${{ secrets.DOCS_DEPLOY_GITHUB_TOKEN }} - - uses: ./.github/actions/slack - if: failure() - with: - JOB_NAME: 'Docs site deployment' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} browserstack: runs-on: ubuntu-latest diff --git a/.github/workflows/scheduled-ci.yml b/.github/workflows/scheduled-ci.yml index 1fbc9dd33b8a..77227fe479d5 100644 --- a/.github/workflows/scheduled-ci.yml +++ b/.github/workflows/scheduled-ci.yml @@ -36,11 +36,6 @@ jobs: run: pnpm install - name: Run Browser tests run: pnpm bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... - - uses: ./.github/actions/slack - if: ${{ failure() && github.event_name == 'push' }} - with: - JOB_NAME: 'Browser snapshot test' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} linker_snapshot_tests: runs-on: ubuntu-latest-4core @@ -65,11 +60,6 @@ jobs: run: pnpm test-linker-aot - name: Run linker tests using JIT run: pnpm test-linker-jit - - uses: ./.github/actions/slack - if: ${{ failure() && github.event_name == 'push' }} - with: - JOB_NAME: 'Linker snapshot test' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} monitor-docs-site: runs-on: ubuntu-latest @@ -85,9 +75,4 @@ jobs: - name: Install node modules run: pnpm install --frozen-lockfile - name: Check Docs Site - run: ppnpm ci-docs-monitor-test - - uses: ./.github/actions/slack - if: ${{ failure() && github.event_name == 'push' }} - with: - JOB_NAME: 'Docs site monitoring' - SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} + run: pnpm ci-docs-monitor-test diff --git a/package.json b/package.json index ce59961eb5b2..4e3e75c92480 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "tsc": "node ./node_modules/typescript/bin/tsc", "ci-push-deploy-docs-app": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/docs-deploy/deploy-ci-push.mts", "ci-docs-monitor-test": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/docs-deploy/monitoring/ci-test.mts", - "ci-notify-slack-failure": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/circleci/notify-slack-job-failure.mts", "prepare": "husky" }, "version": "20.1.0-next.0", diff --git a/scripts/circleci/notify-slack-job-failure.mts b/scripts/circleci/notify-slack-job-failure.mts deleted file mode 100644 index 8f15ec03c16e..000000000000 --- a/scripts/circleci/notify-slack-job-failure.mts +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node - -/** - * Script that notifies Slack about the currently failing job. This script - * will be a noop when running for forked builds (i.e. PRs). - */ - -import sh from 'shelljs'; -import {isVersionBranch, getConfig, assertValidGithubConfig} from '@angular/ng-dev'; - -if (process.env['CIRCLE_PR_NUMBER'] !== undefined) { - console.info('Skipping notifications for pull requests.'); - process.exit(0); -} - -const jobName = process.env['CIRCLE_JOB']!; -const branchName = process.env['CIRCLE_BRANCH']!; -const jobUrl = process.env['CIRCLE_BUILD_URL']!; -const webhookUrl = process.env['SLACK_COMPONENTS_CI_FAILURES_WEBHOOK_URL']!; - -const {github} = await getConfig([assertValidGithubConfig]); -const isPublishBranch = isVersionBranch(branchName) || branchName === github.mainBranchName; - -// We don't want to spam the CI failures channel with e.g. Renovate branch failures. -if (isPublishBranch === false) { - console.info('Skipping notifications for non-publish branches.'); - process.exit(0); -} - -const text = `\`${jobName}\` failed in branch: ${branchName}: ${jobUrl}`; -const payload: {text: string; channel?: string} = {text}; -const [channelName] = process.argv.slice(2); - -sh.set('-e'); - -// If an explicit channel has been specified, override the default -// webhook channel to the specified one. -if (channelName !== undefined) { - payload.channel = channelName; -} - -sh.echo(JSON.stringify(payload, null, 2)).exec( - `curl -d@- -H "Content-Type: application/json" ${webhookUrl}`, -); -console.info('Notified Slack about job failure.');