From 255ad39ae3e3379a76c266d850b5d69e69c54203 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:30:56 -0700 Subject: [PATCH] infra: run CI on large diffs (#23192) currently we skip CI on diffs >= 300 files. think we should just run it on all packages instead --------- Co-authored-by: Erick Friis --- .github/scripts/check_diff.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/scripts/check_diff.py b/.github/scripts/check_diff.py index 197df34dec9..7d24719ac40 100644 --- a/.github/scripts/check_diff.py +++ b/.github/scripts/check_diff.py @@ -15,6 +15,10 @@ LANGCHAIN_DIRS = [ "libs/experimental", ] +def all_package_dirs() -> Set[str]: + return {"/".join(path.split("/")[:-1]) for path in glob.glob("./libs/**/pyproject.toml", recursive=True)} + + def dependents_graph() -> dict: dependents = defaultdict(set) @@ -53,10 +57,11 @@ if __name__ == "__main__": } docs_edited = False - if len(files) == 300: + if len(files) >= 300: # max diff length is 300 files - there are likely files missing - raise ValueError("Max diff reached. Please manually run CI on changed libs.") - + dirs_to_run["lint"] = all_package_dirs() + dirs_to_run["test"] = all_package_dirs() + dirs_to_run["extended-test"] = set(LANGCHAIN_DIRS) for file in files: if any( file.startswith(dir_)