Skip to content

Commit 319e413

Browse files
joecool1029arthurzam
authored andcommitted
bugs: fix open bug search with deps
- move scan_existing_bugs before merges so nodes are still per-pkg - skip merging nodes whose bugno was set by scan Resolves: #222 Signed-off-by: Joe Kappus <joe@wt.gd> Closes: #223 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 424cbef commit 319e413

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/pkgdev/scripts/pkgdev_bugs.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ def merge_new_keywords_children(self):
656656
for node, origs in reverse_edges.items():
657657
if len(origs) != 1:
658658
continue
659+
if node.bugno is not None:
660+
continue
659661
existing_keywords = frozenset().union(
660662
*(
661663
pkgver.keywords
@@ -666,6 +668,8 @@ def merge_new_keywords_children(self):
666668
if existing_keywords & frozenset().union(*(pkg[1] for pkg in node.pkgs)):
667669
continue # not fully new keywords
668670
orig = next(iter(origs))
671+
if orig.bugno is not None:
672+
continue
669673
self.out.write(f"Merging {node} into {orig}")
670674
self.merge_nodes((orig, node))
671675
found_someone = True
@@ -675,7 +679,9 @@ def merge_stabilization_groups(self):
675679
for group, pkgs in self.options.repo.stabilization_groups.items():
676680
restrict = packages.OrRestriction(*pkgs)
677681
mergable = tuple(
678-
node for node in self.nodes if any(restrict.match(pkg) for pkg, _ in node.pkgs)
682+
node
683+
for node in self.nodes
684+
if node.bugno is None and any(restrict.match(pkg) for pkg, _ in node.pkgs)
679685
)
680686
if mergable:
681687
self.out.write(f"Merging @{group} group nodes: {mergable}")
@@ -759,9 +765,6 @@ def main(options, out: Formatter, err: Formatter):
759765
options.targets = list(_load_from_stdin(out))
760766
d.load_targets(options.targets)
761767
d.build_full_graph()
762-
d.merge_stabilization_groups()
763-
d.merge_cycles()
764-
d.merge_new_keywords_children()
765768

766769
if not d.nodes:
767770
out.write(out.fg("red"), "Nothing to do, exiting", out.reset)
@@ -770,6 +773,10 @@ def main(options, out: Formatter, err: Formatter):
770773
if userquery("Check for open bugs matching current graph?", out, err, default_answer=False):
771774
d.scan_existing_bugs(options.api_key)
772775

776+
d.merge_stabilization_groups()
777+
d.merge_cycles()
778+
d.merge_new_keywords_children()
779+
773780
if options.edit_graph:
774781
toml = d.output_graph_toml()
775782

0 commit comments

Comments
 (0)