Skip to content

Commit

Permalink
Added column for needinfo_user in email template
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminmah committed Aug 6, 2024
1 parent 1c07ddd commit 1c83ba3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bugbot/rules/inactive_revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def get_bugs(self, date="today", bug_ids=[], chunk_size=None):
]
if inactive_revs:
bug["revisions"] = inactive_revs
self._add_needinfo(bugid, inactive_revs)
needinfo_user = self._add_needinfo(bugid, inactive_revs)
bug["needinfo_user"] = needinfo_user
else:
del bugs[bugid]

Expand All @@ -80,7 +81,7 @@ def load_template(self, template_filename: str) -> Template:
template = env.get_template(template_filename)
return template

def _add_needinfo(self, bugid: str, inactive_revs: list) -> None:
def _add_needinfo(self, bugid: str, inactive_revs: list) -> str:
has_old_patch = any(
revision["created_at"] < self.old_patch_limit for revision in inactive_revs
)
Expand Down Expand Up @@ -124,6 +125,8 @@ def _add_needinfo(self, bugid: str, inactive_revs: list) -> None:
}
],
}
return nickname
return ""

def _find_last_action(self, revision_id):
details = self._fetch_revisions([revision_id])
Expand Down
4 changes: 3 additions & 1 deletion templates/inactive_revision.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
<th>Bug</th>
<th>Summary</th>
<th>Patches</th>
<th>Needinfo Requested</th>
</tr>
</thead>
<tbody>
{% for i, (bugid, summary, revisions) in enumerate(data) -%}
{% for i, (bugid, summary, revisions, needinfo_user) in enumerate(data) -%}
<tr {% if i % 2 == 0 %}bgcolor="#E0E0E0"
{% endif -%}
>
Expand All @@ -27,6 +28,7 @@
{% endfor -%}
</ul>
</td>
<td>{{ needinfo_user }}</td>
</tr>
{% endfor -%}
</tbody>
Expand Down

0 comments on commit 1c83ba3

Please sign in to comment.