Package org.revapi

Class PipelineConfiguration


  • public final class PipelineConfiguration
    extends Object
    This class represents the configuration of the Revapi analysis pipeline. This is different from the configuration of the individual extensions (which are part of the pipeline) as it provides the configuration of the pipeline itself. Namely, this class defines all the possible extensions that can be used during the analysis as well as the configuration of the "shape" of the pipeline - as of now only the transformation blocks can be defined.

    The analysis can be influenced by defining "transformation blocks". By default, each DifferenceTransform can transform a difference into another one. Each such newly created difference is then again examined by all difference transforms to see if it is also can be transformed again. This is sometimes not what the user intends with the configuration, because it might be useful to "group" certain transformations into "blocks" that happen "atomically" without the constituent transforms in the block influencing each others results.

    E.g., consider the following scenario:

    There is a "reclassify" transform that is configured to "tune down" severity of certain differences. At the same time, there is another transformation, say a "policy transformation" that considers any potentially breaking change as breaking - the goal of the policy is to have a "clean" set of changes without any potentially breaking change in the release.

    Without a transformation block, these two transformations cannot coexist together without causing an "infinite loop" (Revapi will interrupt the difference transformations after a certain number attempts).

    In the outlined scenario, the intention of the user is to have the "reclassify" transform make some differences admissible for the release and the "policy" transform to make all other differences breaking. The problem with this is that, as described above, Revapi cannot guess this intention and just blindly applies all transforms on each and every difference found. This makes it impossible for the "policy" transform to "not see" the admissible differences that the "reclassify" transform tunes down.

    Enter transformation blocks. Transformation blocks enable certain transformations to be applied in the defined order while considering the result of such series of transformations as potential input for other transformations outside of the block. This enables the user to say "first reclassify then apply policy", resulting her original intention being clear to Revapi.

    As explained in the AnalysisContext, each transformation extension can be configured multiple times using different IDs. An ID is optional if there is only a single configuration of a single type of transformation. When trying to group the transformations into blocks, Revapi first tries to find a transformation with given ID and if it finds none, it tries to match the provided string with the name of the extension (internally called the extension ID).

    • Method Detail

      • parse

        @Deprecated
        public static PipelineConfiguration.Builder parse​(org.jboss.dmr.ModelNode json)
        Deprecated.
        use the Jackson-based variant
        Parses the configuration node and provides a pipeline configuration without any extensions marked for loading. The configuration node is supposed to conform to the pipeline configuration JSON schema.

        The caller is supposed to use the methods from the builder to add/find extension classes that will be used in the analysis.

        Note that the returned pipeline configuration might not contain all the extensions available in the classloader depending on the include/exclude filters in the configuration.

        Parameters:
        json - the configuration node
        Returns:
        a pipeline configuration parsed from the configuration
        See Also:
        PipelineConfiguration.Builder.build()
      • parse

        public static PipelineConfiguration.Builder parse​(com.fasterxml.jackson.databind.JsonNode json)
        Parses the configuration node and provides a pipeline configuration without any extensions marked for loading. The configuration node is supposed to conform to the pipeline configuration JSON schema.

        The caller is supposed to use the methods from the builder to add/find extension classes that will be used in the analysis.

        Note that the returned pipeline configuration might not contain all the extensions available in the classloader depending on the include/exclude filters in the configuration.

        Parameters:
        json - the configuration node
        Returns:
        a pipeline configuration parsed from the configuration
        See Also:
        PipelineConfiguration.Builder.build()
      • getTransformationBlocks

        public Set<List<String>> getTransformationBlocks()
      • getIncludedAnalyzerExtensionIds

        public List<String> getIncludedAnalyzerExtensionIds()
      • getExcludedAnalyzerExtensionIds

        public List<String> getExcludedAnalyzerExtensionIds()
      • getIncludedReporterExtensionIds

        public List<String> getIncludedReporterExtensionIds()
      • getExcludedReporterExtensionIds

        public List<String> getExcludedReporterExtensionIds()
      • getIncludedTransformExtensionIds

        public List<String> getIncludedTransformExtensionIds()
      • getExcludedTransformExtensionIds

        public List<String> getExcludedTransformExtensionIds()
      • getIncludedFilterExtensionIds

        public List<String> getIncludedFilterExtensionIds()
      • getExcludedFilterExtensionIds

        public List<String> getExcludedFilterExtensionIds()
      • getIncludedMatcherExtensionIds

        public List<String> getIncludedMatcherExtensionIds()
      • getExcludedMatcherExtensionIds

        public List<String> getExcludedMatcherExtensionIds()