Giter Club home page Giter Club logo

p4review's Introduction

Introduction

A review notification script/daemon is a program that sends out (email) notification when files/jobs are submitted to a Perforce server.

This directory contains the original Perforce review notification "daemon" and a more serious rewrite named P4Review2.

P4Review2 is targeted for Python 2.7 and can be used with either P4Python or the command line client.

While the p4review.py is a great example to show Perforce administrators how to implement email notification it lacks the sophistication and features that many of our customers expects. While many Perforce admin updated the p4review.py to suit their requirement the result is usually a highly customized solution that only works for certain environment.

Because of that,P4Review2 was written with customization in mind - instead of modifying the script directly you can achieve most task by supplying a configuration instead.

Features

  • Authenticates against SMTP and Perforce servers with TLS/SSL support.

  • Support unicode - even for non-ACSII characters in non-unicode enabled server iff you use a single encoding on the server.

  • Configurable email templates which an be hooked with P4Web and Swarm.

  • Option to send email summary per user per invocation instead of one for each change.

  • Configurable limits on the maximum message size and number of emails that get sent.

  • Built-in logging and extensive command-line options to facilitate customization, testing and debugging.

  • Ships with useful defaults which you can customize via a single INI-like configuration file so you can be up and running in a matter of minutes.

  • Guards to prevent running multiple instances of the script by mistake.

  • Use P4Python when available for efficiency and fallback to the Perforce command line client gracefully.

  • Option for users to opt-in (--opt-in-path) reviews from P4Review2 for smooth migration from other review notification systems.

Installation and Configuration

Here is how to setup P4Review2 in 3 simple steps:

  1. Create a configuration file using the defaults:

     python p4review2.py --sample-config > p4review2.conf
    

    The file is in INI-like format. Edit the file to match your environment. In particular, check settings for the following:

    • p4port
    • p4user
    • p4charset
    • review_counter
    • job_counter
    • change_url
    • job_url
    • user_url

    Simply set a setting to an empty string (without quotes) if it's not required.

  2. Test the configuration with:

     python p4review2.py -c p4review2.conf -P
    
  3. When ready, create a crontab (Linux/UNIX)/scheduled task (Windows) to run the above command without the -P option. When used with Windows's task scheduler you may need to create a batch file which calls the script with the correct command-line options.

  4. Under Linux/UNIX you can also run the script as a daemon - see the --daemon and --daemon-poll-delay options.

Note

Most (if not all) configuration can be overwritten on the command line via options. See python p4review2.py -h for the complete list.

File a bug against the "lester-cheung-p4review" and start the description with "[p4review2]" if you see something missing.

Contact

Questions? Have an idea? You can reach me at the Perforce Forum or via Twitter (P4Lester).

There is also a forum thread for P4Review2.

p4review's People

Contributors

lestercheung avatar

Stargazers

 avatar

Watchers

 avatar

p4review's Issues

debug_email not in defaults, can't be used via cfg

the perforce repo you host this on is erroring 500 right now (hah)... so I'm filing this here.

I was trying to debug email and couldn't. It kept giving me errors about needing to regenerate config. Eventually I realized it needed to have a default value set for the config parser to allow it to be in the config file.

should error if config file not found

Right now if you typo/move the config and try to run this thing it pretends to read the config (not sure why) but then fails saying there is "no p4config section". It would be better to test for file existence and error out early w/ a clear message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.