Fix timeout check workflow lint job (#142476)

Fixes https://github.com/pytorch/pytorch/issues/142485

The workflow check lint job timed out in trunk, i.e. https://github.com/pytorch/pytorch/actions/runs/12261226178/job/34207762939, and here was what happened:

1. https://github.com/pytorch/pytorch/pull/142294 landed yesterday to build ROCm on 3.13, but the PR had a landrace with https://github.com/pytorch/pytorch/pull/142282 in the generated workflow file
2. The trunk lint check caught that in https://github.com/pytorch/pytorch/blob/main/.github/scripts/report_git_status.sh#L2
3. However, the script also attempted to print the difference with `git diff .github/workflows`.  This command was the one that stuck because `git diff` uses page by default and requires a prompt to display the next page ¯\_(ツ)_/¯

It took so long to debug this because a timeout Nova GHA doesn't print any progress.  I'll create an issue for this.

Bonus:

I also fix the broken print from test tool lint job that confuses GitHub https://github.com/pytorch/pytorch/actions/runs/12261226178 with an annotation failure `Credentials could not be loaded, please check your action inputs`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/142476
Approved by: https://github.com/wdvr
This commit is contained in:
Huy Do
2024-12-10 20:47:22 +00:00
committed by PyTorch MergeBot
parent f57606ab85
commit 6f8751dcc9
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eux
CHANGES=$(git status --porcelain "$1") CHANGES=$(git status --porcelain "$1")
echo "$CHANGES" echo "$CHANGES"
git diff "$1" # NB: Use --no-pager here to avoid git diff asking for a prompt to continue
git --no-pager diff "$1"
[ -z "$CHANGES" ] [ -z "$CHANGES" ]

View File

@ -207,8 +207,8 @@ jobs:
conda activate "${CONDA_ENV}" conda activate "${CONDA_ENV}"
# Test tools # Test tools
python3 -m unittest discover -vs tools/test -p 'test_*.py' PYTHONPATH=$(pwd) pytest tools/test/test_*.py
python3 -m unittest discover -vs .github/scripts -p 'test_*.py' PYTHONPATH=$(pwd) pytest .github/scripts/test_*.py
test_run_test: test_run_test:
name: Test `run_test.py` is usable without boto3 name: Test `run_test.py` is usable without boto3