Repository: github/issue-metrics
Pull request #203 (2024-02-05 09:08:22)

linking author to profile

## Proposed Changes
- Minor change, just linking the author to their GitHub Profile.

## Readiness Checklist

### Author/Contributor
- [x] If documentation is needed for this change, has that been included in this pull request
- [x] run `make lint` and fix any issues that you have introduced
- [x] run `make test` and ensure you have test coverage for the lines you are introducing

### Reviewer
- [x] Label as either `bug`, `documentation`, `enhancement`, `infrastructure`, or `breaking`



Patch:
diff --git a/markdown_writer.py b/markdown_writer.py
index 1ae1714..ba49622 100644
--- a/markdown_writer.py
+++ b/markdown_writer.py
@@ -155,7 +155,7 @@ def write_to_markdown(
 
             file.write(f"| " f"{issue.title} | " f"{issue.html_url} |")
             if "Author" in columns:
-                file.write(f" {issue.author} |")
+                file.write(f" [{issue.author}](https://github.com/{issue.author}) |")
             if "Time to first response" in columns:
                 file.write(f" {issue.time_to_first_response} |")
             if "Time to close" in columns:


Test patch:
diff --git a/test_markdown_writer.py b/test_markdown_writer.py
index 38d4025..6988b94 100644
--- a/test_markdown_writer.py
+++ b/test_markdown_writer.py
@@ -114,9 +114,9 @@ class TestWriteToMarkdown(unittest.TestCase):
             "| Title | URL | Author | Time to first response | Time to close |"
             " Time to answer | Time spent in bug |\n"
             "| --- | --- | --- | --- | --- | --- | --- |\n"
-            "| Issue 1 | https://github.com/user/repo/issues/1 | alice | 1 day, 0:00:00 | "
+            "| Issue 1 | https://github.com/user/repo/issues/1 | [alice](https://github.com/alice) | 1 day, 0:00:00 | "
             "2 days, 0:00:00 | 3 days, 0:00:00 | 1 day, 0:00:00 |\n"
-            "| Issue 2 | https://github.com/user/repo/issues/2 | bob | 3 days, 0:00:00 | "
+            "| Issue 2 | https://github.com/user/repo/issues/2 | [bob](https://github.com/bob) | 3 days, 0:00:00 | "
             "4 days, 0:00:00 | 5 days, 0:00:00 | 2 days, 0:00:00 |\n\n"
             "_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
             "Search query used to find these items: `is:issue is:open label:bug`\n"
@@ -210,9 +210,9 @@ class TestWriteToMarkdown(unittest.TestCase):
             "| Title | URL | Author | Time to first response | Time to close |"
             " Time to answer | Time spent in bug |\n"
             "| --- | --- | --- | --- | --- | --- | --- |\n"
-            "| Issue 1 | https://github.com/user/repo/issues/1 | alice | 1 day, 0:00:00 | "
+            "| Issue 1 | https://github.com/user/repo/issues/1 | [alice](https://github.com/alice) | 1 day, 0:00:00 | "
             "2 days, 0:00:00 | 3 days, 0:00:00 | 1 day, 0:00:00 |\n"
-            "| feat&#124; Issue 2 | https://github.com/user/repo/issues/2 | bob | 3 days, 0:00:00 | "
+            "| feat&#124; Issue 2 | https://github.com/user/repo/issues/2 | [bob](https://github.com/bob) | 3 days, 0:00:00 | "
             "4 days, 0:00:00 | 5 days, 0:00:00 | 2 days, 0:00:00 |\n\n"
             "_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
         )
@@ -321,8 +321,8 @@ class TestWriteToMarkdownWithEnv(unittest.TestCase):
             "| Total number of items created | 2 |\n\n"
             "| Title | URL | Author |\n"
             "| --- | --- | --- |\n"
-            "| Issue 1 | https://github.com/user/repo/issues/1 | alice |\n"
-            "| Issue 2 | https://github.com/user/repo/issues/2 | bob |\n\n"
+            "| Issue 1 | https://github.com/user/repo/issues/1 | [alice](https://github.com/alice) |\n"
+            "| Issue 2 | https://github.com/user/repo/issues/2 | [bob](https://github.com/bob) |\n\n"
             "_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
             "Search query used to find these items: `repo:user/repo is:issue`\n"
         )