Skip to content

Add support for testing extensions#1667

Merged
nscuro merged 1 commit intomainfrom
extension-test
Jan 20, 2026
Merged

Add support for testing extensions#1667
nscuro merged 1 commit intomainfrom
extension-test

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Jan 19, 2026

Description

Allows extensions to provide functionality that lets administrators verify whether a given configuration is likely to work.

The primary use case here being a "test" button in the UI.

Having an easy way to test configuration provides much better UX, as the lack of feedback without it can cause a lot of frustration. Especially when the to-be-configured functionality only runs on schedule and can't be triggered manually at all.

Addressed Issue

N/A

Additional Details

N/A

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro added this to the 5.7.0 milestone Jan 19, 2026
@nscuro nscuro added the enhancement New feature or request label Jan 19, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jan 19, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 6e5a07a1 86.89% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6e5a07a) Report Missing Report Missing Report Missing
Head commit (049a411) 36525 30629 83.86%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1667) 122 106 86.89%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@nscuro nscuro force-pushed the extension-test branch 8 times, most recently from 01655d8 to 0ac51f7 Compare January 20, 2026 15:02
@nscuro nscuro marked this pull request as ready for review January 20, 2026 15:22
Copilot AI review requested due to automatic review settings January 20, 2026 15:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for testing extensions, allowing administrators to verify extension configurations before deployment. The primary use case is providing a "test" button in the UI for immediate feedback on whether a configuration is likely to work.

Changes:

  • Introduces new plugin API components (ExtensionTestResult, ExtensionTestCheck) for representing test results
  • Adds a new REST API endpoint for testing extensions with runtime configuration
  • Implements test functionality in the NVD vulnerability data source as a reference implementation

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
plugin/api/src/main/java/org/dependencytrack/plugin/api/ExtensionTestResult.java New class representing test results with multiple checks
plugin/api/src/main/java/org/dependencytrack/plugin/api/ExtensionTestCheck.java New record for individual test checks with status and optional message
plugin/api/src/main/java/org/dependencytrack/plugin/api/ExtensionFactory.java Adds default test() method to extension factory interface
plugin/api/src/main/java/org/dependencytrack/plugin/api/ExtensionContext.java Minor refactoring with null annotations and imports
apiserver/src/main/java/org/dependencytrack/resources/v2/ExtensionsResource.java Implements testExtension endpoint with validation and conversion logic
apiserver/src/test/java/org/dependencytrack/resources/v2/ExtensionsResourceTest.java Comprehensive integration tests for extension testing functionality
vuln-data-source/nvd/src/main/java/org/dependencytrack/vulndatasource/nvd/NvdVulnDataSourceFactory.java Reference implementation testing NVD feed connectivity and format
vuln-data-source/nvd/src/test/java/org/dependencytrack/vulndatasource/nvd/NvdVulnDataSourceFactoryTest.java Tests for NVD extension testing functionality
api/src/main/openapi/* OpenAPI specification for new test endpoint and schema definitions
vuln-data-source/nvd/pom.xml Adds WireMock dependency for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/src/main/openapi/components/schemas/extensions/extension-test-check.yaml Outdated
Comment thread api/src/main/openapi/paths/extension-points__name__extensions__name__config.yaml Outdated
Allows extensions to provide functionality that lets administrators verify whether a given configuration is likely to work.

The primary use case here being a "test" button in the UI.

Having an easy way to test configuration provides much better UX, as the lack of feedback without it can cause a lot of frustration. Especially when the to-be-configured functionality only runs on schedule and can't be triggered manually at all.

Signed-off-by: nscuro <nscuro@protonmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nscuro nscuro merged commit a0aca38 into main Jan 20, 2026
17 checks passed
@nscuro nscuro deleted the extension-test branch January 20, 2026 20:56
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants