Merge remote-tracking branch 'origin/master' into touchdown
Conflicts: test/data/test.db
This commit is contained in:
commit
8c3448080c
62 changed files with 581 additions and 339 deletions
|
@ -3,7 +3,7 @@ import json
|
|||
|
||||
from flask import request
|
||||
|
||||
from app import app, userfiles as user_files
|
||||
from app import app, userfiles as user_files, build_logs
|
||||
from endpoints.api import (RepositoryParamResource, parse_args, query_param, nickname, resource,
|
||||
require_repo_read, require_repo_write, validate_json_request,
|
||||
ApiResource, internal_only, format_date, api, Unauthorized, NotFound)
|
||||
|
@ -17,7 +17,6 @@ from util.names import parse_robot_username
|
|||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
build_logs = app.config['BUILDLOGS']
|
||||
|
||||
|
||||
def get_trigger_config(trigger):
|
||||
|
|
|
@ -239,7 +239,7 @@ def put_image_checksum(namespace, repository, image_id):
|
|||
abort(400, "Missing checksum for image %(image_id)s", issue='missing-checksum', image_id=image_id)
|
||||
|
||||
if not session.get('checksum'):
|
||||
abort(400, 'Checksum not found in Cookie for image %(imaage_id)s',
|
||||
abort(400, 'Checksum not found in Cookie for image %(image_id)s',
|
||||
issue='missing-checksum-cookie', image_id=image_id)
|
||||
|
||||
profile.debug('Looking up repo image')
|
||||
|
|
|
@ -315,8 +315,8 @@ class GithubBuildTrigger(BuildTrigger):
|
|||
|
||||
def handle_trigger_request(self, request, auth_token, config):
|
||||
payload = request.get_json()
|
||||
if not payload:
|
||||
raise SkipRequestException()
|
||||
if not payload or not 'head_commit' in payload:
|
||||
raise SkipRequestException()
|
||||
|
||||
if 'zen' in payload:
|
||||
raise ValidationRequestException()
|
||||
|
|
|
@ -2,13 +2,13 @@ import logging
|
|||
import os
|
||||
|
||||
from flask import (abort, redirect, request, url_for, make_response, Response,
|
||||
Blueprint, send_from_directory)
|
||||
Blueprint, send_from_directory, jsonify)
|
||||
from flask.ext.login import current_user
|
||||
from urlparse import urlparse
|
||||
|
||||
from data import model
|
||||
from data.model.oauth import DatabaseAuthorizationProvider
|
||||
from app import app, billing as stripe
|
||||
from app import app, billing as stripe, build_logs
|
||||
from auth.auth import require_session_login
|
||||
from auth.permissions import AdministerOrganizationPermission
|
||||
from util.invoice import renderInvoiceToPdf
|
||||
|
@ -146,7 +146,16 @@ def v1():
|
|||
@web.route('/status', methods=['GET'])
|
||||
@no_cache
|
||||
def status():
|
||||
return make_response('Healthy')
|
||||
db_healthy = model.check_health()
|
||||
buildlogs_healthy = build_logs.check_health()
|
||||
|
||||
response = jsonify({
|
||||
'db_healthy': db_healthy,
|
||||
'buildlogs_healthy': buildlogs_healthy,
|
||||
})
|
||||
response.status_code = 200 if db_healthy and buildlogs_healthy else 503
|
||||
|
||||
return response
|
||||
|
||||
|
||||
@web.route('/tos', methods=['GET'])
|
||||
|
|
Reference in a new issue