Development mode

P4 Code Review has a development mode that, when enabled, changes P4 Code Review's behavior in the following ways:

  • CSS and JavaScript code is not aggregated. Each CSS or JavaScript file is fetched individually, which makes it much easier to identify where styles or functions exist and how they apply to P4 Code Review. Due to the additional HTTP requests, development mode should not be used in production environments.
  • The following pages are written in React: My Dashboard, Reviews list, Configure a project, and Review display. These pages are minified and cannot be modified.
  • Errors and exceptions that may occur are displayed in P4 Code Review's UI. This is particularly useful to developers of P4 Code Review modules. As the error information might disclose system paths or configuration, development mode should not be used in production environments.
A configuration change only takes effect when the configuration cache has been reloaded. You must be an admin or super user to reload the P4 Code Review config cache.

To reload the configuration:

  1. Open the user menu (top-right corner of P4 Code Review).

  2. Select System Information.

  3. Open the Cache Info tab.

  4. Click Reload Configuration.

If changes to the config.php file might have caused the P4 Code Review web interface to become unresponsive, remove the problematic changes from the config.php file, then clear the configuration cache by running this command: rm -f /opt/perforce/swarm/data/cache/module-config-cache.php

To enable development mode:

Adjust the SWARM_ROOT/data/config.php file to include:

<?php
return array(
'p4' => ...
'environment' => array(
'mode' => 'development'
)
);

To disable development mode:

Adjust the SWARM_ROOT/data/config.php file to exclude the 'mode' => 'development' line.