### Switch to root user Source: https://www.reviewboard.org/docs/manual/latest/admin/installation/linux Run this command to become the superuser (root) before starting the installation steps. This is typically required for installing system packages and creating system directories. ```bash $ sudo -s ``` -------------------------------- ### Docker run command with example values Source: https://www.reviewboard.org/docs/manual/latest/admin/installation/docker Example of the docker run command using specific values for a production setup. Uses the beanbag/reviewboard:4.0.4 image and sets the domain, company, memcached server, and database credentials. The site directory is mounted at /var/www/reviewboard. ```bash $ docker pull beanbag/reviewboard:4.0.4 $ docker run -P \ --name \ -v /var/www/reviewboard:/site \ -e DOMAIN=reviews.corp.example.com \ -e COMPANY="My Company" \ -e MEMCACHED_SERVER=db.corp.example.com:11211 \ -e DATABASE_TYPE=postgresql \ -e DATABASE_SERVER=db.corp.example.com \ -e DATABASE_USERNAME=reviewboard \ -e DATABASE_PASSWORD=reviewboard12345 \ -e DATABASE_NAME=reviewboard \ beanbag/reviewboard:4.0.4 ``` -------------------------------- ### Run the Review Board devserver Source: https://www.reviewboard.org/docs/manual/latest/extending/extensions/making-an-extension Starts the Django development server for Review Board. Requires a Review Board development environment set up per the getting started guide. The server runs locally at http://localhost:8080/. ```bash $ ./contrib/internal/devserver.py ``` -------------------------------- ### setup() Source: https://www.reviewboard.org/docs/manual/latest/extending/coderef/python/reviewboard.extensions.packaging Build an extension package. Deprecated since version 8.0, moved to reviewboard.extensions.packaging.setuptools_backend.setup. ```APIDOC ## setup() ### Description Build an extension package. ### Method `setup(**setup_kwargs)` ### Parameters - **setup_kwargs** (dict) - Keyword arguments to pass to the main setup method. ### Deprecation Deprecated since version 8.0. Moved to `reviewboard.extensions.packaging.setuptools_backend.setup`. Legacy import will be removed in Review Board 10. ``` -------------------------------- ### setUp() -> None Source: https://www.reviewboard.org/docs/rbtools/latest/api/coderef/python/rbtools.testing.testcase Sets up a single test by storing initial state and optionally creating a new current HOME directory. ```APIDOC ## setUp() -> None ### Description Sets up a single test by storing initial state and optionally creating a new current HOME directory. ### Method Method ### Signature `setUp() -> None` ### Parameters None ### Returns None ``` -------------------------------- ### git (property) Source: https://www.reviewboard.org/docs/rbtools/latest/api/coderef/python/rbtools.clients.git The name of the command line tool for Git. Callers must call setup() or has_dependencies() before accessing this. This will be required starting in RBTools 5.0. This will fall back to 'bzr' if neither Bazaar nor Breezy is installed. ```APIDOC ## git (property) ### Description The name of the command line tool for Git. Callers must call `setup()` or `has_dependencies()` before accessing this. This will be required starting in RBTools 5.0. This will fall back to "bzr" if neither Bazaar nor Breezy is installed. ### Type `str` ``` -------------------------------- ### _ExtensionTestCaseMixin.setUp() Source: https://www.reviewboard.org/docs/djblets/latest/coderef/python/djblets.extensions.testing.testcases Sets up the test case by initializing the extension manager and extension instance. ```APIDOC ## _ExtensionTestCaseMixin.setUp() ### Description Sets up the test case. This method is called before each test method to prepare the extension manager and extension instance. ### Method setUp ### Signature `setUp() -> None` ### Parameters None ### Returns None ### Example ```python # Typically called automatically by the test framework self.setUp() ``` ``` -------------------------------- ### startswith filter example Source: https://www.reviewboard.org/docs/djblets/latest/coderef/python/djblets.util.templatetags.djblets_utils Returns whether a value starts with another value. The example checks if a key starts with "__". ```django {% if key|startswith:"__" %} .. {% endif %} ``` -------------------------------- ### Example crontab registration for apache2 Source: https://www.reviewboard.org/docs/manual/latest/admin/installation/creating-sites Example of registering the cron.conf file for the apache2 user on a typical Review Board installation. ```bash $ sudo -u apache2 crontab /var/www/reviews.example.com/conf/cron.conf ``` -------------------------------- ### Create MySQL database and user (example) Source: https://www.reviewboard.org/docs/manual/latest/admin/installation/creating-sites Example commands for creating the Review Board database and user with specific values. ```sql $ mysql -u root -p -h db.example.com mysql> CREATE DATABASE reviewboard; mysql> CREATE USER 'rbuser'@'%' IDENTIFIED BY 's3cr3t'; mysql> GRANT ALL PRIVILEGES ON reviewboard.* to 'rbuser'@'%'; ``` -------------------------------- ### GET validation resource with curl Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/validation Retrieves links to all validation resources using the HTTP GET method. The example uses the application/vnd.reviewboard.org.validation+json media type. ```bash $ curl https://api.reviewboard.org/api/validation/ ``` -------------------------------- ### Override setUp for pre-initialization setup Source: https://www.reviewboard.org/docs/manual/latest/extending/extensions/testing Shows how to override setUp() to run code before the extension is enabled, then call super().setUp() to trigger initialization. ```python class MyExtensionTests(MyExtensionTestCase): def setUp(self): # Your pre-initialization setup goes here. super().setUp() ``` -------------------------------- ### Create PostgreSQL database and user (example) Source: https://www.reviewboard.org/docs/manual/latest/admin/installation/creating-sites Example commands for creating the Review Board database and user with specific values. ```sql $ psql -U postgres -h db.example.com postgres=# CREATE USER rbuser WITH PASSWORD 's3cr3t'; postgres=# CREATE DATABASE reviewboard WITH OWNER rbuser; ``` -------------------------------- ### GET extension response body Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/extension The JSON response body for the GET request, containing the extension details such as author, class_name, enabled, installed, and links. ```json { "extension": { "author": null, "author_url": null, "can_disable": false, "can_enable": false, "class_name": "rbintegrations.extension.RBIntegrationsExtension", "enabled": true, "installed": true, "links": { "self": { "href": "https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/", "method": "GET" }, "update": { "href": "https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/", "method": "PUT" } }, "load_error": "This extension is not installed or could not be found. Try re-installing it and then click \"Reload Extensions\".", "loadable": false, "name": "Integrations", "summary": null, "version": null }, "stat": "ok" } ``` -------------------------------- ### _ExtensionTestCaseMixin.setup_extension() Source: https://www.reviewboard.org/docs/djblets/latest/coderef/python/djblets.extensions.testing.testcases Sets up a new extension instance for testing. ```APIDOC ## _ExtensionTestCaseMixin.setup_extension() ### Description Sets up a new extension instance. This constructs a new extension of the provided type with the provided information. The extension is registered in the extension manager and cleaned up when the unit test has finished. ### Method setup_extension ### Signature `setup_extension(extension_cls=None, package_name=None, metadata=None, enable=True, extension_mgr=None)` ### Parameters - **extension_cls** (type, optional) - The extension class to instantiate. If not provided, uses `extension_class`. - **package_name** (str, optional) - The package name to use for the extension. If not provided, uses `extension_package_name`. - **metadata** (dict, optional) - Metadata to use for the extension. If not provided, uses `extension_metadata`. - **enable** (bool, optional) - Whether to enable the extension by default. Defaults to True. - **extension_mgr** (djblets.extensions.manager.ExtensionManager, optional) - An explicit extension manager to use. If not provided, uses the test suite's `extension_mgr`. ### Returns None ### Example ```python self.setup_extension(MyExtension) ``` ``` -------------------------------- ### TestRunner.setup_dirs Source: https://www.reviewboard.org/docs/djblets/latest/coderef/python/djblets.testing.testrunners Sets up directories to create and use. Returns a list of directory paths to create. ```APIDOC ## TestRunner.setup_dirs ### Description Sets up directories to create and use. Returns a list of directory paths to create. ### Method Method ### Signature `setup_dirs()` ### Returns - **list** of `unicode` - A list of directory paths to create. ### Notes This is not responsible for creating the directories. Any returned paths will be created automatically. ``` -------------------------------- ### Upgrade Review Board on a system install Source: https://www.reviewboard.org/docs/manual/latest/admin/upgrading/upgrading-reviewboard Run this command to upgrade Review Board when it is installed system-wide. May need to be run as root or using sudo, depending on your setup. ```bash $ pip3 install -U ReviewBoard ``` -------------------------------- ### Global Policy Section: Read-only access example Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/api-token-policy Example global policy that allows only read-only access to the API by allowing GET, HEAD, and OPTIONS methods and blocking all others. ```json { "resources": { "*": { "allow": ["GET", "HEAD", "OPTIONS"], "block": ["*"] } } } ``` -------------------------------- ### SetupRepo.main(*args) Source: https://www.reviewboard.org/docs/rbtools/latest/api/coderef/python/rbtools.commands.setup_repo Runs the main logic of the command. This method should be overridden to implement the command's functionality. It returns the resulting exit code. ```APIDOC ## SetupRepo.main(*args) ### Description Runs the main logic of the command. This method should be overridden to implement the command's functionality. It returns the resulting exit code. ### Method `main` ### Parameters - **args** (tuple) - Required - Positional arguments passed to the command. ### Returns - **int** - The resulting exit code. ``` -------------------------------- ### Usage syntax for rbt setup-completion Source: https://www.reviewboard.org/docs/rbtools/latest/rbt/commands/setup-completion Shows the general usage syntax for the command, including options and the shell parameter. ```bash $ rbt setup-completion [options] ``` -------------------------------- ### record_siteconfig_install(siteconfig, *, version) Source: https://www.reviewboard.org/docs/manual/latest/extending/coderef/python/reviewboard.admin.siteconfig Records a new install of Review Board in the site configuration. Sets the version, install time, and starts the version_history setting. The site configuration is saved once updated. ```APIDOC ## record_siteconfig_install(siteconfig, *, version) ### Description Record a new install of Review Board in the site configuration. This will set the version, the time of the install, and start off the `version_history` setting with this install. The site configuration will be saved once updated. ### Parameters - **siteconfig** (`djblets.siteconfig.models.SiteConfiguration`) – The site configuration to update. - **version** (`str`) – The version of Review Board being installed. ### New in Version 8.1.1 ``` -------------------------------- ### GET /api/review-requests/{review_request_id}/reviews/{review_id}/replies/{reply_id}/ Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/review-reply This snippet documents the GET endpoint for retrieving a review reply resource, including the request example and the full response structure. ```APIDOC ## GET /api/review-requests/{review_request_id}/reviews/{review_id}/replies/{reply_id}/ ### Description Retrieves a review reply resource. The response includes the reply's body text, metadata, and links to related resources such as comments and the user who created the reply. ### Method GET ### Endpoint /api/review-requests/{review_request_id}/reviews/{review_id}/replies/{reply_id}/ ### Parameters #### Path Parameters - **review_request_id** (integer) - Required - The ID of the review request. - **review_id** (integer) - Required - The ID of the review that the reply belongs to. - **reply_id** (integer) - Required - The ID of the reply. ### Request Example ``` curl https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **reply** (object) - The review reply resource. - **body_bottom** (string) - The bottom body text of the reply. - **body_bottom_text_type** (string) - The text type of the bottom body (e.g., "plain"). - **body_top** (string) - The top body text of the reply. - **body_top_text_type** (string) - The text type of the top body (e.g., "plain"). - **extra_data** (object) - Additional data associated with the reply. - **id** (integer) - The reply ID. - **links** (object) - Links to related resources. - **delete** (object) - Link to delete the reply (method: DELETE). - **diff_comments** (object) - Link to diff comments (method: GET). - **file_attachment_comments** (object) - Link to file attachment comments (method: GET). - **general_comments** (object) - Link to general comments (method: GET). - **screenshot_comments** (object) - Link to screenshot comments (method: GET). - **self** (object) - Link to this resource (method: GET). - **update** (object) - Link to update the reply (method: PUT). - **user** (object) - Link to the user who created the reply (method: GET). - **public** (boolean) - Whether the reply is public. - **text_type** (string) - The text type of the reply (null if not set). - **timestamp** (string) - The timestamp of the reply. - **stat** (string) - The status of the response ("ok"). #### Response Example ``` { "reply": { "body_bottom": "", "body_bottom_text_type": "plain", "body_top": "Excellent point.", "body_top_text_type": "plain", "extra_data": {}, "id": 10, "links": { "delete": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/", "method": "DELETE" }, "diff_comments": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/", "method": "GET" }, "file_attachment_comments": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/file-attachment-comments/", "method": "GET" }, "general_comments": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/general-comments/", "method": "GET" }, "screenshot_comments": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/screenshot-comments/", "method": "GET" }, "self": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/", "method": "GET" }, "update": { "href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/", "method": "PUT" }, "user": { "href": "https://reviews.example.com/api/users/admin/", "method": "GET", "title": "admin" } }, "public": true, "text_type": null, "timestamp": "2010-08-28T02:26:47Z" }, "stat": "ok" } ``` ``` -------------------------------- ### HostingService.__init__(account) Source: https://www.reviewboard.org/docs/manual/latest/extending/coderef/python/reviewboard.hostingsvcs.base.hosting_service Initializes the hosting service with the given account. ```APIDOC ## Method: __init__(account) ### Description Initialize the hosting service. ### Parameters - **account** (`reviewboard.hostingsvcs.models.HostingServiceAccount`) – The account to use with the service. ``` -------------------------------- ### initialize(load_extensions=True, setup_logging=True, setup_templates=True) Source: https://www.reviewboard.org/docs/manual/latest/extending/coderef/python/reviewboard Begin initialization of Review Board. This sets up logging, generates cache serial numbers, loads extensions, and sets up other aspects. It fires the `reviewboard.signals.initializing` signal when finished. ```APIDOC ## initialize(load_extensions=True, setup_logging=True, setup_templates=True) ### Description Begin initialization of Review Board. This sets up the logging, generates cache serial numbers, loads extensions, and sets up other aspects of Review Board. Once it has finished, it will fire the `reviewboard.signals.initializing` signal. ### Parameters - **load_extensions** (bool, optional) - Whether extensions should be automatically loaded upon initialization. If set, extensions will only load if the site has been upgraded to the latest version of Review Board. - **setup_logging** (bool, optional) - Whether to set up logging based on the configured settings. This can be disabled if the caller has their own logging configuration. - **setup_templates** (bool, optional) - Whether to set up state for template rendering. This can be disabled if the caller has no need for template rendering of any kind. This does not prevent template rendering from happening, but may change the output of some templates. Keep in mind that many pieces of functionality, such as avatars and some management commands, may be impacted by this setting. ``` -------------------------------- ### GET Hosting Service Account with curl Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/hosting-service-account Retrieves information on a particular hosting service account using an HTTP GET request. The example uses the Accept header to request JSON. ```bash $ curl https://reviews.example.com/api/hosting-service-accounts/1/ -H "Accept: application/json" ``` -------------------------------- ### GET /api/extensions/ Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/extension-list Returns the list of known extensions. Each extension in the list has been installed, but may not be enabled. ```APIDOC ## GET /api/extensions/ ### Description Returns the list of known extensions. Each extension in the list has been installed, but may not be enabled. ### Method GET ### Endpoint /api/extensions/ ### Response #### Success Response (200) - **extensions** (array) - List of extension objects. - **links** (object) - Links to related resources. - **stat** (string) - Status of the response, e.g., "ok". - **total_results** (integer) - Total number of extensions returned. #### Response Example { "extensions": [ { "author": null, "author_url": null, "can_disable": false, "can_enable": false, "class_name": "rbintegrations.extension.RBIntegrationsExtension", "enabled": true, "installed": true, "links": { "self": { "href": "https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/", "method": "GET" }, "update": { "href": "https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/", "method": "PUT" } }, "load_error": "This extension is not installed or could not be found. Try re-installing it and then click \"Reload Extensions\".", "loadable": false, "name": "Integrations", "summary": null, "version": null }, { "author": null, "author_url": null, "can_disable": false, "can_enable": false, "class_name": "reviewbotext.extension.ReviewBotExtension", "enabled": false, "installed": true, "links": { "self": { "href": "https://reviews.example.com/api/extensions/reviewbotext.extension.ReviewBotExtension/", "method": "GET" }, "update": { "href": "https://reviews.example.com/api/extensions/reviewbotext.extension.ReviewBotExtension/", "method": "PUT" } }, "load_error": "This extension is not installed or could not be found. Try re-installing it and then click \"Reload Extensions\".", "loadable": false, "name": "Review Bot", "summary": null, "version": null } ], "links": { "self": { "href": "https://reviews.example.com/api/extensions/", "method": "GET" } }, "stat": "ok", "total_results": 2 } ### Errors - 100 - Does Not Exist (HTTP 404) - Object does not exist - 101 - Permission Denied (HTTP 403) - You don't have permission for this - 103 - Not Logged In (HTTP 401) - You are not logged in - 112 - OAuth2 Missing Scope Error (HTTP 403) - Your OAuth2 token lacks the necessary scopes for this request. - 113 - OAuth2 Access Denied Error (HTTP 403) - OAuth2 token access for this resource is prohibited. ``` -------------------------------- ### SCMClient.setup() Source: https://www.reviewboard.org/docs/rbtools/latest/api/coderef/python/rbtools.clients.base.scmclient Sets up the client by performing checks to ensure it can be used. Callers should call this method or has_dependencies() before other operations. ```APIDOC ## SCMClient.setup() ### Description Sets up the client by performing checks to ensure it can be used. If checks succeed, is_setup becomes True; if they fail, an exception may be raised and is_setup remains False. This does not check requires_diff_tool. ### Method setup ### Raises - **rbtools.clients.errors.SCMClientDependencyError** - One or more required dependencies are missing. ``` -------------------------------- ### GET /extensions/ Source: https://www.reviewboard.org/docs/djblets/latest/coderef/python/djblets.extensions.resources Returns the list of known extensions. Each extension in the list has been installed, but may not be enabled. ```APIDOC ## GET /extensions/ ### Description Returns the list of known extensions. Each extension in the list has been installed, but may not be enabled. ### Method GET ### Endpoint /extensions/ ### Response #### Success Response (200) - **author** (String) - The author of the extension. - **author_url** (String) - The author's website. - **can_disable** (Boolean) - Whether or not the extension can be disabled. - **can_enable** (Boolean) - Whether or not the extension can be enabled. - **class_name** (String) - The class name for the extension. - **enabled** (Boolean) - Whether or not the extension is enabled. - **installed** (Boolean) - Whether or not the extension is installed. - **load_error** (String) - If the extension could not be loaded, this will contain any errors captured while trying to load. - **loadable** (Boolean) - Whether or not the extension is currently loadable. An extension may be installed but missing or may be broken due to a bug. - **name** (String) - The name of the extension. - **summary** (String) - A summary of the extension's functionality. - **version** (String) - The installed version of the extension. #### Response Example { "extensions": [ { "author": "string", "author_url": "string", "can_disable": true, "can_enable": true, "class_name": "string", "enabled": true, "installed": true, "load_error": "string", "loadable": true, "name": "string", "summary": "string", "version": "string" } ] } ``` -------------------------------- ### setup_logging(instance, conf, **kwargs) Source: https://www.reviewboard.org/docs/reviewbot/latest/coderef/worker/reviewbot.celery Sets up logging for Celery and Review Bot, configuring log formats and adding the logger name. ```APIDOC ## setup_logging(instance, conf, **kwargs) ### Description Sets up logging for Celery and Review Bot. This will configure the log formats we want Celery to use, including the logger name. ### Method Function ### Signature `setup_logging(instance, conf, **kwargs)` ### Parameters - **instance** (`celery.app.base.Celery`) - Required - The Celery instance. - **conf** (`celery.app.utils.Settings`) - Required - The Celery configuration. - **kwargs** (`dict`, unused) - Optional - Additional keyword arguments passed to the signal. ``` -------------------------------- ### GET /api/users/{username}/ Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/user This snippet documents the GET endpoint for retrieving a user resource from the Review Board API. It includes the endpoint path, parameters, and the full response structure with example data. ```APIDOC ## [GET] /api/users/{username}/ ### Description Retrieves information about a specific user, including profile details, avatar URLs, and links to related resources. ### Method GET ### Endpoint /api/users/{username}/ ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user to retrieve. ### Request Example ``` curl https://reviews.example.com/api/users/admin/ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **stat** (string) - The status of the response, typically "ok". - **user** (object) - The user object containing the following fields: - **avatar_html** (string|null) - HTML for the user's avatar, if available. - **avatar_url** (string) - URL for the user's avatar. - **avatar_urls** (object) - URLs for different avatar sizes (1x, 2x, 3x). - **email** (string) - The user's email address. - **first_name** (string) - The user's first name. - **fullname** (string) - The user's full name. - **id** (integer) - The user's ID. - **is_active** (boolean) - Whether the user is active. - **last_name** (string) - The user's last name. - **links** (object) - Links to related resources (api_tokens, archived_review_requests, muted_review_requests, self, update, user_file_attachments, watched). - **url** (string) - The user's profile URL. - **username** (string) - The user's username. #### Response Example ```json { "stat": "ok", "user": { "avatar_html": null, "avatar_url": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=48&d=mm", "avatar_urls": { "1x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=48&d=mm", "2x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=96&d=mm", "3x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=144&d=mm" }, "email": "admin@example.com", "first_name": "Admin", "fullname": "Admin User", "id": 1, "is_active": true, "last_name": "User", "links": { "api_tokens": { "href": "https://reviews.example.com/api/users/admin/api-tokens/", "method": "GET" }, "archived_review_requests": { "href": "https://reviews.example.com/api/users/admin/archived-review-requests/", "method": "GET" }, "muted_review_requests": { "href": "https://reviews.example.com/api/users/admin/muted-review-requests/", "method": "GET" }, "self": { "href": "https://reviews.example.com/api/users/admin/", "method": "GET" }, "update": { "href": "https://reviews.example.com/api/users/admin/", "method": "PUT" }, "user_file_attachments": { "href": "https://reviews.example.com/api/users/admin/user-file-attachments/", "method": "GET" }, "watched": { "href": "https://reviews.example.com/api/users/admin/watched/", "method": "GET" } }, "url": "/users/admin/", "username": "admin" } } ``` ``` -------------------------------- ### SetupRepo.prompt_rb_repository(local_tool_name, server_tool_names, repository_paths, api_root) Source: https://www.reviewboard.org/docs/rbtools/latest/api/coderef/python/rbtools.commands.setup_repo Interactively prompts the user to select a matching repository from the Review Board server. The user is prompted to choose a matching repository found on the server. ```APIDOC ## SetupRepo.prompt_rb_repository(local_tool_name, server_tool_names, repository_paths, api_root) ### Description Interactively prompts the user to select a matching repository from the Review Board server. The user is prompted to choose a matching repository found on the server. ### Method `prompt_rb_repository` ### Parameters - **local_tool_name** (str) - Required - The local name of the detected tool. - **server_tool_names** (str) - Required - A comma-separated list of potentially matching SCMTool names in the Review Board server. - **repository_paths** (list or str, optional) - A list of potential paths to match for the repository. - **api_root** (rbtools.api.resource.RootResource) - Required - The root resource for the Review Board server. ### Returns - **rbtools.api.resource.RepositoryItemResource** - The selected repository resource. ``` -------------------------------- ### Example payload with include-text-types=html,raw Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/rich-text-fields Example payload when using `?include-text-types=html,raw` on a GET request. The response includes the original `description` and `description_text_type` fields, plus `html_text_fields` and `raw_text_fields` dictionaries containing the converted text and its text type. ```json { ... "description": "This is a **test**.", "description_text_type": "markdown", "html_text_fields": { "description": "

This is a test.

", "description_text_type": "html" }, "raw_text_fields": { "description": "This is a **test**.", "description_text_type": "markdown" }, ... } ``` -------------------------------- ### Example docker run for Python pack Source: https://www.reviewboard.org/docs/reviewbot/latest/installation/docker Concrete example of pulling and running the beanbag/reviewbot-python:3.0 image with sample volume paths and a RabbitMQ broker URL. ```bash $ docker pull beanbag/reviewbot-python:3.0 $ docker run -P \ --name \ -v /etc/reviewbot/config:/config \ -v /var/lib/reviewbot/repos:/repos \ -e BROKER_URL=amqp://reviewbot:reviewbot123@rabbitmq/reviewbot \ beanbag/reviewbot-python:3.0 ``` -------------------------------- ### GET /api/review-requests/{review_request_id}/status-updates/{status_update_id}/ Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/status-update Example of retrieving a status update using the Review Board Web API. ```APIDOC ## [GET] /api/review-requests/{review_request_id}/status-updates/{status_update_id}/ ### Description Retrieves a single status update for a review request. ### Method GET ### Endpoint /api/review-requests/{review_request_id}/status-updates/{status_update_id}/ ### Parameters #### Path Parameters - **review_request_id** (integer) - Required - The ID of the review request. - **status_update_id** (integer) - Required - The ID of the status update. ### Request Example ``` curl https://reviews.example.com/api/review-requests/8/status-updates/1/ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **stat** (string) - The status of the response, e.g., "ok". - **status_update** (object) - The status update object. - **description** (string) - Description of the status update. - **extra_data** (object) - Additional data. - **id** (integer) - The ID of the status update. - **links** (object) - Links to related resources. - **change** (object) - Link to the change associated with the status update. - **delete** (object) - Link to delete the status update. - **self** (object) - Link to this status update. - **update** (object) - Link to update the status update. - **review** (null) - The review associated with the status update, if any. - **service_id** (string) - The service that created the status update. - **state** (string) - The state of the status update (e.g., "timed-out"). - **summary** (string) - Summary of the status update. - **timeout** (integer) - Timeout in seconds. - **url** (string) - URL associated with the status update. - **url_text** (string) - Text for the URL. #### Response Example ``` { "stat": "ok", "status_update": { "description": "running...", "extra_data": {}, "id": 1, "links": { "change": { "href": "https://reviews.example.com/api/review-requests/8/changes/1/", "method": "GET", "title": "Added a second diff for the interdiff test." }, "delete": { "href": "https://reviews.example.com/api/review-requests/8/status-updates/1/", "method": "DELETE" }, "self": { "href": "https://reviews.example.com/api/review-requests/8/status-updates/1/", "method": "GET" }, "update": { "href": "https://reviews.example.com/api/review-requests/8/status-updates/1/", "method": "PUT" } }, "review": null, "service_id": "reviewbot.pep8", "state": "timed-out", "summary": "PEP-8", "timeout": 20, "url": "", "url_text": "" } } ``` ``` -------------------------------- ### Set up pipx executable search path Source: https://www.reviewboard.org/docs/rbtools/latest/installation Run this command to add pipx's bin directory to your PATH. Follow the displayed instructions after running it. ```bash $ pipx ensurepath ``` -------------------------------- ### rb-site install command (System Installs) Source: https://www.reviewboard.org/docs/manual/latest/admin/installation/creating-sites Run this command to install a Review Board site when using system-wide installations. Replace with the desired site directory path. ```bash $ rb-site install ``` ```bash $ rb-site install /var/www/reviews.example.com ``` -------------------------------- ### GET request to validate diff commit list resource Source: https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/validate-diff-commit Example curl command to retrieve links for the commit validation resource. ```bash curl https://reviews.example.com/api/validation/commits/ -H "Accept: application/json" ``` -------------------------------- ### SafeRegistry using ExceptionFreeGetterMixin Source: https://www.reviewboard.org/docs/djblets/latest/guides/registries/writing-registries Equivalent to the previous SafeRegistry example but uses the ExceptionFreeGetterMixin mixin to provide the same behavior without overriding get(). ```python from djblets.registries.mixins import ExceptionFreeGetterMixin class SafeRegistry(ExceptionFreeGetterMixin[Item], Registry[Item]): pass ```