Exemplo n.º 1
0
    def HandleGet(self):
        """Triggers analysis of a build failure on demand and return current result.

    If the final analysis result is available, set cache-control to 1 day to
    avoid overload by unnecessary and frequent query from clients; otherwise
    set cache-control to 5 seconds to allow repeated query.

    Serve HTML page or JSON result as requested.
    """
        url = self.request.get('url').strip()
        build_info = buildbot.ParseBuildUrl(url)
        if not build_info:
            return BaseHandler.CreateError(
                'Url "%s" is not pointing to a build.' % url, 501)
        master_name, builder_name, build_number = build_info

        if not masters.MasterIsSupported(master_name):
            return BaseHandler.CreateError(
                'Master "%s" is not supported yet.' % master_name, 501)

        force = self.request.get('force') == '1'
        analysis = build_failure_analysis_pipelines.ScheduleAnalysisIfNeeded(
            master_name,
            builder_name,
            build_number,
            force=force,
            queue_name=BUILD_FAILURE_ANALYSIS_TASKQUEUE)

        data = {
            'master_name': analysis.master_name,
            'builder_name': analysis.builder_name,
            'build_number': analysis.build_number,
            'pipeline_status_path': analysis.pipeline_status_path,
            'show_debug_info': self._ShowDebugInfo(),
            'analysis_request_time': _FormatDatetime(analysis.request_time),
            'analysis_start_time': _FormatDatetime(analysis.start_time),
            'analysis_end_time': _FormatDatetime(analysis.end_time),
            'analysis_duration': analysis.duration,
            'analysis_update_time': _FormatDatetime(analysis.updated_time),
            'analysis_completed': analysis.completed,
            'analysis_failed': analysis.failed,
            'analysis_result': analysis.result,
            'analysis_correct': analysis.correct,
            'triage_history': _GetTriageHistory(analysis),
        }

        return {'template': 'build_failure.html', 'data': data}
Exemplo n.º 2
0
    def HandleGet(self):  #pylint: disable=R0201
        """Checks for revert or fix of CLs in a failed build cycle.

    Later it will be extended for coverage analysis.
    This corresponds to the "Verify after green" button in the following page:
    https://1-dot-findit-for-me.appspot.com/list-build?count=400&type=triage

    This endpoint serves JSON result.
    """
        return BaseHandler.CreateError('Not implemented yet!', 501)