Open justinedelson opened 5 years ago
@justinedelson I agree that usability of this tool could benefit from more seamless integration into the build process.
I have considered what you suggest, however, I believe that it may be better to a utility to leverage the comparison in unit or IT tests.
Creating a mechanism similar to the bnd's baselining would be possible, but it would raise the question on how you tell the tool that certain changes are intended and may therefore pass. For baselining this is achieved by raising the export version, which is part of the code-base. For OSGi metadata diffing this would need to be handled differently. I cannot currently imagine a solution to this problem, let alone a simple or intuitive one.
On the other hand, it would be relatively simple to extract all of a bundle's metadata into the test/resources
folder of a project and running an automated test that allows comparing the metadata in the test/resources
with the generated metadata in the bundle. I suspect such a test would need to run during maven's integration-testing
phase. When evolving the bundle, the test would fail if there are changes to the metadata. To resolve the test failure, the metadata in test/resources
would need to be adjusted accordingly (and could be done simply by extracting the bundle's generated metadata and overwriting what's there). An added benefit is that it causes the history of the bundle's metadata to be maintained together with your code-base in an SCM.
All this said, I currently don't have the spare cycles to work on such an enhancement. Should you find the time to work on a PR, then I'll do my best to make time for reviewing it.
As (sort of) discussed in https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1741, it would be beneficial to that project (and I'm sure others) to be able to run osgi-ds-metatype-diff inside a build process (similar to the baseline goal).
This plugin would need to:
Based on the basic IT I created in ACS AEM Commons, I'd suggest that the following types of whitelists be supported:
service.vendor
@jsedding WDYT?