Skip to content

gh pr checks retains stale checks until a new commit is pushed #4946

@angerson

Description

@angerson

Describe the bug

If checks are re-run on a PR without a new commit push, then the stale checks show up in gh pr checks. For example, this can happen when checks are triggered by a label application, as in tensorflow/build#56. This does match what the API seems to return for the full list of checks for the latest commit, but it's not what I expected.

$ gh --version
gh version 2.4.0 (2021-12-21)
https://github.com/cli/cli/releases/tag/v2.4.0

Steps to reproduce the behavior

  1. Create a PR to a repository that can trigger checks via a label application
  2. Re-trigger the checks multiple times without pushing a new commit
  3. Run gh pr checks on your PR
  4. You should see many repeats of the same checks.

Expected vs actual behavior

Expected: The list of checks is identical to the list on the bottom of the page of the PR web view.
Actual: The list of checks is the full list of all checks ever run on the latest commit.

Logs

I have a PR to my repo at tensorflow/build#56. The list of checks at the bottom of the page says, for example, 11 successful and 1 failing checks. In the history list, if I click on the ❌ next to a6f6663 , I see
5 failing and 63 successful checks. If I run gh pr checks, I get that full list:

The full logs
docker (python3.10)	fail	9s	https://github.com/tensorflow/build/runs/4588640198?check_suite_focus=true
docker (python3.7)	fail	8s	https://github.com/tensorflow/build/runs/4588640022?check_suite_focus=true
docker (python3.8)	fail	9s	https://github.com/tensorflow/build/runs/4588640072?check_suite_focus=true
docker (python3.9)	fail	11s	https://github.com/tensorflow/build/runs/4588640110?check_suite_focus=true
qa/cpu_py38	fail	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py38/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py38/KOKORO/74a2f865-e367-450b-a518-d0d02aad5876/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py38/Targets
QA Tests	pass	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py38/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py38/KOKORO/4d3257ba-2573-433b-8d49-9d9c48c56b63/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py38/Targets
cla/google	pass	1s	https://cla.developers.google.com/about
docker (python3.10)	pass	2m59s	https://github.com/tensorflow/build/runs/4525084401?check_suite_focus=true
docker (python3.10)	pass	15s	https://github.com/tensorflow/build/runs/4587086932?check_suite_focus=true
docker (python3.10)	pass	14s	https://github.com/tensorflow/build/runs/4587099947?check_suite_focus=true
docker (python3.10)	pass	24s	https://github.com/tensorflow/build/runs/4599568538?check_suite_focus=true
docker (python3.10)	pass	21s	https://github.com/tensorflow/build/runs/4599570020?check_suite_focus=true
docker (python3.10)	pass	12s	https://github.com/tensorflow/build/runs/4599570120?check_suite_focus=true
docker (python3.10)	pass	43s	https://github.com/tensorflow/build/runs/4599744169?check_suite_focus=true
docker (python3.10)	pass	29s	https://github.com/tensorflow/build/runs/4599816330?check_suite_focus=true
docker (python3.10)	pass	46s	https://github.com/tensorflow/build/runs/4599862011?check_suite_focus=true
docker (python3.10)	pass	34s	https://github.com/tensorflow/build/runs/4599971932?check_suite_focus=true
docker (python3.10)	pass	36s	https://github.com/tensorflow/build/runs/4600171814?check_suite_focus=true
docker (python3.10)	pass	26s	https://github.com/tensorflow/build/runs/4600186184?check_suite_focus=true
docker (python3.10)	pass	17s	https://github.com/tensorflow/build/runs/4600240945?check_suite_focus=true
docker (python3.10)	pass	15s	https://github.com/tensorflow/build/runs/4600295527?check_suite_focus=true
docker (python3.7)	pass	3m3s	https://github.com/tensorflow/build/runs/4525084175?check_suite_focus=true
docker (python3.7)	pass	14s	https://github.com/tensorflow/build/runs/4587086797?check_suite_focus=true
docker (python3.7)	pass	15s	https://github.com/tensorflow/build/runs/4587099801?check_suite_focus=true
docker (python3.7)	pass	14s	https://github.com/tensorflow/build/runs/4599568390?check_suite_focus=true
docker (python3.7)	pass	11s	https://github.com/tensorflow/build/runs/4599569892?check_suite_focus=true
docker (python3.7)	pass	14s	https://github.com/tensorflow/build/runs/4599569994?check_suite_focus=true
docker (python3.7)	pass	49s	https://github.com/tensorflow/build/runs/4599744053?check_suite_focus=true
docker (python3.7)	pass	35s	https://github.com/tensorflow/build/runs/4599816155?check_suite_focus=true
docker (python3.7)	pass	47s	https://github.com/tensorflow/build/runs/4599861893?check_suite_focus=true
docker (python3.7)	pass	25s	https://github.com/tensorflow/build/runs/4599971817?check_suite_focus=true
docker (python3.7)	pass	23s	https://github.com/tensorflow/build/runs/4600171660?check_suite_focus=true
docker (python3.7)	pass	31s	https://github.com/tensorflow/build/runs/4600186023?check_suite_focus=true
docker (python3.7)	pass	25s	https://github.com/tensorflow/build/runs/4600240852?check_suite_focus=true
docker (python3.7)	pass	21s	https://github.com/tensorflow/build/runs/4600295415?check_suite_focus=true
docker (python3.8)	pass	3m12s	https://github.com/tensorflow/build/runs/4525084266?check_suite_focus=true
docker (python3.8)	pass	18s	https://github.com/tensorflow/build/runs/4587086837?check_suite_focus=true
docker (python3.8)	pass	18s	https://github.com/tensorflow/build/runs/4587099856?check_suite_focus=true
docker (python3.8)	pass	26s	https://github.com/tensorflow/build/runs/4599568422?check_suite_focus=true
docker (python3.8)	pass	13s	https://github.com/tensorflow/build/runs/4599569916?check_suite_focus=true
docker (python3.8)	pass	20s	https://github.com/tensorflow/build/runs/4599570033?check_suite_focus=true
docker (python3.8)	pass	25s	https://github.com/tensorflow/build/runs/4599744089?check_suite_focus=true
docker (python3.8)	pass	44s	https://github.com/tensorflow/build/runs/4599816216?check_suite_focus=true
docker (python3.8)	pass	29s	https://github.com/tensorflow/build/runs/4599861935?check_suite_focus=true
docker (python3.8)	pass	32s	https://github.com/tensorflow/build/runs/4599971850?check_suite_focus=true
docker (python3.8)	pass	14s	https://github.com/tensorflow/build/runs/4600171724?check_suite_focus=true
docker (python3.8)	pass	20s	https://github.com/tensorflow/build/runs/4600186064?check_suite_focus=true
docker (python3.8)	pass	27s	https://github.com/tensorflow/build/runs/4600240882?check_suite_focus=true
docker (python3.8)	pass	20s	https://github.com/tensorflow/build/runs/4600295443?check_suite_focus=true
docker (python3.9)	pass	3m26s	https://github.com/tensorflow/build/runs/4525084334?check_suite_focus=true
docker (python3.9)	pass	13s	https://github.com/tensorflow/build/runs/4587086876?check_suite_focus=true
docker (python3.9)	pass	14s	https://github.com/tensorflow/build/runs/4587099898?check_suite_focus=true
docker (python3.9)	pass	13s	https://github.com/tensorflow/build/runs/4599568501?check_suite_focus=true
docker (python3.9)	pass	19s	https://github.com/tensorflow/build/runs/4599569971?check_suite_focus=true
docker (python3.9)	pass	20s	https://github.com/tensorflow/build/runs/4599570075?check_suite_focus=true
docker (python3.9)	pass	42s	https://github.com/tensorflow/build/runs/4599744138?check_suite_focus=true
docker (python3.9)	pass	28s	https://github.com/tensorflow/build/runs/4599816269?check_suite_focus=true
docker (python3.9)	pass	43s	https://github.com/tensorflow/build/runs/4599861974?check_suite_focus=true
docker (python3.9)	pass	24s	https://github.com/tensorflow/build/runs/4599971889?check_suite_focus=true
docker (python3.9)	pass	31s	https://github.com/tensorflow/build/runs/4600171772?check_suite_focus=true
docker (python3.9)	pass	24s	https://github.com/tensorflow/build/runs/4600186111?check_suite_focus=true
docker (python3.9)	pass	23s	https://github.com/tensorflow/build/runs/4600240910?check_suite_focus=true
docker (python3.9)	pass	21s	https://github.com/tensorflow/build/runs/4600295476?check_suite_focus=true
qa/cpu_py37	pass	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py37/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py37/KOKORO/0becb278-9159-466b-ae54-cf152c4a70c9/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py37/Targets
qa/cpu_py39	pass	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py39/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py39/KOKORO/c2c949c9-48fb-420c-b4ca-e997d24f2142/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fcpu_py39/Targets
qa/gpu_py37	pass	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py37/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py37/KOKORO/d4bd346d-54e3-4f96-94a5-44d32ec5e279/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py37/Targets
qa/gpu_py38	pass	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py38/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py38/KOKORO/369703a3-8443-440c-8f82-0c8de435a7e0/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py38/Targets
qa/gpu_py39	pass	0	http://fusion/runanalysis/info/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py39/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py39/KOKORO/fc4cb794-7902-4386-b307-4e00f9e29d80/0/prod%3Atensorflow%2Frel%2Fnightly_docker%2Fqa%2Fgpu_py39/Targets

This list is way too big isn't helpful for automation. I want the active set of checks; i.e. the same list of checks that GitHub is going to use to evaluate merge-readiness. That seems like it should be the default behavior; maybe a flag could unlock the "give me the full list of all checks ever run" option?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedContributions welcomepriority-2Affects more than a few users but doesn't prevent core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions