Repository: Qiskit/qiskit-bot

Issue:
Add support for marking PRs as explicitly not needing a changelog entry
For large releases, being able to tag a PR as explicitly _not_ needing a changelog entry would be helpful in order to triage which PRs have and haven't yet had their changelog status reviewed. This could be from a label like 'Changelog: None' which  exclude the labeled PR both from any of the changelog categories and from the `## No changelog entry` list.

Discussion:

Patch:
diff --git a/qiskit_bot/config.py b/qiskit_bot/config.py
index dcf0600..45dbd1e 100644
--- a/qiskit_bot/config.py
+++ b/qiskit_bot/config.py
@@ -28,6 +28,7 @@ default_changelog_categories = {
     'Changelog: API Change': 'Changed',
     'Changelog: Removal': 'Removed',
     'Changelog: Bugfix': 'Fixed',
+    'Changelog: None': None,
 }
 
 
diff --git a/qiskit_bot/release_process.py b/qiskit_bot/release_process.py
index 441bc90..9871343 100644
--- a/qiskit_bot/release_process.py
+++ b/qiskit_bot/release_process.py
@@ -200,6 +200,9 @@ def _generate_changelog(repo, log_string, categories, show_missing=False):
         label_found = False
         for label in labels:
             if label in changelog_dict:
+                if categories[label] is None:
+                    label_found = True
+                    break
                 changelog_dict[label].append(summary)
                 label_found = True
         if not label_found:
@@ -217,7 +220,7 @@ def _generate_changelog(repo, log_string, categories, show_missing=False):
     if show_missing:
         if missing_list:
             changelog += ('\n')
-            changelog += '## No changelog entry\n'
+            changelog += '## Missing changelog entry\n'
             for entry in missing_list:
                 changelog += '-   %s\n' % entry
     return changelog


Test patch:
diff --git a/tests/test_release_process.py b/tests/test_release_process.py
index 0633380..99abeaf 100644
--- a/tests/test_release_process.py
+++ b/tests/test_release_process.py
@@ -922,10 +922,45 @@ qiskit-terra==0.16.0
             config.default_changelog_categories, True)
         expected = """# Changelog
 
-## No changelog entry
+## Missing changelog entry
 -   Tune performance of optimize_1q_decomposition (#5682)
 -   Change collect_1q_runs return for performance (#5685)
 -   Add unroll step to level2 passmanager optimization loop (#5671)
+"""
+        self.assertEqual(res, expected)
+
+    @unittest.mock.patch.object(release_process, 'git')
+    def test_generate_changelog_with_changelog_none(self, git_mock):
+        repo = unittest.mock.MagicMock()
+        repo.name = 'qiskit-terra'
+        repo.gh_repo.get_branches.return_value = []
+        repo.gh_repo = unittest.mock.MagicMock()
+
+        def fake_get_pull(number):
+            result = unittest.mock.MagicMock()
+            if number == 5685:
+                labels_obj = unittest.mock.MagicMock()
+                labels_obj.name = 'Changelog: None'
+                result.labels = [labels_obj]
+            else:
+                result.labels = []
+            return result
+
+        repo.gh_repo.get_pull = fake_get_pull
+        repo.repo_config = {'branch_on_release': True}
+        fake_log = """5a7f41344 Tune performance of optimize_1q_decomposition (#5682)
+6e2542243 Change collect_1q_runs return for performance (#5685)
+25eb58a29 Add unroll step to level2 passmanager optimization loop (#5671)
+"""
+        git_mock.get_git_log.return_value = fake_log.encode('utf8')
+        res = release_process._generate_changelog(
+            repo, '0.17.0...0.16.0',
+            config.default_changelog_categories, True)
+        expected = """# Changelog
+
+## Missing changelog entry
+-   Tune performance of optimize_1q_decomposition (#5682)
+-   Add unroll step to level2 passmanager optimization loop (#5671)
 """
         self.assertEqual(res, expected)