One function

write_to_markdown in github-community-projects/issue-metrics

The author described this change as fix: use general term items instead of issues. It counts as a record because the check below fails on the code as it stood at 596129210 and passes on 744d20e02, with nothing else changed between the two runs.

Fix saved2023-06-29
Sharing licenceMIT · LICENSE
Change size+4 4

What the code was meant to do, written into the code itself as a docstring

Write the issues with metrics to a markdown file. Args: issues_with_metrics (IssueWithMetrics): A list of GitHub issues with metrics average_time_to_first_response (datetime.timedelta): The average time to first response for the issues. average_time_to_close (datetime.timedelta): The average time to close for the issues. average_time_to_answer (datetime.timedelta): The average time to answer the discussions. file (file object, optional): The file object to write to. If not provided, a file named "issue_metrics.md" will be created. num_issues_opened (int): The number of issues that remain opened. num_issues_closed (int): The number of issues that were closed. Returns: None.

The change

1717 average_time_to_answer (datetime.timedelta): The average time to answer the discussions.
1818 file (file object, optional): The file object to write to. If not provided,
1919 a file named "issue_metrics.md" will be created.
20- num_issues_opened (int): The number of issues that remain opened.
20+ num_issues_opened (int): The Number of items that remain opened.
2121 num_issues_closed (int): The number of issues that were closed.
2222
2323 Returns:
4141 )
4242 file.write(f"| Average time to close | {average_time_to_close} |\n")
4343 file.write(f"| Average time to answer | {average_time_to_answer} |\n")
44- file.write(f"| Number of issues that remain open | {num_issues_opened} |\n")
45- file.write(f"| Number of issues closed | {num_issues_closed} |\n")
44+ file.write(f"| Number of items that remain open | {num_issues_opened} |\n")
45+ file.write(f"| Number of items closed | {num_issues_closed} |\n")
4646 file.write(
47- f"| Total number of issues created | {len(issues_with_metrics)} |\n\n"
47+ f"| Total number of items created | {len(issues_with_metrics)} |\n\n"
4848 )
4949 file.write(
5050 "| Title | URL | Time to first response | Time to close | Time to answer |\n"

The check that tells the two apart

failpass·test_markdown_writer.py::TestWriteToMarkdown::test_write_to_markdown

Check file test_markdown_writer.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it5961292109e0fec2f7cac506ccc538da9c10b0b8
Broken version dated2023-06-28
Modulemarkdown_writer
Units changedwrite_to_markdown
Fingerprint8600c162b54d0953
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in github-community-projects/issue-metrics