Skip to content

fix(torngit): guard against NoneType in _get_raw_pull_request_commits - #2026

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/torngit-none-len
Open

fix(torngit): guard against NoneType in _get_raw_pull_request_commits#2026
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/torngit-none-len

Conversation

@sentry

@sentry sentry Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a TypeError: object of type 'NoneType' has no len() occurring in app.tasks.test_results.TestResultsFinisherTask.

The root cause is in libs/shared/shared/torngit/github.py, specifically within the _get_raw_pull_request_commits method. The self.api() call on line 1602 can return None when the GitHub API responds with an HTTP 204 (No Content) status. Subsequently, the len(page_results) checks on lines 1603 and 1605 attempt to call len() on this None object, leading to the TypeError.

The fix involves adding or [] to the assignment of page_results on line 1602. This ensures that if self.api() returns None, page_results defaults to an empty list, preventing the TypeError when len() is called.

Legal Boilerplate

Look, I get it. The entity doing business as "Codecov" is owned by Harness, Inc. In 2026 Harness acquired Codecov and as a result Harness is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Harness can use, modify, copy, and redistribute my contributions, under Harness's choice of terms.

Fixes WORKER-Z30

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@thomasrockhu-codecov

Copy link
Copy Markdown
Contributor
✨ Harness AI Code Review View in Harness →

ℹ️ Review in progress — analyzing the changes on this pull request.
This comment updates automatically when the review finishes.

@codspeed-hq

codspeed-hq Bot commented Aug 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing seer/fix/torngit-none-len (ff059ca) with main (68c86d1)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (a8ec2db) during the generation of this report, so 68c86d1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@codecov-notifications

codecov-notifications Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.63%. Comparing base (a8ec2db) to head (ff059ca).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2026   +/-   ##
=======================================
  Coverage   91.63%   91.63%           
=======================================
  Files        1336     1336           
  Lines       53230    53230           
  Branches     1647     1647           
=======================================
  Hits        48778    48778           
  Misses       4131     4131           
  Partials      321      321           
Flag Coverage Δ
apiunit 93.99% <ø> (ø)
sharedintegration 36.76% <0.00%> (ø)
sharedunit 84.88% <100.00%> (ø)
workerintegration 58.49% <ø> (ø)
workerunit 90.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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.

1 participant