Skip to content

Add AnalysisPlugin interface and implementation - #7095

Merged
chrisrueger merged 1 commit into
bndtools:masterfrom
laeubi:copilot/fix-b557e6d0-f9ba-4e80-b858-62aea0092bf6
Mar 22, 2026
Merged

chrisrueger merged 1 commit into
bndtools:masterfrom
laeubi:copilot/fix-b557e6d0-f9ba-4e80-b858-62aea0092bf6

Conversation

@chrisrueger

@chrisrueger chrisrueger commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #6772

This pull request introduces a new AnalysisPlugin extension point to the bnd tool, allowing plugins to receive callbacks about analysis decisions—especially the reasoning behind version range choices for package imports. It provides both the interface and documentation for plugin authors, as well as comprehensive tests to ensure correct behavior and ordering.

The most important changes are:

New Plugin Extension Point

  • Added the AnalysisPlugin interface in aQute.bnd.service, enabling plugins to receive notifications about version range decisions and other analysis events during the bundle analysis phase. (biz.aQute.bndlib/src/aQute/bnd/service/AnalysisPlugin.java)

Analyzer Integration

  • Modified the Analyzer to call reportImportVersion() on all registered AnalysisPlugin instances whenever it determines a version range for an import, including a human-readable explanation for the decision. (biz.aQute.bndlib/src/aQute/bnd/osgi/Analyzer.java) [1] [2]

Documentation

  • Added a new documentation page describing the AnalysisPlugin interface, usage examples, and typical use cases for tracking and logging analysis decisions. (docs/_plugins/analysisplugin.md)

Testing

  • Introduced a comprehensive test suite for the AnalysisPlugin extension, verifying that plugins are called, receive correct version decision data, and respect plugin ordering. (biz.aQute.bndlib.tests/test/test/AnalysisPluginTest.java)

@laeubi
laeubi force-pushed the copilot/fix-b557e6d0-f9ba-4e80-b858-62aea0092bf6 branch 2 times, most recently from 493e1d6 to cbdd559 Compare March 22, 2026 11:18
Introduces a new AnalysisPlugin extension point to the bnd tool,
allowing plugins to receive callbacks about analysis
decisions—especially the reasoning behind version range choices for
package imports.

Changes:
- Add AnalysisPlugin interface in aQute.bnd.service, enabling plugins to
  receive notifications about version range decisions and other analysis
events
  during the bundle analysis phase. The interface extends OrderedPlugin
and provides reportImportVersion() and reportAnalysis() callbacks.
- Integrate AnalysisPlugin callbacks into Analyzer: call
reportImportVersion()   on all registered AnalysisPlugin instances
whenever a version range is determined for an import, including a
human-readable explanation for the decision.
- Bump aQute.bnd.service package version from 4.9.0 to 4.10.0 to reflect
the minor (backward-compatible) API addition of the new AnalysisPlugin
interface.
- Add comprehensive test suite (AnalysisPluginTest) verifying that
plugins are called, receive correct version decision data, and respect
plugin ordering.
- Add documentation page describing the AnalysisPlugin interface, usage
  examples, and typical use cases for tracking and logging analysis
decisions.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@laeubi
laeubi force-pushed the copilot/fix-b557e6d0-f9ba-4e80-b858-62aea0092bf6 branch from cbdd559 to 86e80b0 Compare March 22, 2026 11:18
@chrisrueger
chrisrueger marked this pull request as ready for review March 22, 2026 12:16
@chrisrueger
chrisrueger merged commit d5ab56b into bndtools:master Mar 22, 2026
13 checks passed
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.

Add a way for collecting analysis results in the Analyzer

2 participants