From 3f3a06f4555f8493cfb73e2ac6ed15d6d767a85a Mon Sep 17 00:00:00 2001 From: Mikhail Shchatko Date: Fri, 13 Sep 2024 11:15:00 +0300 Subject: [PATCH] SERVER-93814 Detect files changed for lint_fuzzer_sanity_patch in the commit queue (#26949) GitOrigin-RevId: 868aa78b1f5fe70fec5acb0c4f7ff276741feb73 --- SConstruct | 10 ++-------- etc/evergreen_yml_components/definitions.yml | 3 +-- evergreen/lint_fuzzer_sanity_patch.sh | 12 ++++++++++++ evergreen/scons_lint.sh | 3 +-- 4 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 evergreen/lint_fuzzer_sanity_patch.sh diff --git a/SConstruct b/SConstruct index bd9764e4a7b..3cc9c9be1da 100644 --- a/SConstruct +++ b/SConstruct @@ -1176,12 +1176,6 @@ env_vars.Add( default="", ) -env_vars.Add( - "ENTERPRISE_REV", - help="Base git revision of enterprise modules", - default="", -) - # Note: This probably is only really meaningful when configured via a variables file. It will # also override whatever the SCons platform defaults would be. env_vars.Add( @@ -6146,7 +6140,7 @@ if get_option("lint-scope") == "changed": "buildscripts/clang_format.py", patch_file, ], - action="REVISION=$REVISION ENTERPRISE_REV=$ENTERPRISE_REV $PYTHON ${SOURCES[0]} lint-git-diff", + action="REVISION=$REVISION $PYTHON ${SOURCES[0]} lint-git-diff", ) eslint = env.Command( @@ -6155,7 +6149,7 @@ if get_option("lint-scope") == "changed": "buildscripts/eslint.py", patch_file, ], - action="REVISION=$REVISION ENTERPRISE_REV=$ENTERPRISE_REV $PYTHON ${SOURCES[0]} lint-git-diff", + action="REVISION=$REVISION $PYTHON ${SOURCES[0]} lint-git-diff", ) else: diff --git a/etc/evergreen_yml_components/definitions.yml b/etc/evergreen_yml_components/definitions.yml index cc43d9026b3..97e3f103ead 100644 --- a/etc/evergreen_yml_components/definitions.yml +++ b/etc/evergreen_yml_components/definitions.yml @@ -1582,8 +1582,7 @@ functions: params: binary: bash args: - - "src/evergreen/run_python_script.sh" - - "evergreen/lint_fuzzer_sanity_patch.py" + - "src/evergreen/lint_fuzzer_sanity_patch.sh" "lint fuzzer sanity all": - *f_expansions_write diff --git a/evergreen/lint_fuzzer_sanity_patch.sh b/evergreen/lint_fuzzer_sanity_patch.sh new file mode 100644 index 00000000000..abca8ef8fca --- /dev/null +++ b/evergreen/lint_fuzzer_sanity_patch.sh @@ -0,0 +1,12 @@ +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" +. "$DIR/prelude.sh" + +set -o errexit +set -o verbose + +cd src + +activate_venv +base_revision="$(git merge-base ${revision} HEAD)" +echo "Base patch revision: $base_revision" +REVISION=$base_revision $python evergreen/lint_fuzzer_sanity_patch.py diff --git a/evergreen/scons_lint.sh b/evergreen/scons_lint.sh index addd2412be3..b37c57054c2 100755 --- a/evergreen/scons_lint.sh +++ b/evergreen/scons_lint.sh @@ -21,8 +21,7 @@ echo "Found mypy executable at '$MYPY'" echo "Setting evergreen tmp dir to $TMPDIR" compile_flags="$compile_flags --evergreen-tmp-dir='${TMPDIR}'" -export extra_flags="" -eval ${compile_env} python3 ./buildscripts/scons.py ${compile_flags} $extra_flags --stack-size=1024 GITDIFFFLAGS="${revision}" REVISION="${revision}" ENTERPRISE_REV="${enterprise_rev}" ${targets} | tee scons-lint.log +eval ${compile_env} python3 ./buildscripts/scons.py ${compile_flags} --stack-size=1024 ${targets} | tee scons-lint.log exit_code=$? $python ./buildscripts/simple_report.py --test-name "${targets}" --log-file scons-lint.log --exit-code $exit_code