hudson.plugins.reviewboard
Class ReviewboardPublisher

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.tasks.Notifier
              extended by hudson.plugins.reviewboard.ReviewboardPublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep

public class ReviewboardPublisher
extends hudson.tasks.Notifier

Creates a Publisher that will notify inspect the build for change sets, and if included, notifies a Reviewboard (http://www.reviewboard.org) installation to either creates a new review request or update an existing review request. Currently, this plugin only supports Perforce changelists. TODO: Add better/more error handling and logging What this DOESN'T do: 1) Your dishes, dirty laundry or homework

Version:
1.0
Author:
Ryan Shelley

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.tasks.Publisher
hudson.tasks.Publisher.DescriptorExtensionListImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
ReviewboardPublisher(String keyRegEx, Integer daysBeforeStaleReview, String defaultReviewGroups, String defaultReviewers, boolean authorAsReviewer, boolean publishReviews, boolean skipUnflaggedChanges, boolean forceUpdateOverride, boolean failBuildOnReviewboardError)
          Builds the Publisher with current build configuration options.
 
Method Summary
 boolean getAuthorAsReviewer()
           
 Integer getDaysBeforeStaleReview()
           
 String getDefaultReviewers()
           
 String getDefaultReviewGroups()
           
 ReviewboardDescriptorImpl getDescriptor()
           
 boolean getFailBuildOnReviewboardError()
           
 boolean getForceUpdateOverride()
           
 String getKeyRegEx()
           
 boolean getPublishReviews()
           
 hudson.tasks.BuildStepMonitor getRequiredMonitorService()
           
 Set<String> getReviewboardGroups()
           
 Set<String> getReviewboardUsers()
           
 boolean getSkipUnflaggedChanges()
           
 boolean perform(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Executes after the build is complete to send changelist changes to Reviewboard.
 boolean processChangeset(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener)
           
 
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRun, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, prebuild
 

Constructor Detail

ReviewboardPublisher

@DataBoundConstructor
public ReviewboardPublisher(String keyRegEx,
                                                 Integer daysBeforeStaleReview,
                                                 String defaultReviewGroups,
                                                 String defaultReviewers,
                                                 boolean authorAsReviewer,
                                                 boolean publishReviews,
                                                 boolean skipUnflaggedChanges,
                                                 boolean forceUpdateOverride,
                                                 boolean failBuildOnReviewboardError)
Builds the Publisher with current build configuration options.

Parameters:
keyRegEx - Regular expression to match against changelist description looking to extract an external ID (such as a JIRA ID)
Method Detail

getKeyRegEx

public String getKeyRegEx()

getDaysBeforeStaleReview

public Integer getDaysBeforeStaleReview()

getDefaultReviewGroups

public String getDefaultReviewGroups()

getDefaultReviewers

public String getDefaultReviewers()

getAuthorAsReviewer

public boolean getAuthorAsReviewer()

getPublishReviews

public boolean getPublishReviews()

getForceUpdateOverride

public boolean getForceUpdateOverride()

getSkipUnflaggedChanges

public boolean getSkipUnflaggedChanges()

getReviewboardUsers

public Set<String> getReviewboardUsers()

getReviewboardGroups

public Set<String> getReviewboardGroups()

getFailBuildOnReviewboardError

public boolean getFailBuildOnReviewboardError()

getDescriptor

public ReviewboardDescriptorImpl getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.tasks.Publisher>
Overrides:
getDescriptor in class hudson.tasks.Notifier

getRequiredMonitorService

public hudson.tasks.BuildStepMonitor getRequiredMonitorService()

perform

public boolean perform(hudson.model.AbstractBuild build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
Executes after the build is complete to send changelist changes to Reviewboard.

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Parameters:
build - Recently executed build
launcher - Launcher used to execute command shell processes (like post-review.exe)
listener - Listener to notify build process of events
Returns:
true if successful (or action skipped by override flag), or false if failed

processChangeset

public boolean processChangeset(hudson.model.AbstractBuild build,
                                hudson.Launcher launcher,
                                hudson.model.BuildListener listener)


Copyright © 2004-2012 Hudson. All Rights Reserved.