rbtools.commands.status_update¶
Implementation of rbt status-update.
Classes
|
Base class for all status update subcommands. |
|
Subcommand for deleting status updates. |
|
Subcommand for displaying information on status updates. |
|
Subcommand for creating or modifying status updates. |
|
Interact with review request status updates on Review Board. |
- class rbtools.commands.status_update.BaseStatusUpdateSubCommand(options: Namespace, config: Dict, *args, **kwargs)[source]¶
Bases:
BaseSubCommand
Base class for all status update subcommands.
This provides utilities for printing information or storing JSON data on status updates.
New in version 3.0.
- class rbtools.commands.status_update.GetStatusUpdateSubCommand(options: Namespace, config: Dict, *args, **kwargs)[source]¶
Bases:
BaseStatusUpdateSubCommand
Subcommand for displaying information on status updates.
New in version 3.0.
- option_list: List[Union[Option, OptionGroup]] = [<rbtools.commands.base.options.OptionGroup object>][source]¶
Command-line options for this command.
- Type:
list
ofOption
orOptionGroup
- class rbtools.commands.status_update.SetStatusUpdateSubCommand(options: Namespace, config: Dict, *args, **kwargs)[source]¶
Bases:
BaseStatusUpdateSubCommand
Subcommand for creating or modifying status updates.
New in version 3.0.
- option_list: List[Union[Option, OptionGroup]] = [<rbtools.commands.base.options.OptionGroup object>][source]¶
Command-line options for this command.
- Type:
list
ofOption
orOptionGroup
- main()[source]¶
Handle setting status update information on Review Board.
- Raises:
rbtools.commands.CommandError – Error with the execution of the command.
rbtools.commands.CommandExit – Stop executing and return an exit status.
- add_review()[source]¶
Handle adding a review to a review request from a json file.
Looks for
reviews
,diff_comments
, andgeneral_comments
keys in the json file contents and populates the review accordingly.To find appropriate inputs for each key:
reviews
:Look at Web API documentation for POST on the Review List resource for available fields.
diff_comments
:Look at Web API documentation for POST on the Review Diff Comment List resource for available fields. All diff comments require
first_line
,filediff_id
,num_lines
, andtext
field to be specified.general_comments
:Look at Web API documentation for POST on the Review General Comment List resource for available fields. All general comments require
text
field to be specified.
Example file contents:
{ "review": { "body_top": "Header comment" }, "diff_comments": [ { "filediff_id": 10, "first_line": 729, "issue_opened": true, "num_lines": 1, "text": "Adding a comment on a diff line", "text_type": "markdown" } ], "general_comments": [ { "text": "Adding a general comment", "text_type": "markdown" } ] }
- Raises:
rbtools.commands.CommandError – Error with the execution of the command.
- class rbtools.commands.status_update.DeleteStatusUpdateSubCommand(options: Namespace, config: Dict, *args, **kwargs)[source]¶
Bases:
BaseStatusUpdateSubCommand
Subcommand for deleting status updates.
New in version 3.0.
- option_list: List[Union[Option, OptionGroup]] = [<rbtools.commands.base.options.OptionGroup object>][source]¶
Command-line options for this command.
- Type:
list
ofOption
orOptionGroup
- class rbtools.commands.status_update.StatusUpdate(transport_cls: Type[Transport] = <class 'rbtools.api.transport.sync.SyncTransport'>, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr: TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin: TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶
Bases:
BaseMultiCommand
Interact with review request status updates on Review Board.
This command allows setting, getting and deleting status updates for review requests.
A status update is a way for a third-party service or extension to mark some kind of status on a review request.
- description: str = 'Interact with review request status updates on Review Board.'[source]¶
A short description of the command, suitable for display in usage text.
- Type:
- subcommands: List[Type[BaseSubCommand]] = [<class 'rbtools.commands.status_update.GetStatusUpdateSubCommand'>, <class 'rbtools.commands.status_update.SetStatusUpdateSubCommand'>, <class 'rbtools.commands.status_update.DeleteStatusUpdateSubCommand'>][source]¶
The available subcommands.
This is a list of BaseSubCommand subclasses.
- Type:
- common_subcommand_option_list: List[Union[Option, OptionGroup]] = [<rbtools.commands.base.options.OptionGroup object>, <rbtools.commands.base.options.OptionGroup object>][source]¶
Options common to all subcommands.
- Type: