6767 package is maintainer-needed, always add CC-ARCHES.
6868 """ ,
6969)
70+ bugs .add_argument (
71+ "--blocks" ,
72+ metavar = "BUG" ,
73+ action = arghparse .CommaSeparatedValuesAppend ,
74+ default = [],
75+ help = "bugs which should be blocked by newly created bugs" ,
76+ docs = """
77+ Collection of bug ids which should be blocked by newly created bugs.
78+ Only bugs created for passed targets would be blockers, excluding other
79+ bugs which were created as dependencies.
80+ """ ,
81+ )
7082
7183bugs .add_argument (
7284 "--cache" ,
@@ -183,7 +195,9 @@ def cleanup_keywords(self, repo):
183195 keywords .clear ()
184196 keywords .add ("*" )
185197
186- def file_bug (self , api_key : str , auto_cc_arches : frozenset [str ], observer = None ) -> int :
198+ def file_bug (
199+ self , api_key : str , auto_cc_arches : frozenset [str ], block_bugs : list [int ], observer = None
200+ ) -> int :
187201 if self .bugno is not None :
188202 return self .bugno
189203 for dep in self .edges :
@@ -211,6 +225,7 @@ def file_bug(self, api_key: str, auto_cc_arches: frozenset[str], observer=None)
211225 assigned_to = maintainers [0 ],
212226 cc = maintainers [1 :],
213227 depends_on = list ({dep .bugno for dep in self .edges }),
228+ blocks = block_bugs ,
214229 )
215230 request = urllib .Request (
216231 url = "https://bugs.gentoo.org/rest/bug" ,
@@ -446,7 +461,7 @@ def scan_existing_bugs(self, api_key: str):
446461 )
447462 break
448463
449- def file_bugs (self , api_key : str , auto_cc_arches : frozenset [str ]):
464+ def file_bugs (self , api_key : str , auto_cc_arches : frozenset [str ], block_bugs : list [ int ] ):
450465 def observe (node : GraphNode ):
451466 self .out .write (
452467 f"https://bugs.gentoo.org/{ node .bugno } " ,
@@ -457,7 +472,7 @@ def observe(node: GraphNode):
457472 self .out .flush ()
458473
459474 for node in self .starting_nodes :
460- node .file_bug (api_key , auto_cc_arches , observe )
475+ node .file_bug (api_key , auto_cc_arches , block_bugs , observe )
461476
462477
463478def _load_from_stdin (out : Formatter , err : Formatter ):
@@ -510,4 +525,5 @@ def main(options, out: Formatter, err: Formatter):
510525 return 1
511526
512527 disabled , enabled = options .auto_cc_arches
513- d .file_bugs (options .api_key , frozenset (enabled ).difference (disabled ))
528+ blocks = list (frozenset (map (int , options .blocks )))
529+ d .file_bugs (options .api_key , frozenset (enabled ).difference (disabled ), blocks )
0 commit comments