Skip to content

[tasks/github] Fix TypeError in collect_releases when GraphQL returns None#3722

Draft
devs6186 wants to merge 1 commit intochaoss:mainfrom
devs6186:fix/3709-releases-none-typeerror
Draft

[tasks/github] Fix TypeError in collect_releases when GraphQL returns None#3722
devs6186 wants to merge 1 commit intochaoss:mainfrom
devs6186:fix/3709-releases-none-typeerror

Conversation

@devs6186
Copy link

Changeset

  • Added None guard in fetch_data() in releases/core.py before the 'data' in data check
  • Added second None guard for the case where data['data']['repository'] itself is None
  • Guard the fallback fetch_data(..., True) call in releases_model() against a None return

Notes

request_graphql_dict() can return None when the API call fails (network error, private repo, etc). Doing if 'data' in data: on a NoneType raises TypeError: argument of type 'NoneType' is not iterable, which was crashing the collect_releases task. The fix logs a warning and returns cleanly rather than propagating an exception.

The second None check (data['data']['repository'] can be None if GitHub returns {"data": {"repository": null}} for a repo that no longer exists) prevents a similar crash further down.

Related issues/PRs

Description

  • Added None checks in fetch_data() so collect_releases handles a None GraphQL response without crashing

This PR fixes #3709

Notes for Reviewers
Three small guard additions in the same file. No logic changes to the happy path.

Signed commits

  • Yes, I signed my commits.

request_graphql_dict() can return None when the API call fails. The
in-operator check on a NoneType raised TypeError. Added explicit None
guards in fetch_data() and in the two call sites in releases_model() so
the task logs a warning and returns cleanly instead of crashing.

Fixes chaoss#3709

Signed-off-by: devs6186 <devyanshsomvanshi@gmail.com>
@MoralCode MoralCode added the stale Stuff that's abandoned or not making forward progress and may need taking over/reassignment/closing label Feb 19, 2026
Comment on lines +193 to +194
if data is None:
return
Copy link
Contributor

Choose a reason for hiding this comment

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

these early returns concern me - id want to look at the code below them in more detail to see what else could be getting skipped that the default github diff context doesnt show

Comment on lines +209 to +210
if data is None:
return
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@MoralCode
Copy link
Contributor

draft mode due to contributor indication on slack that this is an abandoned PR

@MoralCode MoralCode marked this pull request as draft February 24, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stuff that's abandoned or not making forward progress and may need taking over/reassignment/closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core: collect_releases - TypeError("argument of type 'NoneType' is not iterable")

2 participants