bin/gen_release_notes.py: do not fail on confidential features
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Thu, 8 Dec 2022 19:53:51 +0000 (22:53 +0300)
committerEric Engestrom <eric@engestrom.ch>
Wed, 11 Jan 2023 17:44:20 +0000 (17:44 +0000)
A commit may refer to an issue marked as confidential. That will look
like a 404 page for outside users. One example of such commit is:

    369c12e5be "anv: clear descriptorsets if AllocateDescriptorSets fails"

Let's handle that case.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit 334123a908cfac282297ba5240aecac79e9babd2)

.pick_status.json
bin/gen_release_notes.py

index fd70e9f..27b5acf 100644 (file)
         "description": "bin/gen_release_notes.py: do not fail on confidential features",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index b323fc2..889c0a4 100755 (executable)
@@ -227,7 +227,12 @@ async def get_bug(session: aiohttp.ClientSession, bug_id: str) -> str:
     params = {'iids[]': bug_id}
     async with session.get(url, params=params) as response:
         content = await response.json()
-    return content[0]['title']
+    if not content:
+        # issues marked as "confidential" look like "404" page for
+        # unauthorized users
+        return f'Confidential issue #{bug_id}'
+    else:
+        return content[0]['title']
 
 
 async def get_shortlog(version: str) -> str: