[to_triage] Avoid crashing when running the tool on low priority time
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 68
- Forks
- 92
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 16
Description
I thought at first that this error was a regression of my recent changes; it turns out that the code crashes on weekends:
2022-07-16 18:24:45,546 - ERROR - Tool to_triage
Traceback (most recent call last):
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/bzcleaner.py", line 738, in run
self.send_email(date=date)
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/bzcleaner.py", line 671, in send_email
title, body = self.get_email(date)
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/bzcleaner.py", line 632, in get_email
data = self.get_email_data(date, bug_ids)
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/bzcleaner.py", line 628, in get_email_data
return self.organize(bugs)
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/bzcleaner.py", line 613, in organize
return utils.organize(bugs, self.columns(), key=self.sort_columns())
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/utils.py", line 426, in organize
res = [tuple(info[c] for c in columns) for info in bugs]
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/utils.py", line 426, in <listcomp>
res = [tuple(info[c] for c in columns) for info in bugs]
File "/Users/smujahid/repos/mozilla/relman-auto-nag/auto_nag/utils.py", line 426, in <genexpr>
res = [tuple(info[c] for c in columns) for info in bugs]
KeyError: 'component'
The following two conditions should be moved or handled differently:
-
https://github.com/mozilla/relman-auto-nag/blob/ab8f600876d2dd5d88d9122ae38f53930d1492cf/auto_nag/bzcleaner.py#L342-L345 This condition couses producing an incomplete bug dictionary (the bug will not be filtered out).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with auto_nag/bzcleaner.py around lines 342-345 and 613-628, then inspect auto_nag/scripts/to_triage.py lines 59-62 and the tools.json configuration around line 411. Reproduce the weekend or low-priority run that reaches utils.organize and raises KeyError for component. Done means the tool no longer crashes and the affected bug is correctly filtered or represented completely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100