From b3b509c859eacdcc6609660b232a50525b75fa0b Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Mon, 5 Feb 2024 11:57:54 -0400 Subject: [PATCH 01/15] Adds nightlyfuzz CI --- .github/workflows/nightlyfuzz.yml | 53 +++++++++++++++++++++ fuzz/.gitignore | 1 + fuzz/fuzz_all_native.py | 78 +++++++++++++++++++++++++++++++ sonar-project.properties | 2 +- 4 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nightlyfuzz.yml create mode 100644 fuzz/.gitignore create mode 100644 fuzz/fuzz_all_native.py diff --git a/.github/workflows/nightlyfuzz.yml b/.github/workflows/nightlyfuzz.yml new file mode 100644 index 00000000000..d2798ae37a6 --- /dev/null +++ b/.github/workflows/nightlyfuzz.yml @@ -0,0 +1,53 @@ +name: 'nightly/tag fuzz' +on: + schedule: + # Note: The schedule event can be delayed during periods of high + # loads of GitHub Actions workflow runs. High load times include + # the start of every hour. To decrease the chance of delay, + # schedule your workflow to run at a different time of the hour. + - cron: "25 0 * * *" # at 25 past midnight every day + push: + tags: + - '*' + workflow_dispatch: null +jobs: + fuzzrun: + name: "run native fuzzers" + runs-on: "ubuntu20.04-4cores-16GB" + steps: + - name: "Checkout" + uses: "actions/checkout@v3" + - name: "Setup go" + uses: "actions/setup-go@v3" + with: + go-version-file: 'go.mod' + cache: true + cache-dependency-path: 'go.sum' + - name: "Get corpus directory" + id: "get-corpus-dir" + run: echo "corpus_dir=$(go env GOCACHE)/fuzz" >> $GITHUB_OUTPUT + shell: "bash" + - name: "Restore corpus" + uses: "actions/cache/restore@v3" + id: "restore-corpus" + with: + path: "${{ steps.get-corpus-dir.outputs.corpus_dir }}" + # We need to ensure uniqueness of the key, as saving to a key more than once will fail (see Save corpus step). + # We never expect a cache hit with the key but we do expect a hit with the restore-keys prefix that is going + # to match the latest cache that has that prefix. + key: "nightlyfuzz-corpus-${{ github.run_id }}-${{ github.run_attempt }}" + restore-keys: "nightlyfuzz-corpus-" + - name: "Run native fuzzers" + # Fuzz for 1 hour + run: "cd fuzz && ./fuzz_all_native.py --seconds 3600" + - name: "Print failing testcases" + if: failure() + run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done + - name: "Save corpus" + uses: "actions/cache/save@v3" + # We save also on failure, so that we can keep the valuable corpus generated that led to finding a crash. + # If the corpus gets clobbered for any reason, we can remove the offending cache from the Github UI. + if: always() + with: + path: "${{ steps.get-corpus-dir.outputs.corpus_dir }}" + key: "${{ steps.restore-corpus.outputs.cache-primary-key }}" \ No newline at end of file diff --git a/fuzz/.gitignore b/fuzz/.gitignore new file mode 100644 index 00000000000..600ab25dfaf --- /dev/null +++ b/fuzz/.gitignore @@ -0,0 +1 @@ +*/fuzzer \ No newline at end of file diff --git a/fuzz/fuzz_all_native.py b/fuzz/fuzz_all_native.py new file mode 100644 index 00000000000..245c01a92e3 --- /dev/null +++ b/fuzz/fuzz_all_native.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 + +import argparse +import itertools +import os +import re +import subprocess +import sys + +LIBROOT = "../pkg" + +def main(): + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + description="\n".join([ + "Fuzz helper to run all native go fuzzers in chainlink-common", + "", + ]), + ) + parser.add_argument("--ci", required=False, help="In CI mode we run each parser only briefly once", action="store_true") + parser.add_argument("--seconds", required=False, help="Run for this many seconds of total fuzz time before exiting") + args = parser.parse_args() + + # use float for remaining_seconds so we can represent infinity + if args.seconds: + remaining_seconds = float(args.seconds) + else: + remaining_seconds = float("inf") + + fuzzers = discover_fuzzers() + print(f"🐝 Discovered fuzzers:", file=sys.stderr) + for fuzzfn, path in fuzzers.items(): + print(f"{fuzzfn} in {path}", file=sys.stderr) + + if args.ci: + # only run each fuzzer once for 60 seconds in CI + durations_seconds = [60] + else: + # run forever or until --seconds, with increasingly longer durations per fuzz run + durations_seconds = itertools.chain([5, 10, 30, 90, 270], itertools.repeat(600)) + + for duration_seconds in durations_seconds: + print(f"🐝 Running each fuzzer for {duration_seconds}s before switching to next fuzzer", file=sys.stderr) + for fuzzfn, path in fuzzers.items(): + if remaining_seconds <= 0: + print(f"🐝 Time budget of {args.seconds}s is exhausted. Exiting.", file=sys.stderr) + return + + next_duration_seconds = min(remaining_seconds, duration_seconds) + remaining_seconds -= next_duration_seconds + + print(f"🐝 Running {fuzzfn} in {path} for {next_duration_seconds}s before switching to next fuzzer", file=sys.stderr) + run_fuzzer(fuzzfn, path, next_duration_seconds) + print(f"🐝 Completed running {fuzzfn} in {path} for {next_duration_seconds}s. Total remaining time is {remaining_seconds}s", file=sys.stderr) + +def discover_fuzzers(): + fuzzers = {} + for root, dirs, files in os.walk(LIBROOT): + for file in files: + if not file.endswith("test.go"): continue + with open(os.path.join(root, file), "r") as f: + text = f.read() + # ignore multiline comments + text = re.sub(r"(?s)/[*].*?[*]/", "", text) + # ignore single line comments *except* build tags + text = re.sub(r"//.*", "", text) + # Find every function with a name like FuzzXXX + for fuzzfn in re.findall(r"func\s+(Fuzz\w+)", text): + if fuzzfn in fuzzers: + raise Exception(f"Duplicate fuzz function: {fuzzfn}") + fuzzers[fuzzfn] = os.path.relpath(root, LIBROOT) + return fuzzers + +def run_fuzzer(fuzzfn, dir, duration_seconds): + subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"github.com/smartcontractkit/chainlink/core/{dir}"], cwd=LIBROOT) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties index 6ffaba8b19b..8343c0f53b6 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,7 +5,7 @@ sonar.python.version=3.8 # Full exclusions from the static analysis sonar.exclusions=**/node_modules/**/*,**/mocks/**/*, **/testdata/**/*, **/contracts/typechain/**/*, **/contracts/artifacts/**/*, **/contracts/cache/**/*, **/contracts/scripts/**/*, **/generated/**/*, **/fixtures/**/*, **/docs/**/*, **/tools/**/*, **/*.pb.go, **/*report.xml, **/*.config.ts, **/*.txt, **/*.abi, **/*.bin, **/*_codecgen.go, core/services/relay/evm/types/*_gen.go, core/services/relay/evm/types/gen/main.go, core/services/relay/evm/testfiles/*, **/core/web/assets**, core/scripts/chaincli/handler/debug.go # Coverage exclusions -sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go +sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go, fuzz/** # Duplication exclusions sonar.cpd.exclusions=**/contracts/**/*.sol, **/config.go, /core/services/ocr2/plugins/ocr2keeper/evm*/* From 47e6a66c3e80c2272ea0ab175631d0c7b5ac841a Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Mon, 5 Feb 2024 12:38:25 -0400 Subject: [PATCH 02/15] Runs nightly fuzz on the root directory --- fuzz/fuzz_all_native.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/fuzz_all_native.py b/fuzz/fuzz_all_native.py index 245c01a92e3..bc6c5f7d62d 100644 --- a/fuzz/fuzz_all_native.py +++ b/fuzz/fuzz_all_native.py @@ -72,7 +72,7 @@ def discover_fuzzers(): return fuzzers def run_fuzzer(fuzzfn, dir, duration_seconds): - subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"github.com/smartcontractkit/chainlink/core/{dir}"], cwd=LIBROOT) + subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"github.com/smartcontractkit/chainlink/{dir}"], cwd=LIBROOT) if __name__ == "__main__": main() \ No newline at end of file From c6a8a645ce4d5d82da56052ef214a0263deaedbf Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Mon, 5 Feb 2024 13:15:31 -0400 Subject: [PATCH 03/15] Gives proper permissions to fuzz script --- fuzz/fuzz_all_native.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 fuzz/fuzz_all_native.py diff --git a/fuzz/fuzz_all_native.py b/fuzz/fuzz_all_native.py old mode 100644 new mode 100755 From cc624d3c9fe87a4c2a461ca09cf1b895a13ac873 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Mon, 5 Feb 2024 15:41:39 -0400 Subject: [PATCH 04/15] Changes go_core_fuzz command --- tools/bin/go_core_fuzz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index 3ea7d9bb0cb..d0434b8db09 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -16,7 +16,7 @@ use_tee() { cat > "$@" fi } -go test -json -ldflags "$GO_LDFLAGS" github.com/smartcontractkit/chainlink/v2/core/services/relay/evm -fuzz . -fuzztime 12s | use_tee $OUTPUT_FILE +cd ../../fuzz && ./fuzz_all_native.py -ci | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output From b44f1977b2e91015f3ca5c295f381a23cc266216 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 6 Feb 2024 11:39:46 -0400 Subject: [PATCH 05/15] WIP --- tools/bin/go_core_fuzz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index d0434b8db09..ff085413a20 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -16,7 +16,7 @@ use_tee() { cat > "$@" fi } -cd ../../fuzz && ./fuzz_all_native.py -ci | use_tee $OUTPUT_FILE +cd ./fuzz && ./fuzz_all_native.py -ci | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output From 15f3d88183e208b3e8e7e028788738b775f0d753 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 6 Feb 2024 11:48:00 -0400 Subject: [PATCH 06/15] WIP --- tools/bin/go_core_fuzz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index ff085413a20..3a30097f7d2 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -16,7 +16,7 @@ use_tee() { cat > "$@" fi } -cd ./fuzz && ./fuzz_all_native.py -ci | use_tee $OUTPUT_FILE +cd ./fuzz && ./fuzz_all_native.py --ci | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output From 231f921631b0e1f7b9cbbfdfc64fa4ce8b478584 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 6 Feb 2024 12:05:22 -0400 Subject: [PATCH 07/15] Fixes py script to point to chainlink files --- fuzz/fuzz_all_native.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fuzz/fuzz_all_native.py b/fuzz/fuzz_all_native.py index bc6c5f7d62d..db43b63899e 100755 --- a/fuzz/fuzz_all_native.py +++ b/fuzz/fuzz_all_native.py @@ -7,13 +7,13 @@ import subprocess import sys -LIBROOT = "../pkg" +LIBROOT = "../" def main(): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description="\n".join([ - "Fuzz helper to run all native go fuzzers in chainlink-common", + "Fuzz helper to run all native go fuzzers in chainlink", "", ]), ) From 1a53de8a669dbc0fb1145b9cf079b3db1c45b4a2 Mon Sep 17 00:00:00 2001 From: Vyzaldy Sanchez Date: Tue, 6 Feb 2024 14:10:54 -0400 Subject: [PATCH 08/15] Update fuzz/fuzz_all_native.py Co-authored-by: Jordan Krage --- fuzz/fuzz_all_native.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/fuzz_all_native.py b/fuzz/fuzz_all_native.py index db43b63899e..41588b090b7 100755 --- a/fuzz/fuzz_all_native.py +++ b/fuzz/fuzz_all_native.py @@ -72,7 +72,7 @@ def discover_fuzzers(): return fuzzers def run_fuzzer(fuzzfn, dir, duration_seconds): - subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"github.com/smartcontractkit/chainlink/{dir}"], cwd=LIBROOT) + subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"./{dir}"], cwd=LIBROOT) if __name__ == "__main__": main() \ No newline at end of file From f666158d8c00748ea4b72a6de036fc0f9fc46e7e Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Wed, 7 Feb 2024 10:58:09 -0400 Subject: [PATCH 09/15] Logs failing fuzz inputs --- tools/bin/go_core_fuzz | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index 3a30097f7d2..2ed8a6778a8 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -6,9 +6,8 @@ SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} USE_TEE="${USE_TEE:-true}" -echo "Failed tests and panics: ---------------------" +echo "Failed fuzz tests and panics: ---------------------" echo "" -GO_LDFLAGS=$(bash tools/bin/ldflags) use_tee() { if [ "$USE_TEE" = "true" ]; then tee "$@" @@ -29,8 +28,9 @@ fi echo "Exit code: $EXITCODE" if [[ $EXITCODE != 0 ]]; then - echo "Encountered test failures." + echo "Encountered fuzz test failures. Logging all failing fuzz inputs:" + find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done else - echo "All tests passed!" + echo "All fuzz tests passed!" fi exit $EXITCODE From 1273be63d3cd35767c7186777c8d8508869c85de Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Wed, 7 Feb 2024 11:04:05 -0400 Subject: [PATCH 10/15] Bumps actions versions on nightlyfuzz action --- .github/workflows/nightlyfuzz.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightlyfuzz.yml b/.github/workflows/nightlyfuzz.yml index d2798ae37a6..7becbe73de5 100644 --- a/.github/workflows/nightlyfuzz.yml +++ b/.github/workflows/nightlyfuzz.yml @@ -16,9 +16,9 @@ jobs: runs-on: "ubuntu20.04-4cores-16GB" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 - name: "Setup go" - uses: "actions/setup-go@v3" + uses: "actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491" # v5.0.0 with: go-version-file: 'go.mod' cache: true @@ -28,7 +28,7 @@ jobs: run: echo "corpus_dir=$(go env GOCACHE)/fuzz" >> $GITHUB_OUTPUT shell: "bash" - name: "Restore corpus" - uses: "actions/cache/restore@v3" + uses: "actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2" # v4.0.0 id: "restore-corpus" with: path: "${{ steps.get-corpus-dir.outputs.corpus_dir }}" @@ -44,7 +44,7 @@ jobs: if: failure() run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done - name: "Save corpus" - uses: "actions/cache/save@v3" + uses: "actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2" # v4.0.0 # We save also on failure, so that we can keep the valuable corpus generated that led to finding a crash. # If the corpus gets clobbered for any reason, we can remove the offending cache from the Github UI. if: always() From 774a80c8e5fb44326533a4f02d6df04178f0d7ee Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Wed, 7 Feb 2024 15:22:15 -0400 Subject: [PATCH 11/15] Sets fix secs amount on CI fuzz run --- tools/bin/go_core_fuzz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index 2ed8a6778a8..721140c9f06 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -15,7 +15,7 @@ use_tee() { cat > "$@" fi } -cd ./fuzz && ./fuzz_all_native.py --ci | use_tee $OUTPUT_FILE +cd ./fuzz && ./fuzz_all_native.py --ci --seconds 420 | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output From 5d11ad6cc52c2c3e3fd5b02a2d01bf8a877fed0b Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Wed, 7 Feb 2024 21:10:10 -0400 Subject: [PATCH 12/15] Adds comment on `--seconds` usage --- tools/bin/go_core_fuzz | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index 721140c9f06..2ee251b5ec5 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -15,6 +15,9 @@ use_tee() { cat > "$@" fi } + +# the amount of --seconds here is subject to change based on how long the CI job takes in the future +# as we add more fuzz tests, we should take into consideration increasing this timelapse, so we can have enough coverage. cd ./fuzz && ./fuzz_all_native.py --ci --seconds 420 | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} From 97a647d505adb87a6cdb19269d58683892ebd88a Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Fri, 9 Feb 2024 12:53:33 -0400 Subject: [PATCH 13/15] Fixes sonar exclusion on fuzz --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index d7b46af98ea..119bf21cd65 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,7 +5,7 @@ sonar.python.version=3.8 # Full exclusions from the static analysis sonar.exclusions=**/node_modules/**/*,**/mocks/**/*, **/testdata/**/*, **/contracts/typechain/**/*, **/contracts/artifacts/**/*, **/contracts/cache/**/*, **/contracts/scripts/**/*, **/generated/**/*, **/fixtures/**/*, **/docs/**/*, **/tools/**/*, **/*.pb.go, **/*report.xml, **/*.config.ts, **/*.txt, **/*.abi, **/*.bin, **/*_codecgen.go, core/services/relay/evm/types/*_gen.go, core/services/relay/evm/types/gen/main.go, core/services/relay/evm/testfiles/*, **/core/web/assets**, core/scripts/chaincli/handler/debug.go # Coverage exclusions -sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go, fuzz/** +sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go, **/fuzz/* # Duplication exclusions sonar.cpd.exclusions=**/contracts/**/*.sol, **/config.go, /core/services/ocr2/plugins/ocr2keeper/evm*/*,**/integration-tests/testconfig/**/* From 436cd4a655e10f1ee1cd92ee998ae424870f348c Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Fri, 9 Feb 2024 13:14:55 -0400 Subject: [PATCH 14/15] Fixes sonar exclusion on fuzz --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 119bf21cd65..a3fadde9b38 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,7 +5,7 @@ sonar.python.version=3.8 # Full exclusions from the static analysis sonar.exclusions=**/node_modules/**/*,**/mocks/**/*, **/testdata/**/*, **/contracts/typechain/**/*, **/contracts/artifacts/**/*, **/contracts/cache/**/*, **/contracts/scripts/**/*, **/generated/**/*, **/fixtures/**/*, **/docs/**/*, **/tools/**/*, **/*.pb.go, **/*report.xml, **/*.config.ts, **/*.txt, **/*.abi, **/*.bin, **/*_codecgen.go, core/services/relay/evm/types/*_gen.go, core/services/relay/evm/types/gen/main.go, core/services/relay/evm/testfiles/*, **/core/web/assets**, core/scripts/chaincli/handler/debug.go # Coverage exclusions -sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go, **/fuzz/* +sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go, **/fuzz/**/* # Duplication exclusions sonar.cpd.exclusions=**/contracts/**/*.sol, **/config.go, /core/services/ocr2/plugins/ocr2keeper/evm*/*,**/integration-tests/testconfig/**/* From 2613326f72fc197155a0a3a531a626f6e44dc8a4 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Fri, 9 Feb 2024 14:06:14 -0400 Subject: [PATCH 15/15] Fixes sonar exclusion on fuzz --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index a3fadde9b38..f522b3fa73c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,9 +3,9 @@ sonar.sources=. sonar.python.version=3.8 # Full exclusions from the static analysis -sonar.exclusions=**/node_modules/**/*,**/mocks/**/*, **/testdata/**/*, **/contracts/typechain/**/*, **/contracts/artifacts/**/*, **/contracts/cache/**/*, **/contracts/scripts/**/*, **/generated/**/*, **/fixtures/**/*, **/docs/**/*, **/tools/**/*, **/*.pb.go, **/*report.xml, **/*.config.ts, **/*.txt, **/*.abi, **/*.bin, **/*_codecgen.go, core/services/relay/evm/types/*_gen.go, core/services/relay/evm/types/gen/main.go, core/services/relay/evm/testfiles/*, **/core/web/assets**, core/scripts/chaincli/handler/debug.go +sonar.exclusions=**/node_modules/**/*,**/mocks/**/*, **/testdata/**/*, **/contracts/typechain/**/*, **/contracts/artifacts/**/*, **/contracts/cache/**/*, **/contracts/scripts/**/*, **/generated/**/*, **/fixtures/**/*, **/docs/**/*, **/tools/**/*, **/*.pb.go, **/*report.xml, **/*.config.ts, **/*.txt, **/*.abi, **/*.bin, **/*_codecgen.go, core/services/relay/evm/types/*_gen.go, core/services/relay/evm/types/gen/main.go, core/services/relay/evm/testfiles/*, **/core/web/assets**, core/scripts/chaincli/handler/debug.go, **/fuzz/**/* # Coverage exclusions -sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go, **/fuzz/**/* +sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/contracts/test/**/*, **/contracts/**/tests/**/*, **/core/**/testutils/**/*, **/core/**/mocks/**/*, **/core/**/cltest/**/*, **/integration-tests/**/*, **/generated/**/*, **/core/scripts**/* , **/*.pb.go, ./plugins/**/*, **/main.go, **/0195_add_not_null_to_evm_chain_id_in_job_specs.go, **/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go # Duplication exclusions sonar.cpd.exclusions=**/contracts/**/*.sol, **/config.go, /core/services/ocr2/plugins/ocr2keeper/evm*/*,**/integration-tests/testconfig/**/*