
use WebService::ReviewBoard;
my $rb = WebService::ReviewBoard->new( 'http://demo.review-board.org' );
$rb->login( 'username', 'password' );
# there are two ways to create an object, create or fetch
# both these take a list of arguments, which must include
# a WebService::ReviewBoard object so it knows how to
# talk to review board.
# the second arg is sent directly to the review board web services API
my $review = WebService::ReviewBoard::Review->create( { review_board => $rb }, [ repository_id => 1 ] );
$review->set_bugs( 1728212, 1723823 );
$review->set_reviewers( qw( jdagnall gno ) );
$review->set_summary( "this is the summary" );
$review->set_description( "this is the description" );
$review->set_groups('reviewboard');
$review->add_diff( '/tmp/patch' );
$review->publish();
# alternatively, you can get existing reviews
foreach my $review ( WebService::ReviewBoard::Review->fetch( { review_board => $rb, from_user => 'jaybuff' } ) ) {
print "[REVIEW " . $review->get_id() . "] " . $review->get_summary() . "\n";
}
# fetch uses the perl function wantarray so you can just get one review if you want:
my $review = WebService::ReviewBoard::Review->fetch( { review_board => $rb, id => 123 } );
# set status as submit
$review->submit_review_request;
# discard review request
$review->discard_review_request;


new()Do not use this constructor. To construct a WebService::ReviewBoard::Review object use the create_review method in the WebService::ReviewBoard class.
create( { review_board => $rb }, $args )<review_board> must be a <WebService::ReviewBoard> object. <$args> is passed directly to the HTTP UserAgent when it does the request.
<$args> must contain which repository to use. Using one of these (from the ReviewBoard API documentation):
* repository_path: The repository to create the review request against. If not specified, the DEFAULT_REPOSITORY_PATH setting will be used. If both this and repository_id are set, repository_path's value takes precedence.
* repository_id: The ID of the repository to create the review request against.
Example:
my $rb = WebService::ReviewBoard->new( 'http://demo.review-board.org' ); $rb->login( 'username', 'password' ); my $review = WebService::ReviewBoard::Request->create( { review_board => $rb }, [ repository_id => 1 ] );
fetch( $args_hash_ref )Fetch one or more review objects from the reviewboard server. It uses wantarray(), so you can fetch one or many.
Valid values in <$args_hash_ref>:
* review_board - (required) must be a WebService::ReviewBoard object.
* from_user - the review board username of a person that submitted reviews
* id - the id of a review request
<fetch> is a constructor.
get_id()Returns the id of this review request
get_bugs()Returns an array.
get_reviewers()Returns an array.
get_summary()
get_description()
get_groups()
set_groups()
set_bugs( @bug_ids )
set_reviewers( @review_board_users )
set_summary( $summary )
set_description( $description )
add_diff( $diff_file )$diff_file should be a file that contains the diff that you want to be reviewed.
publish( )Mark the review request as ready to be reviewed. This will send out notification emails if review board is configured to do that.
discard_review_request() Mark the review request as discarded. This will delete review request from review board.
submit_review_request() Mark the review request as submitted.
as_string()returns a string that is a representation of the review request
get_ua()returns an LWP::UserAgent that will be used to do requests. You can overload this method to use custom user agents.
review_api_post()makes POST call to reviewboard and performs required action.


WebService::ReviewBoard::Review requires no configuration files or environment variables.

WebService::ReviewBoard

None reported.

No bugs have been reported.
Please report any bugs or feature requests to bug-webservice-reviewboard@rt.cpan.org, or through the web interface at http://rt.cpan.org.

Jay Buffington <jaybuffington@gmail.com>

Copyright (c) 2008, Jay Buffington <jaybuffington@gmail.com>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.