Skip to content

Comments

Add Bundle Graph visualization view to bndtools Eclipse plugin#7106

Open
Copilot wants to merge 17 commits intomasterfrom
copilot/add-bundle-graph-visualization
Open

Add Bundle Graph visualization view to bndtools Eclipse plugin#7106
Copilot wants to merge 17 commits intomasterfrom
copilot/add-bundle-graph-visualization

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

Adds a new Bundle Graph Eclipse ViewPart that renders a Mermaid dependency graph of OSGi bundles in a bndtools workspace, with an interactive dual-list selection UI and multiple universe loading strategies.

Model layer (bndtools.views.bundlegraph.model)

  • BundleNode(bsn, version, projectName) — canonical identity on bsn+version only (projectName is display metadata; equals/hashCode deliberately exclude it so repo-loaded and project-loaded nodes of the same bundle match)
  • BundleEdge(from, to, boolean optional) — edge with optionality flag; optional=true iff all Import-Package entries that create that edge carry resolution:=optional
  • BundleGraphModel interface: nodes(), edges(), dependenciesOf(), dependantsOf(), origin()
  • SimpleBundleGraphModel — in-memory implementation; 2-arg constructors delegate to 3-arg (nodes, edges, origin) for backward compat
  • GraphClosures — BFS transitive closure for dependency/dependant expansion

Dependency calculator (ManifestDependencyCalculator)

Reads Import-Package / Export-Package from JAR manifests via aQute.bnd.osgi.Jar.getManifest() + aQute.bnd.osgi.Domain:

  • Builds Map<BundleNode, File>Set<BundleEdge> with per-edge optionality tracking
  • Always computes all edges (including optional ones); filtering is deferred to render time

Universe providers

Provider Input Origin label
ProjectUniverseProvider List<IProject> Projects: p1, p2
BndrunUniverseProvider .bndrun IFile Bndrun: file.bndrun
RepositoryUniverseProvider List<RepositoryPlugin> Repositories: r1, r2

"Add from Repositories" is additive — merges into the existing universe without replacing it.

Renderer (MermaidRenderer)

graph LR
  classDef primary fill:#dae8fc,stroke:#1a6496,stroke-width:2px
  classDef secondary fill:#f5f5f5,stroke:#888888,stroke-width:1px,stroke-dasharray:4 4
  bundleA["my.bundle 1.0"]:::primary
  bundleB["dep.bundle 2.0"]:::secondary
  bundleB --> bundleA          %% mandatory edge
  bundleB -.-> bundleA         %% optional edge

EdgeFilter enum (ALL / ONLY_MANDATORY / ONLY_OPTIONAL) filters edges at render time; when a non-ALL filter is active, nodes with no visible edges are hidden, and secondary↔secondary edges not touching any primary node are suppressed.

View (BundleGraphView)

  • SashForm vertical split: selection panel (top, collapsible via toolbar toggle) + browser (bottom)
  • Left list: "Available bundles" with text filter; Remove button + Delete key removes selected nodes from universe
  • Right list: "Selected input bundles"; double-click removes; Ctrl/Cmd+C copies BSNs to clipboard
  • Center buttons: Add / Remove / Add deps / Add dependants
  • Options row: expansion mode combo, edge filter combo, auto-render checkbox
  • Zoom toolbar: / + buttons + percentage combo; browser wraps Mermaid SVG in a scrollable transform: scale() container
  • Copy Mermaid to clipboard toolbar action
  • Refresh Universe re-invokes the stored Supplier<BundleGraphModel> and retains still-valid selected nodes
  • allowMultiple="true" in plugin.xml so multiple graph sessions can be open simultaneously; each invocation gets a unique secondary ID
  • Bundled mermaid.min.js v11.12.3 (MIT) loaded via FileLocator — no CDN required; falls back to CDN with a warning if the bundle entry is missing

Drag and drop

Both "Available bundles" and "Selected input bundles" lists accept drops from:

  • .bndrun files → extracts -runbundles, resolves JAR, computes edges
  • IProject resources → ProjectUniverseProvider
  • RepositoryBundle / RepositoryBundleVersion / RepositoryPlugin from the bndtools Repositories view → resolves latest version, downloads JAR, computes edges

Plugin contributions (plugin.xml)

  • View: bndtools.views.BundleGraphView, category bndtools
  • Command bndtools.commands.showBundleGraph + handler ShowBundleGraphHandler
  • Context menus on .bndrun files and IProject resources

Tests

  • GraphClosuresTest — BFS closure correctness including cross-provider BundleNode identity
  • MermaidRendererTest — all edge filter modes, primary/secondary styling, optional edge rendering, node hiding
  • ManifestDependencyCalculatorTest — edge derivation from manifests, optionality tracking

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • bndtools.jfrog.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xms1024m -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)
  • scans-in.gradle.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xms1024m -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add Bundle Graph visualization feature to bndtools Add Bundle Graph view for visualizing OSGi bundle dependencies in bndtools Feb 20, 2026
Copilot AI requested a review from chrisrueger February 20, 2026 09:02
Copilot AI changed the title Add Bundle Graph view for visualizing OSGi bundle dependencies in bndtools Bundle Graph: compute dependency edges from JAR manifest Import/Export-Package headers Feb 20, 2026
Copilot AI changed the title Bundle Graph: compute dependency edges from JAR manifest Import/Export-Package headers Add Bundle Graph view for visualizing OSGi bundle dependencies in bndtools Feb 21, 2026
Copilot AI changed the title Add Bundle Graph view for visualizing OSGi bundle dependencies in bndtools Add Bundle Graph visualization for OSGi bundle dependencies in bndtools Feb 21, 2026
Copilot AI changed the title Add Bundle Graph visualization for OSGi bundle dependencies in bndtools bndtools Bundle Graph view: new feature Feb 21, 2026
Copilot AI changed the title bndtools Bundle Graph view: new feature bndtools: Add Bundle Graph view for visualizing OSGi bundle dependencies Feb 22, 2026
@chrisrueger chrisrueger force-pushed the copilot/add-bundle-graph-visualization branch from b140277 to 2564eec Compare February 22, 2026 20:00
Copilot AI changed the title bndtools: Add Bundle Graph view for visualizing OSGi bundle dependencies bndtools: Add Bundle Graph view for OSGi bundle dependency visualization Feb 22, 2026
Add manifest-based dependency calculation to Bundle Graph view
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Co-Authored-By: chrisrueger <188422+chrisrueger@users.noreply.github.com>
@chrisrueger chrisrueger force-pushed the copilot/add-bundle-graph-visualization branch from 6c2f2e6 to 99e27e2 Compare February 22, 2026 20:49
@chrisrueger chrisrueger marked this pull request as ready for review February 22, 2026 20:49
Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
@chrisrueger
Copy link
Contributor

chrisrueger commented Feb 23, 2026

@kriegfrj thanks for the suggestion. Bundle edges which came to existence solely on resolution:optional Imports are now connected with a dotted line , meaning "optional dependency".

image

If there is at least one non-optional import, then it is considered mandatory.

Now there is a dropdown where you can choose between 3 options:

image

…node

Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
Copilot AI changed the title Bundle Graph: EdgeFilter combo, optional edge styling, and disconnected-node hiding Add Bundle Graph visualization to bndtools (Eclipse view for OSGi bundle dependencies) Feb 23, 2026
Copilot AI and others added 2 commits February 23, 2026 18:40
…phModel

Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
Copilot AI changed the title Add Bundle Graph visualization to bndtools (Eclipse view for OSGi bundle dependencies) Add Bundle Graph visualization view to bndtools Eclipse plugin Feb 23, 2026
Expose and display origin sources for bundle graphs and update UI labels. Added a sources() API to BundleGraphModel and extended SimpleBundleGraphModel to store a List<String> of sources with updated constructors. Project/Repository/Bndrun universe providers now pass source names to the model. BundleGraphView now shows origin + shortened sources in the label (with a tooltip for full text), updates the part name, and includes a helper to shorten long source strings. Also initialize the view selection with all model nodes, and rename the view title in plugin.xml from "Bundle Graph" to "Graph".

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
… lists

Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
…es are shared

Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
Copilot AI changed the title Add Bundle Graph visualization view to bndtools Eclipse plugin Add Bundle Graph visualization to bndtools Eclipse plugin Feb 23, 2026
Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
Copilot AI changed the title Add Bundle Graph visualization to bndtools Eclipse plugin Add Bundle Graph view to bndtools: visualize workspace/repository bundle dependencies Feb 23, 2026
Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
Copilot AI changed the title Add Bundle Graph view to bndtools: visualize workspace/repository bundle dependencies Add Bundle Graph visualization view to bndtools Eclipse plugin Feb 23, 2026
…bundles list

Co-authored-by: chrisrueger <188422+chrisrueger@users.noreply.github.com>
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.

3 participants