Skip to content

Commit

Permalink
infra: fail check_diffs if too many files changed (#15423)
Browse files Browse the repository at this point in the history
Jobs like
https://github.com/langchain-ai/langchain/actions/runs/7389187843/job/20101494206
only receive the first 300 changed files. Because of the opportunity to
miss packages, better to auto-fail and manually run.

Checking that it does what I expect in #15424
  • Loading branch information
efriis authored Jan 3, 2024
1 parent 69a8a26 commit 1437872
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/scripts/check_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
files = sys.argv[1:]
dirs_to_run = set()

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.")

for file in files:
if any(
file.startswith(dir_)
Expand Down Expand Up @@ -48,4 +52,5 @@
dirs_to_run.update(LANGCHAIN_DIRS)
else:
pass
print(json.dumps(list(dirs_to_run)))
json_output = json.dumps(list(dirs_to_run))
print(f"dirs-to-run={json_output}")
3 changes: 2 additions & 1 deletion .github/workflows/check_diffs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
- id: files
uses: Ana06/[email protected]
- id: set-matrix
run: echo "dirs-to-run=$(python .github/scripts/check_diff.py ${{ steps.files.outputs.all }})" >> $GITHUB_OUTPUT
run: |
python .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
outputs:
dirs-to-run: ${{ steps.set-matrix.outputs.dirs-to-run }}
ci:
Expand Down

0 comments on commit 1437872

Please sign in to comment.