Skip to content

tools: skip check suites with no workflowRun in ci_changes_per_commit.py - #11205

Merged
dhalbert merged 1 commit into
adafruit:mainfrom
mikeysklar:fix/ci-null-workflowrun
Aug 17, 2026
Merged

tools: skip check suites with no workflowRun in ci_changes_per_commit.py#11205
dhalbert merged 1 commit into
adafruit:mainfrom
mikeysklar:fix/ci-null-workflowrun

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

What

check_suite["workflowRun"] is null for check suites not attached to a workflow run, such as one whose run was deleted or one belonging to an app integration. get_commit_depth_and_check_suite() indexes into it unconditionally at tools/ci_changes_per_commit.py:158:

if check_suite["workflowRun"]["workflow"]["name"] == "Build CI":

so the scheduler job's "Get last commit with checks" step fails:

Traceback (most recent call last):
  File "tools/ci_changes_per_commit.py", line 241, in <module>
  File "tools/ci_changes_per_commit.py", line 218, in main
  File "tools/ci_changes_per_commit.py", line 158, in get_commit_depth_and_check_suite
TypeError: 'NoneType' object is not subscriptable

When scheduler fails, every downstream job is skipped, so the PR gets no build coverage at all.

Why

An entry with no workflow run can never match "Build CI", so skipping it is the whole fix.

How I tested it

The traceback above is from a real scheduler run on my fork. With the guard, scheduler completes and the downstream jobs run.

No hardware involved. I could not reproduce it on demand, since it depends on which check suites GitHub returns for a given commit.

Scope

One guard, one file. No change to which commit is selected when workflowRun is present.

AI assistance

Written with Claude Code. I reproduced the failure and verified the fix on my own CI.

check_suite["workflowRun"] is null for check suites that are not attached to a
workflow run, for example one that was deleted or one belonging to an app
integration. get_commit_depth_and_check_suite() dereferenced it
unconditionally:

    TypeError: 'NoneType' object is not subscriptable

which fails the scheduler job's Get-last-commit-with-checks step. Skip those
entries rather than indexing into them.

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Makes sense, though I have never encountered this CI error myself.

@dhalbert
dhalbert merged commit c054022 into adafruit:main Aug 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants