Skip to content

Report all dependency cycles through the edited plug-in - #2406

Merged
vogella merged 1 commit into
eclipse-pde:masterfrom
vogella:dependency-loop-finder-fix
Aug 6, 2026
Merged

Report all dependency cycles through the edited plug-in#2406
vogella merged 1 commit into
eclipse-pde:masterfrom
vogella:dependency-loop-finder-fix

Conversation

@vogella

@vogella vogella commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

DependencyLoopFinder kept a shared list of plug-ins that had been visited without yielding a loop and skipped them on every later path. Whether a plug-in yields a loop depends on the path taken to reach it, so a branch ending in a cycle that does not pass through the root would blacklist the plug-ins it visited, and a cycle reachable only through another dependency of the root was never reported. Which cycles got lost depended on the order of the Require-Bundle entries, which matches the reports of the action missing cycles.

The list is replaced by a prune that does not depend on the path: only plug-ins that are reachable from the root and lead back to it can sit on a cycle through it. That is plain graph reachability, so pruning by it cannot hide a cycle, and it keeps the common case of a plug-in without any cycle cheap, which matters because the search runs on the UI thread. The number of reported loops is capped for the same reason.

The added regression test fails against the current implementation and passes with this change.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

Test Results

  129 files  ±0    129 suites  ±0   40m 4s ⏱️ + 1m 34s
3 530 tests +1  3 476 ✅ +1   54 💤 ±0  0 ❌ ±0 
9 393 runs  +3  9 263 ✅ +3  130 💤 ±0  0 ❌ ±0 

Results for commit 916ecb9. ± Comparison against base commit 90bc30f.

♻️ This comment has been updated with latest results.

@vogella
vogella force-pushed the dependency-loop-finder-fix branch 2 times, most recently from e56238d to 7a87906 Compare August 5, 2026 13:29
DependencyLoopFinder kept a shared list of plug-ins that had been visited
without yielding a loop and skipped them on every later path. Whether a
plug-in yields a loop depends on the path taken to reach it: a branch that
ends in a cycle not passing through the root adds the plug-ins it visited
to that list, so a cycle reachable only through another dependency of the
root is never reported. Which cycles get lost depends on the order of the
Require-Bundle entries.

Replace the list with a prune that does not depend on the path: only
plug-ins that are reachable from the root and lead back to it can sit on a
cycle through the root, and that property is a plain graph reachability
question. Plug-ins outside that set are skipped, which also keeps the
common case of a plug-in without any cycle cheap, and the remaining search
enumerates the cycles without dropping any. The number of reported loops
is capped, as the search runs on the UI thread.

Resolved dependencies are cached for the duration of one search, since the
search visits a plug-in once per path leading to it.
@vogella
vogella force-pushed the dependency-loop-finder-fix branch from 7a87906 to 916ecb9 Compare August 6, 2026 04:40
@vogella
vogella merged commit d37978b into eclipse-pde:master Aug 6, 2026
19 checks passed
@vogella
vogella deleted the dependency-loop-finder-fix branch August 6, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant