diff options
author | Wayne <wayne@puppetlabs.com> | 2015-06-12 16:56:30 -0700 |
---|---|---|
committer | Jesse Keating <omgjlk@us.ibm.com> | 2017-05-02 08:19:50 -0700 |
commit | 40f4004425fb9fe921fd4b0a5cb653caf216d12d (patch) | |
tree | 277d9ac9be7c6e224868cdf6ef1dd4afe316a2db /zuul/driver/github/githubreporter.py | |
parent | 4fc12549072d02b97fa46ab36b4618f320ce507f (diff) | |
download | zuul-40f4004425fb9fe921fd4b0a5cb653caf216d12d.tar.gz |
Add basic Github Zuul Reporter.
Change-Id: I3c34bb1354adb7c360e173c227f00bf987b7d30e
Co-Authored-By: Jan Hruban <jan.hruban@gooddata.com>
Diffstat (limited to 'zuul/driver/github/githubreporter.py')
-rw-r--r-- | zuul/driver/github/githubreporter.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/zuul/driver/github/githubreporter.py b/zuul/driver/github/githubreporter.py new file mode 100644 index 000000000..685c60e8d --- /dev/null +++ b/zuul/driver/github/githubreporter.py @@ -0,0 +1,38 @@ +# Copyright 2015 Puppet Labs +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import logging +import voluptuous as v + +from zuul.reporter import BaseReporter + + +class GithubReporter(BaseReporter): + """Sends off reports to Github.""" + + name = 'github' + log = logging.getLogger("zuul.GithubReporter") + + def report(self, source, pipeline, item): + """Comment on PR with test status.""" + message = self._formatItemReport(pipeline, item) + project = item.change.project.name + pr_number = item.change.number + + self.connection.report(project, pr_number, message) + + +def getSchema(): + github_reporter = v.Any(str, v.Schema({}, extra=True)) + return github_reporter |