Skip to content

fix(worker): handle None branch in notification matching - #1880

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/worker-none-branch-match
Open

fix(worker): handle None branch in notification matching#1880
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/worker-none-branch-match

Conversation

@sentry

@sentry sentry Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a TypeError occurring in the app.tasks.notify.Notify task. The error, "TypeError: expected string or bytes-like object, got 'NoneType'", was traced back to re.match() being called with None as its string argument.

The root cause was identified in apps/worker/services/notification/notifiers/status/base.py, where can_we_set_this_status passes head.branch directly to the match() helper function in helpers/match.py. For certain commits (predominantly from the milvus-io/milvus repository), head.branch can be None.

To fix this, apps/worker/helpers/match.py has been updated. The match() function now explicitly handles None values for its string parameter by coercing them to an empty string (""). This prevents the TypeError and ensures that commits without an associated branch correctly fail to match any branch-specific notification filters.

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-R8F

@codecov-notifications

codecov-notifications Bot commented Aug 1, 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 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.83%. Comparing base (d8942db) to head (334eb4a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1880   +/-   ##
=======================================
  Coverage   91.83%   91.83%           
=======================================
  Files        1332     1332           
  Lines       51830    51831    +1     
  Branches     1647     1647           
=======================================
+ Hits        47598    47599    +1     
  Misses       3911     3911           
  Partials      321      321           
Flag Coverage Δ
workerintegration 58.51% <100.00%> (+<0.01%) ⬆️
workerunit 90.39% <100.00%> (+<0.01%) ⬆️

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.

0 participants