Walter A. Boring IV 26611b68ed Adds the new cireporter script used by Cinder team
This patch creates the cireporter script which is used by the Cinder
team.   This script is used to help determine which Vendor CI's are working
and reporting over a release cycle.

This patch refactors some of the code in the lastcomment.py into a common
file that contains the Job and Comment classes used by lastcomment and
cireporter.  Also updated the ci.yaml.

Change-Id: I0bde0f539d0e3752963594ef60c3ed460c918116
2017-02-07 21:00:01 +00:00

107 lines
2.5 KiB
ReStructuredText

Last Comment
============
Last Comment is a small script to query OpenStack's gerrit REST API
and produce a report about the status of CI systems.
This can also be used as a CLI tool and used against any type of user (human or bot).
Design
-------
The html based report is a data file plus a static page.
lastcomment is powered by gerrit's REST API and doesn't use any datastore.
Although this means it cannot show results in real time, the data can be
refreshed as frequent as desired.
Dependencies
------------
`requests`
Help
-----
./lastcomment.py -h
Generate a Report
------------------
To generate a html report for third party CI accounts on http://localhost:8000/report:
./lastcomment.py -f ci.yaml -c 100 --json lastcomment.json
python -m SimpleHTTPServer
Cloud-init
-----------
To run this on a cloud server using cloud-init and cron use the ``user-data.txt`` file.
Other Uses
----------
To see the last time the user 'Third Party CI' commented anywhere
./lastcomment.py -n 'Third Party CI'
To print the last 30 comments by 'Third Party CI' on the repo openstack/cinder
./lastcomment.py -n 'Third Party CI' -m -p openstack/cinder
To print the last 30 votes by 'Third Party CI' on the repo openstack/cinder
./lastcomment.py -n 'Third Party CI' -v -p openstack/cinder
To print the contents of the last 30 reviews by 'John Smith'
./lastcomment.py -n 'John Smith' -m
To specify a yaml file names.yaml containing projects and names to iterate through
./lastcomment.py -f names.yaml
To print statistics on third party CI accounts:
./lastcomment.py -c 100 -f ci.yaml -v
To generate a html report for cinder's third party CI accounts on http://localhost:8000/report:
./lastcomment.py -f ci.yaml -c 100 --json lastcomment.json
python -m SimpleHTTPServer
CI Reporter
===========
Script that produces statistics and a report of CI systems and their jobs.
It can output in plain text or json to stdout or a file.
Help
----
./cireporter.py -h
Generate A Report
-----------------
To generate a plain text report that includes stats for all Cinder CI's
./cireporter.py -i cinder.yaml -c 250
Other Uses
----------
To see the latest Cinder Jenkins stats
./cireporter.py -p openstack/cinder -n Jenkins -c 250
To generate a report as json output to stdout
./cireporter.py -p openstack/cinder -n Jenkins -c 250 -j
To generate a report as json and write it to a file
./cireporter.py -p openstack/cinder -n Jenkins -c 250 -j -o foo.json