Class BranchBuildStrategy

  • All Implemented Interfaces:
    ExtensionPoint, Describable<BranchBuildStrategy>

    public abstract class BranchBuildStrategy
    extends AbstractDescribableImpl<BranchBuildStrategy>
    implements ExtensionPoint
    An extension point that allows controlling whether a specific SCMHead should be automatically built when discovered.

    Methods marked as SPI: are intended to be implemented by implementers of BranchBuildStrategy. Methods marked as API: are intended to be invoked consumers of BranchBuildStrategy. A consumer invoking a SPI: method may get a UnsupportedOperationException. Methods marked as SPI: are only to be invoked through the API methods in order to allow safe evolution. Changing the API may require updating any SPI implementations that are also API consumers, specifically the Any, All and None implementations in basic-branch-build-strategies

    Since:
    2.0.0
    • Constructor Detail

      • BranchBuildStrategy

        public BranchBuildStrategy()
    • Method Detail

      • isAutomaticBuild

        @Deprecated
        @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
        public boolean isAutomaticBuild​(@NonNull
                                        jenkins.scm.api.SCMSource source,
                                        @NonNull
                                        jenkins.scm.api.SCMHead head)
        SPI: Should the specified SCMHead for the specified SCMSource be built whenever it is detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        Returns:
        true if and only if the SCMHead should be automatically built when detected as created / modified.
      • isAutomaticBuild

        @Deprecated
        @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
        public boolean isAutomaticBuild​(@NonNull
                                        jenkins.scm.api.SCMSource source,
                                        @NonNull
                                        jenkins.scm.api.SCMHead head,
                                        @NonNull
                                        jenkins.scm.api.SCMRevision revision)
        SPI: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        revision - the SCMRevision
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.0.12
      • isAutomaticBuild

        @Deprecated
        @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
        public boolean isAutomaticBuild​(@NonNull
                                        jenkins.scm.api.SCMSource source,
                                        @NonNull
                                        jenkins.scm.api.SCMHead head,
                                        @NonNull
                                        jenkins.scm.api.SCMRevision currRevision,
                                        @CheckForNull
                                        jenkins.scm.api.SCMRevision prevRevision)
        SPI: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        currRevision - the SCMRevision that the head is now at
        prevRevision - the SCMRevision that the head was last seen at or null if this is a newly discovered head. Care should be taken to consider the case of non SCMRevision.isDeterministic() previous revisions as polling for changes will have confirmed that there is a change between this and currRevision even if the two are equal.
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.0.17
      • isAutomaticBuild

        @Deprecated
        @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
        public boolean isAutomaticBuild​(@NonNull
                                        jenkins.scm.api.SCMSource source,
                                        @NonNull
                                        jenkins.scm.api.SCMHead head,
                                        @NonNull
                                        jenkins.scm.api.SCMRevision currRevision,
                                        @CheckForNull
                                        jenkins.scm.api.SCMRevision prevRevision,
                                        @NonNull
                                        TaskListener listener)
        Deprecated.
        SPI: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        currRevision - the SCMRevision that the head is now at
        prevRevision - the SCMRevision that the head was last seen at or null if this is a newly discovered head. Care should be taken to consider the case of non SCMRevision.isDeterministic() previous revisions as polling for changes will have confirmed that there is a change between this and currRevision even if the two are equal.
        listener - the TaskListener that can be used for outputting any rational for the decision
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.1.3
      • isAutomaticBuild

        @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
        public abstract boolean isAutomaticBuild​(@NonNull
                                                 jenkins.scm.api.SCMSource source,
                                                 @NonNull
                                                 jenkins.scm.api.SCMHead head,
                                                 @NonNull
                                                 jenkins.scm.api.SCMRevision currRevision,
                                                 @CheckForNull
                                                 jenkins.scm.api.SCMRevision lastBuiltRevision,
                                                 @CheckForNull
                                                 jenkins.scm.api.SCMRevision lastSeenRevision,
                                                 @NonNull
                                                 TaskListener listener)
        SPI: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        currRevision - the SCMRevision that the build head is now at
        lastBuiltRevision - the SCMRevision that the build head was last seen at or null if this is a newly discovered head. It replaces prevRevision from the previous SPI version. Care should be taken to consider the case of non SCMRevision.isDeterministic() previous revisions as polling for changes will have confirmed that there is a change between this and currRevision even if the two are equal.
        lastSeenRevision - the SCMRevision that the head was last seen
        listener - the TaskListener that can be used for outputting any rational for the decision
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.4.2
      • automaticBuild

        public final boolean automaticBuild​(@NonNull
                                            jenkins.scm.api.SCMSource source,
                                            @NonNull
                                            jenkins.scm.api.SCMHead head,
                                            @NonNull
                                            jenkins.scm.api.SCMRevision currRevision,
                                            @CheckForNull
                                            jenkins.scm.api.SCMRevision prevRevision)
        API: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        currRevision - the SCMRevision that the head is now at
        prevRevision - the SCMRevision that the head was last seen at or null if this is a newly discovered head. Care should be taken to consider the case of non SCMRevision.isDeterministic() previous revisions as polling for changes will have confirmed that there is a change between this and currRevision even if the two are equal.
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.0.17
      • automaticBuild

        public final boolean automaticBuild​(@NonNull
                                            jenkins.scm.api.SCMSource source,
                                            @NonNull
                                            jenkins.scm.api.SCMHead head,
                                            @NonNull
                                            jenkins.scm.api.SCMRevision currRevision,
                                            @CheckForNull
                                            jenkins.scm.api.SCMRevision prevRevision,
                                            @NonNull
                                            TaskListener listener)
        API: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        currRevision - the SCMRevision that the head is now at
        prevRevision - the SCMRevision that the head was last seen at or null if this is a newly discovered head. Care should be taken to consider the case of non SCMRevision.isDeterministic() previous revisions as polling for changes will have confirmed that there is a change between this and currRevision even if the two are equal.
        listener - the TaskListener to be used
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.1.3
      • automaticBuild

        public final boolean automaticBuild​(@NonNull
                                            jenkins.scm.api.SCMSource source,
                                            @NonNull
                                            jenkins.scm.api.SCMHead head,
                                            @NonNull
                                            jenkins.scm.api.SCMRevision currRevision,
                                            @CheckForNull
                                            jenkins.scm.api.SCMRevision lastBuiltRevision,
                                            @CheckForNull
                                            jenkins.scm.api.SCMRevision lastSeenRevision,
                                            @NonNull
                                            TaskListener listener)
        API: Should the specified SCMRevision of the SCMHead for the specified SCMSource be triggered when the SCMHead has been detected as created / modified?
        Parameters:
        source - the SCMSource
        head - the SCMHead
        currRevision - the SCMRevision that the head is now at
        lastBuiltRevision - the SCMRevision that the build head was last seen at or null if this is a newly discovered head. Care should be taken to consider the case of non SCMRevision.isDeterministic() previous revisions as polling for changes will have confirmed that there is a change between this and currRevision even if the two are equal.
        lastSeenRevision - the SCMRevision that the head was last seen
        listener - the TaskListener to be used
        Returns:
        true if and only if the SCMRevision should be automatically built when the SCMHead has been detected as created / modified.
        Since:
        2.4.2