OpenStack infra Jenkins was retired and soon the OpenStack gerrit user
used to post comments would be renamed/replaced [1]. The cleanup is to
make it easier to add support for new user in next patch:
* change couple of names to remove mention of jenkins
* refactor _is_ci_user so it is easier to add a new condition
[1] http://lists.openstack.org/pipermail/openstack-dev/2016-June/097595.html
Change-Id: Ia7a2c2b217fb6afd99a74777487f155105c7c2ca
I was asked today where the source for this project was, seems like
this is something that should go in the Contact Us section.
Change-Id: I100dd328f3765d24d86526585870de58a9af6077
This change adds ability to see only selected rows (by clicking on them),
to get more illustrative view of a specific CI robot by comparing its
results with some Jenkins job, for example.
Change-Id: I34ab24e1eb7f989d131025ac9cf9dac70fc3fe76
Current version incorrectly parses pipeline, which leads to
un-modified event["author"]["name"], which leads to unassigned
"verified" attribute.
Usual Jenkins comment starts as:
"Patch Set 12: Verified-1\n\nBuild failed (check pipeline)."
This means, pipeline info is on line 2, not 0.
Also, removed unneeded code from projects jinja template
Change-Id: Id1143f2980a3a09ee6ab0e35342a3512525b852c
It was seen that all the queues for Jenkins post the vote under
same ci_owner. This patch separates out the votes based on the
queues.
Also includes performance improvements during compilation of
regex patterns.
Change-Id: I998749316d0b0488068ca20f9be68faf3caecd3a
Closes-Bug: #1517677
In order to make puppet-ciwatch in sync with ciwatch, change
the log file location to /var/log/ciwatch/ciwatch.log from
/var/lib/ciwatch/ciwatch.log
Change-Id: Id3713cbafca3f87db0cf24dc00e800b56e148a41
Current event listener implementation does not handle network problems
well. E.g. if ssh stream connection is lost, it would not reconnect or
recover on its own. Instead of fixing the implementation, use
well-tested gerrit listener used by zuul. Explicitly specify version of
zuul to be 2.1.0 to avoid accidental breakages due to changes in zuul
lib.
Downside is that we need to install zuul and its dependencies just to
use gerrit listener.
parse_json_event function had to be changed, because zuul gerrit event
listener provides object, not json string. We still need to create
event from json in populate_db.py, so that part of the function has
been moved there.
Closes-Bug: #1516820
Change-Id: I8aa7a18460b58998f6c378e9d9c0d783032eca21
Currently ciwatch highlights Jenkins -1 votes, but many
third party CIs pick up Gerrit events only when Jenkins
has voted +1. Hence it is important to highlight vendor
CI failures when Jenkins has verified the change set.
Closes-Bug: #1516110
Change-Id: I5635d344404c21206d7cae049f81fb1f2067ec09
There are a few problems with how SQLAlchemy session is currently used.
First, there is global, non-thread-safe (see [1]) session instantiated
in db.py. That makes it hard to ensure session is properly closed when
there is no need to keep them open (e.g. in-between Flask requests). We
also get stale data when we do queries without invalidating the
long-living session. The fix is to use scoped_session, as described in
[2], and by using new session for each Flask request, which is ensured
by using Session.remove() at the end of each request.
Another problem manifests when MySQL backend is used. During long idle
time, MySQL would close inactive connections. And because SQLAlchemy
does maintain a pool of connections open independently from session,
once we try to use it, we'll see 'MySQL server went away' and crash.
This further made worse by single global session that then gets stuck,
not being able to process any additional transactions. The fix is to
set SQLAlchemy pool_recycle to one hour, which is less than MySQL
interactive timeout.
In the future, instead of continuing to manage Flask with SQLAlchemy by
hand, migration to Flask-SQLAlchemy extension should be considered, [3].
[1] http://docs.sqlalchemy.org/en/rel_1_0/orm/session_basics.html#is-the-session-thread-safe
[2] http://docs.sqlalchemy.org/en/rel_1_0/orm/contextual.html#unitofwork-contextual
[3] https://pythonhosted.org/Flask-SQLAlchemy/quickstart.html#a-minimal-application
Closes-Bug: #1512476
Change-Id: I78a7f3f0715c5aa71d73f9c496ba3b07208674b9
This change should make it a bit easier to see when configuration is
read in, and would allow to further centralize parsing and loading of
the conf file.
We should not 'import config' each time when we need to get access to
the settings. Instead, the settings should be loaded once, and then
explicitly passed around. This patch does not make that happen yet, but
is the first step.
Change-Id: If9ad1222ceb806337a745845ee6e76605bab5fd3
CI Watch project started outside of OpenStack infrastructure.
This patch adds missing bits to enables infra testing, documentation
builds, and to make packaging easier if we'd like to do so.
Additional changes to accommodate the template:
* ciwatch/__init__.py renamed to ciwatch/server.pp, and all related
imports updated.
* README.md converted into rst and split up into sections.
Partial-Bug: #1505834
Change-Id: I0aaabcfd1607609a337ce6ca2a71f9889b45de0a
The pip install -e . step needs the configuration to succeed.
Original Change-Id: I6c105883fd7b4e84a7151d24e8fd96b6ec2e42f0
Change-Id: Idd5b3cb14447d42162b292b7333d4782fea38949
If string length is not specified, we would get:
"VARCHAR requires a length on dialect mysql" when using MySQL backend.
Original Change-Id: I25c71d6ed257974c14672c3cc261c9ccfec5d6cf
Change-Id: I1dfe6bf919313adb963f6c8f2b8b331108a6c680
We want to be able to store the configuration in /etc, as opposed to
source directory.
Try to load configuration from source dir first, and fallback to
/etc/ciwatch/ci-watch.conf.
Wrap everything into a function and add exception if no configuration
is found. We want to move away from having globals.
Original Change-Id: I91f2adc6e90b6252c5839a5ef8dde0fe7cd137f8
Change-Id: Ic939caeff538e290418cff2a6438d63a024994b0
You can disable access to port 5000 via firewall. So let the
default flask setting work outside of localhost.
Original Change-Id: I67b79873c6dfca052becba618f693b754855944d
Change-Id: I392faf8f650353f7a4c1e6df177c4090d77c3b92