Exemplo n.º 1
0
def list_analysis():
    """
    List all available analysis
    """
    all_analysis = BugAnalysis.with_bugs().all()
    logger.info('Fetched all analysis from db', all_analysis=all_analysis)
    return [
        serialize_analysis(analysis, nb, False)
        for analysis, nb in all_analysis
    ]
Exemplo n.º 2
0
def get_analysis(analysis_id):
    """
    Fetch an analysis and all its bugs
    """

    # Get bug analysis
    try:
        analysis = BugAnalysis.query.filter_by(id=analysis_id).one()
    except NoResultFound:
        abort(404)

    # Build JSON output
    return serialize_analysis(analysis)
Exemplo n.º 3
0
def get_analysis(analysis_id):
    """
    Fetch an analysis and all its bugs
    """

    # Get bug analysis
    try:
        analysis = BugAnalysis.query.filter_by(id=analysis_id).one()
    except NoResultFound:
        abort(404)

    # Build JSON output
    return serialize_analysis(analysis)
Exemplo n.º 4
0
def get_analysis(analysis_id):
    """
    Fetch an analysis and all its bugs
    """

    # Get bug analysis
    try:
        analysis, bugs_nb = BugAnalysis.with_bugs() \
            .join(BugResult, isouter=True) \
            .filter(BugAnalysis.id == analysis_id) \
            .one()
    except NoResultFound:
        abort(404)

    logger.info('Fetched analysis from db', analysis=analysis)

    # Build JSON output
    return serialize_analysis(analysis, bugs_nb)
Exemplo n.º 5
0
def update_analysis(analysis_id):
    """
    Update an analysis, from a bot
    Used to update version numbers from bot
    """

    # Get bug analysis
    try:
        analysis, bugs_nb = BugAnalysis.with_bugs() \
            .filter(BugAnalysis.id == analysis_id) \
            .one()
    except NoResultFound:
        abort(404)

    # Update version
    if 'version' in request.json:
        analysis.version = int(request.json['version'])

    # Save changes in db
    db.session.add(analysis)
    db.session.commit()

    # Build JSON output
    return serialize_analysis(analysis, bugs_nb)
Exemplo n.º 6
0
def list_analysis():
    """
    List all available analysis
    """
    all_analysis = BugAnalysis.query.all()
    return [serialize_analysis(analysis, False) for analysis in all_analysis]
Exemplo n.º 7
0
def list_analysis():
    """
    List all available analysis
    """
    all_analysis = BugAnalysis.query.all()
    return [serialize_analysis(analysis, False) for analysis in all_analysis]