Package jenkins.scm

Interface RunWithSCM<JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT> & RunWithSCM<JobT,RunT>>

All Known Implementing Classes:
AbstractBuild, Build, FreeStyleBuild

public interface RunWithSCM<JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT> & RunWithSCM<JobT,RunT>>
Allows a Run to provide SCM-related methods, such as providing changesets and culprits.
Since:
2.60
  • Method Details

    • getChangeSets

      @NonNull List<ChangeLogSet<? extends ChangeLogSet.Entry>> getChangeSets()
      Gets all ChangeLogSets currently associated with this item.
      Returns:
      A possibly empty list of ChangeLogSets.
    • getCulpritIds

      @CheckForNull Set<String> getCulpritIds()
      Gets the ids for all Users included in getChangeSets() for this item.
      Returns:
      A set of user IDs, or null if this was the first time the method was called or the build is still running for a RunWithSCM instance with no culprits.
    • shouldCalculateCulprits

      boolean shouldCalculateCulprits()
      Determines whether culprits should be recalcuated or the existing getCulpritIds() should be used instead.
      Returns:
      True if culprits should be recalcuated, false otherwise.
    • getCulprits

      @Exported @NonNull default Set<User> getCulprits()
      List of users who committed a change since the last non-broken build till now.

      This list at least always include people who made changes in this build, but if the previous build was a failure it also includes the culprit list from there.

      Missing Users will be created on-demand.

      Returns:
      can be empty but never null.
    • calculateCulprits

      @NonNull default Set<User> calculateCulprits()
      Method used for actually calculating the culprits from scratch. Called by getCulprits() and overrides of getCulprits(). Does not persist culprits information.
      Returns:
      a non-null Set of Users associated with this item.
    • hasParticipant

      default boolean hasParticipant(User user)
      Returns true if this user has made a commit to this build.