Mesa (staging/21.2): bin/gen_release_notes: Don't consider issues for other projects

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 5 16:27:37 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 8e3b3f93a766b51ba8800b4122a1f9451cb3e37c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e3b3f93a766b51ba8800b4122a1f9451cb3e37c

Author: Dylan Baker <dylan.c.baker at intel.com>
Date:   Wed Aug  4 11:32:19 2021 -0700

bin/gen_release_notes: Don't consider issues for other projects

We have enough commits in mesa that have external dependencies that we
need to be sure that a Closes: https://... is actually for mesa and not
for another project.

Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12201>
(cherry picked from commit 30f7b55e475965d31585bbfb0bd03f234cda16b0)

---

 .pick_status.json             |  2 +-
 bin/gen_release_notes.py      |  5 +++--
 bin/gen_release_notes_test.py | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 285463a3638..52cb671722d 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -112,7 +112,7 @@
         "description": "bin/gen_release_notes: Don't consider issues for other projects",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/bin/gen_release_notes.py b/bin/gen_release_notes.py
index 7f62228d59a..bfc65ca92b7 100755
--- a/bin/gen_release_notes.py
+++ b/bin/gen_release_notes.py
@@ -198,10 +198,11 @@ async def parse_issues(commits: str) -> typing.List[str]:
                 break
         else:
             raise Exception('No closes found?')
-        if bug.startswith('h'):
+            
+        if bug.startswith('https://gitlab.freedesktop.org/mesa/mesa'):
             # This means we have a bug in the form "Closes: https://..."
             issues.append(os.path.basename(urllib.parse.urlparse(bug).path))
-        else:
+        elif bug.startswith('#'):
             issues.append(bug.lstrip('#'))
 
     return issues
diff --git a/bin/gen_release_notes_test.py b/bin/gen_release_notes_test.py
index eca0c4b8af4..194fbc745ac 100644
--- a/bin/gen_release_notes_test.py
+++ b/bin/gen_release_notes_test.py
@@ -77,6 +77,8 @@ async def test_gather_commits():
     [
         # It is important to have the title on a new line, as
         # textwrap.dedent wont work otherwise.
+
+        # Test the `Closes: #N` syntax
         (
             '''\
             A commit
@@ -87,6 +89,8 @@ async def test_gather_commits():
             ''',
             ['1'],
         ),
+
+        # Test the Full url
         (
             '''\
             A commit with no body
@@ -95,6 +99,24 @@ async def test_gather_commits():
             ''',
             ['3456'],
         ),
+
+        # Test projects that are not mesa
+        (
+            '''\
+            A commit for libdrm
+
+            Closes: https://gitlab.freedesktop.org/mesa/drm/-/3456
+            ''',
+            [],
+        ),
+        (
+            '''\
+            A commit for for something else completely
+
+            Closes: https://github.com/Organiztion/project/1234
+            ''',
+            [],
+        ),
     ])
 async def test_parse_issues(content: str, bugs: typing.List[str]) -> None:
     mock_com = mock.AsyncMock(return_value=(textwrap.dedent(content).encode(), ''))



More information about the mesa-commit mailing list