Strip volatile SMART counters from ticket title to stop comment spam
Lint / Python (flake8) (push) Failing after 46s
Security / Python Security (bandit) (push) Successful in 57s
Test / Python Tests (pytest) (push) Successful in 1m29s
Lint / Notify on failure (push) Successful in 3s

Power_On_Hours and other SMART counters embedded in the issue string
were included verbatim in the ticket title. Since the count increments
every hour, the title was "new" on every run, triggering a title-update
comment every single cycle (307 spam comments on two tickets).

Strip ': Warning <attr>: <N>' / ': Critical <attr>: <N>' suffixes from
the title before building the ticket payload. Counter values are still
fully captured in the ticket description.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 08:16:35 -04:00
parent c0c96bf003
commit 26e2d1cec8
+4
View File
@@ -1919,6 +1919,10 @@ class SystemHealthMonitor:
clean_issue = clean_issue.replace('[cluster-wide] ', '').replace('[cluster-wide]', '')
# Remove [ceph] marker since _categorize_issue adds it as issue_tag
clean_issue = clean_issue.replace('[ceph] ', '').replace('[ceph]', '')
# Strip ever-changing SMART counters from the title so the title stays
# stable across runs and doesn't trigger hourly "Title updated" comment spam.
# The counter values are already captured in the ticket description.
clean_issue = re.sub(r':\s*(?:Warning|Critical)\s+\w+:\s*\d+', '', clean_issue).strip(': ').strip()
# Extract drive capacity if this is a drive-related issue.
# Issue strings now use serial numbers; find the matching drive by serial.