commit:     0c3f492054694f241a3d4a4c99b77151620560d3
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  9 14:18:56 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jun  9 14:21:28 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgdev.git/commit/?id=0c3f4920

bugs: fix summary is too long

When there are a lot of atoms in same bug, the summary gets too long and
server responds with Bad Request. For such long titles, shorten it into
one atom and suffix " and friends" (great text from sam)

Resolves: https://github.com/pkgcore/pkgdev/issues/141
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgdev/scripts/pkgdev_bugs.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/pkgdev/scripts/pkgdev_bugs.py 
b/src/pkgdev/scripts/pkgdev_bugs.py
index 25608d6..daf4828 100644
--- a/src/pkgdev/scripts/pkgdev_bugs.py
+++ b/src/pkgdev/scripts/pkgdev_bugs.py
@@ -214,13 +214,17 @@ class GraphNode:
             keywords = []
         maintainers = tuple(maintainers) or ("[email protected]",)
 
+        summary = f"{', '.join(pkg.versioned_atom.cpvstr for pkg, _ in 
self.pkgs)}: stablereq"
+        if len(summary) > 60:
+            summary = f"{self.pkgs[0][0].versioned_atom.cpvstr} and friends: 
stablereq"
+
         request_data = dict(
             Bugzilla_api_key=api_key,
             product="Gentoo Linux",
             component="Stabilization",
             severity="enhancement",
             version="unspecified",
-            summary=f"{', '.join(pkg.versioned_atom.cpvstr for pkg, _ in 
self.pkgs)}: stablereq",
+            summary=summary,
             description="Please stabilize",
             keywords=keywords,
             cf_stabilisation_atoms="\n".join(self.lines()),

Reply via email to