From 7578a268ef70a0d54d87f2c2a1a4bd80dfde47b9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 08 2016 17:30:39 +0000 Subject: Improve the documentation of the jenkins_ci_notification endpoint --- diff --git a/pagure/api/ci/jenkins.py b/pagure/api/ci/jenkins.py index 2d01423..bd70748 100644 --- a/pagure/api/ci/jenkins.py +++ b/pagure/api/ci/jenkins.py @@ -22,14 +22,23 @@ from pagure.api import API, APIERROR @API.route('/ci/jenkins//build-finished', methods=['POST']) def jenkins_ci_notification(pagure_ci_token): - """ Flag a pull-request based on the info provided by the CI service. + """ + Jenkins Build Notification + -------------------------- + At the end of a build on Jenkins, this URL is used (if the project is + rightly configured) to flag a pull-request with the result of the build. + + :: + + POST /api/0/ci/jenkins//build-finished + """ project = lib_ci.get_project_by_ci_token(SESSION, pagure_ci_token) if not project: flask.abort(404, 'No project corresponding to this CI token') - data = flask.request.json() + data = flask.request.get_json() if not data: flask.abort(400, "Bad Request: No JSON retrived")