[tasks/github] Fix TypeError in collect_releases when GraphQL returns None#3722
Draft
devs6186 wants to merge 1 commit intochaoss:mainfrom
Draft
[tasks/github] Fix TypeError in collect_releases when GraphQL returns None#3722devs6186 wants to merge 1 commit intochaoss:mainfrom
devs6186 wants to merge 1 commit intochaoss:mainfrom
Conversation
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
requested changes
Feb 24, 2026
Comment on lines
+193
to
+194
| if data is None: | ||
| return |
Contributor
There was a problem hiding this comment.
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 |
Contributor
|
draft mode due to contributor indication on slack that this is an abandoned PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changeset
fetch_data()inreleases/core.pybefore the'data' in datacheckdata['data']['repository']itself is Nonefetch_data(..., True)call inreleases_model()against a None returnNotes
request_graphql_dict()can return None when the API call fails (network error, private repo, etc). Doingif 'data' in data:on a NoneType raisesTypeError: 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
This PR fixes #3709
Notes for Reviewers
Three small guard additions in the same file. No logic changes to the happy path.
Signed commits