From 9087f5257131fc68cc1be873077adce31e3cac62 Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Sun, 5 Jan 2025 23:52:24 -0500 Subject: [PATCH] Drop panic check wf --- .github/workflows/ci_manager.yml | 6 --- .github/workflows/improve_panics.yml | 56 ---------------------------- 2 files changed, 62 deletions(-) delete mode 100644 .github/workflows/improve_panics.yml diff --git a/.github/workflows/ci_manager.yml b/.github/workflows/ci_manager.yml index eefe41b9e6b..66f56ed4b98 100644 --- a/.github/workflows/ci_manager.yml +++ b/.github/workflows/ci_manager.yml @@ -124,11 +124,6 @@ jobs: if: needs.check-changes.outputs.run_tests == 'full' uses: ./.github/workflows/benchmarks.yml - start-panic-check: - needs: check-changes - if: needs.check-changes.outputs.run_tests == 'full' - uses: ./.github/workflows/improve_panics.yml - ran-full: runs-on: ubuntu-22.04 needs: [ @@ -142,7 +137,6 @@ jobs: start-windows-release-build-test, start-windows-tests, start-roc-benchmarks, - start-panic-check ] steps: - run: echo "all workflows succeeded!" diff --git a/.github/workflows/improve_panics.yml b/.github/workflows/improve_panics.yml deleted file mode 100644 index a6b37df4f49..00000000000 --- a/.github/workflows/improve_panics.yml +++ /dev/null @@ -1,56 +0,0 @@ -on: - workflow_call: - -# Check that the number of panicking function/macro calls has not increased -# https://github.com/roc-lang/roc/issues/2046 -name: Improve panics/unwrap/expect - -jobs: - improve-panics: - name: improve panics - runs-on: [ubuntu-22.04] - timeout-minutes: 15 - env: - FORCE_COLOR: 1 - RUST_BACKTRACE: 1 - steps: - # install nix - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-unstable - - - name: checkout source branch in separate directory - uses: actions/checkout@v4 - with: - clean: true - path: source_branch_dir - ref: ${{ github.ref }} - - - name: checkout target branch in separate directory - uses: actions/checkout@v4 - with: - clean: false - path: target_branch_dir - ref: ${{ github.base_ref }} - - - name: Compare panics, expects, and unwraps between source and target brach - run: | - for branch_dir in source_branch_dir target_branch_dir; do - cd $branch_dir - echo "Calculating violations in &branch_dir..." - VIOLATIONS=$(nix develop -c cargo clippy --no-deps -- -W clippy::unwrap_used -W clippy::expect_used -W clippy::panic 2> >(grep -e "warning: \`panic\`" -e "warning: used" -e "warning: usage of" | wc -l )) - echo $VIOLATIONS > violations - cd .. - done - - SOURCE_VIOLATIONS=$(cat source_branch_dir/violations) - TARGET_VIOLATIONS=$(cat target_branch_dir/violations) - if [ "$SOURCE_VIOLATIONS" -gt "$TARGET_VIOLATIONS" ]; then - echo "You added panic/unwrap/expect, in this PR their count increased from $TARGET_VIOLATIONS to $SOURCE_VIOLATIONS." - echo "These calls can kill the REPL, try alternative error handling." - echo "" - echo "TIP: Ask AI \"In rust, how can I rewrite code that contains panic or unwrap so it doesn't crash?\"" - echo "" - echo "If you believe your panic/unwrap/expect is justified, ask Anton-4, rtfeldman or lukewilliamboswell to bypass this workflow failure." - exit 1 - fi