Skip to content

Commit 38ca291

Browse files
committed
feat: connect status up to actual api call
Signed-off-by: Zack Koppert <[email protected]>
1 parent 155da57 commit 38ca291

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

classes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class IssueWithMetrics:
2424
label_metrics (dict, optional): A dictionary containing the label metrics
2525
mentor_activity (dict, optional): A dictionary containing active mentors
2626
created_at (datetime, optional): The time the issue was created.
27+
status (str, optional): The status of the issue, e.g., "open", "closed as completed",
2728
"""
2829

2930
# pylint: disable=too-many-instance-attributes
@@ -42,6 +43,7 @@ def __init__(
4243
created_at=None,
4344
assignee=None,
4445
assignees=None,
46+
status=None,
4547
):
4648
self.title = title
4749
self.html_url = html_url
@@ -55,3 +57,4 @@ def __init__(
5557
self.label_metrics = labels_metrics
5658
self.mentor_activity = mentor_activity
5759
self.created_at = created_at
60+
self.status = status

issue_metrics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,12 @@ def get_per_issue_metrics(
175175
issue_with_metrics.time_to_close = measure_time_to_close(
176176
issue, None
177177
)
178+
if env_vars.hide_status is False:
179+
issue_with_metrics.status = f"{issue.issue.state} as {issue.issue.state_reason}" # type: ignore
178180
elif issue.state == "open": # type: ignore
179181
num_issues_open += 1
182+
if env_vars.hide_status is False:
183+
issue_with_metrics.status = f"{issue.issue.state}" # type: ignore
180184
if not env_vars.hide_created_at:
181185
if isinstance(issue, github3.search.IssueSearchResult): # type: ignore
182186
issue_with_metrics.created_at = issue.issue.created_at # type: ignore

markdown_writer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def get_non_hidden_columns(labels) -> List[str]:
7575
if not hide_time_to_answer:
7676
columns.append("Time to answer")
7777

78-
hide_status = env_vars.hide_status # Check the new attribute
78+
hide_status = env_vars.hide_status
7979
if not hide_status:
80-
columns.append("Status") # Add the 'status' column
80+
columns.append("Status")
8181

8282
enable_time_in_draft = env_vars.draft_pr_tracking
8383
if enable_time_in_draft:
@@ -236,8 +236,8 @@ def write_to_markdown(
236236
file.write(f" {issue.label_metrics[label]} |")
237237
if "Created At" in columns:
238238
file.write(f" {issue.created_at} |")
239-
if "Status" in columns: # Check if 'Status' column is to be displayed
240-
file.write(f" {issue.status} |") # Write the status of the issue
239+
if "Status" in columns:
240+
file.write(f" {issue.status} |")
241241
file.write("\n")
242242
file.write(
243243
"\n_This report was generated with the \

0 commit comments

Comments
 (0)