Ignored users for reviews
Automated test environments can unintentionally participate in code reviews if they copy user-generated changelist descriptions.
For example:
-
If an automated system copies a changelist description that contains
#reviewand then shelves or submits files, P4 Code Review starts a new review. -
If an automated system copies a changelist description that contains
#review-123and then shelves or submits files,P4 Code Review updates the existing review.
Test environments can run thousands or millions of automated operations. If those operations trigger review activity, they can generate large numbers of reviews and notifications.
To prevent this behavior, configure P4 Code Review to ignore specific users when processing review creation and review update events.
Configure ignored users
Edit the SWARM_ROOT/data/config.php file and add the users you want P4 Code Review to ignore to the ignored_users setting in the reviews configuration block.
For example:
<?php
// this block should be a peer of 'p4'
'reviews' => array(
'ignored_users' => array('build_user1', 'build_user2'),
),
When a shelf or submit event occurs, P4 Code Review checks whether the changelist author is listed in ignored_users. If the user is listed, P4 Code Review ignores the event and does not create or update a review.
Known limitations
-
The
ignored_userssetting only affects future review creation and review update events. The setting is not retroactive. -
Reviews that were created before a user was added to
ignored_usersremain visible in the reviews list. P4 Code Review does not hide, filter, delete, or otherwise modify existing reviews for ignored users. -
If you need to remove existing reviews that were created before the user was added to
ignored_users, delete the reviews manually by using the P4 Code Review UI or the review DELETE API endpoint - to learn more, see API endpoints (v11).
Reload the configuration cache
Configuration changes take effect only after the P4 Code Review configuration cache has been reloaded.
You must be an admin or super user to reload the configuration cache.
-
Open the User ID menu.
-
Select System Information.
-
Click the Cache Info tab.
-
Click Reload Configuration.
To learn more, see Reload Configuration button.
Recover from configuration issues
If changes to the config.php file cause the P4 Code Review web interface to become unresponsive, remove the problematic changes from the file and clear the configuration cache by running:
rm -f /opt/perforce/swarm/data/cache/module-config-cache.php