Exemplo n.º 1
0
    def pushes(self):
        """Pushes Report Controller."""
        params = self._validate(PushesSchema(), request.params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('starttime', 'endtime', 'int_size', 'branches')])

        @beaker_cache(expire=600, cache_response=False)
        def pushes_get_report(**params):
            return GetPushes(**params)
        c.report = pushes_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            rtype = params['type']
            if rtype == 'int':
                return gviz_pushes_intervals(c.report, req_id=req_id)
            if rtype == 'hourly':
                return gviz_pushes_daily_intervals(c.report, req_id=req_id)
            else:
                return gviz_pushes(c.report, req_id=req_id)
        else:
            return render('/reports/pushes.mako')
Exemplo n.º 2
0
    def index(self, slave=None):
        if 'numbuilds' in request.GET:
            count = int(request.GET.getone('numbuilds'))
        else:
            count = 25

        if 'format' in request.GET:
            format = request.GET.getone('format')
        else:
            format = 'html'
        if format not in ('html', 'json'):
            abort(400, detail='Unsupported format: %s' % format)

#        if slave is not None:
#            slave = slave[0]
        if 'slave' in request.GET:
            slave = request.GET.getall('slave')

        builds = GetHistoricBuilds(slave=slave, count=count)

        # Return a rendered template
        # or, return a json blob
        if format == "html":
            c.recent_builds = builds
            return render("/recent.mako")
        else:
            for b in builds:
                for k,v in b.items():
                    if isinstance(v, datetime.datetime):
                        v = times.UTC.localize(v)
                        b[k] = times.dt2ts(v)
            return self.jsonify(builds)
Exemplo n.º 3
0
    def pushes(self):
        """Pushes Report Controller."""
        params = self._validate(PushesSchema(), request.params)

        format = params['format']
        report_params = dict([(k, params[k])
                              for k in ('starttime', 'endtime', 'int_size',
                                        'branches')])

        @beaker_cache(expire=600, cache_response=False)
        def pushes_get_report(**params):
            return GetPushes(**params)

        c.report = pushes_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            rtype = params['type']
            if rtype == 'int':
                return gviz_pushes_intervals(c.report, req_id=req_id)
            if rtype == 'hourly':
                return gviz_pushes_daily_intervals(c.report, req_id=req_id)
            else:
                return gviz_pushes(c.report, req_id=req_id)
        else:
            return render('/reports/pushes.mako')
Exemplo n.º 4
0
    def trychooser(self, branch_name='mozilla-central'):
        """TryChooser Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name)
        params = self._validate(EndtoendSchema(), req_params)

        format = params['format']
        report_params = dict([
            (k, params[k]) for k in ('starttime', 'endtime', 'branch_name')
        ])

        @beaker_cache(expire=600, cache_response=False)
        def trychooser_get_report(**params):
            return TryChooserGetEndtoEndTimes(**params)

        c.report = trychooser_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        else:
            c.jscode_data_authors = gviz_trychooser_authors(c.report,
                                                            resp_type='JSCode')
            c.jscode_data_runs = gviz_trychooser_runs(c.report,
                                                      resp_type='JSCode')
            return render('/reports/trychooser.mako')
Exemplo n.º 5
0
    def waittimes(self, pool='buildpool'):
        """Wait Times Report Controller."""
        req_params = dict(request.params)
        req_params.update(pool=pool)
        params = self._validate(WaittimesSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k])
                              for k in ('pool', 'mpb', 'starttime', 'endtime',
                                        'int_size', 'maxb')])

        def waittimes_get_report(**params):
            return GetWaitTimes(**params)

        c.report = waittimes_get_report(**report_params)

        num = params['num']
        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            return gviz_waittimes(c.report, num=num, req_id=req_id)
        else:
            c.jscode_data = gviz_waittimes(c.report, num, resp_type='JSCode')
            return render('/reports/waittimes.mako')
Exemplo n.º 6
0
    def builders(self, branch_name='mozilla-central'):
        """Average Time per Builder Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name)
        params = self._validate(BuildersSchema(), req_params)

        format = params['format']
        if format == 'html':
            # if html, fetch all results by ignoring all filters
            # (by ignoring the fiter parameters, the defaults will be used)
            report_params = dict([(k, params[k]) for k in 
                ('starttime', 'endtime', 'branch_name')])
        else:
            report_params = dict([(k, params[k]) for k in 
                ('starttime', 'endtime', 'branch_name',
                'platform', 'build_type', 'job_type', 'detail_level')])

        @beaker_cache(expire=600, cache_response=False)
        def builders_get_report(**params):
            return GetBuildersReport(**params)
        c.report = builders_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            return gviz_builders(c.report, req_id=req_id)
        else:
            return render('/reports/builders.mako')
Exemplo n.º 7
0
    def slave_details(self, slave_id=None):
        """Slave Details Report Controller."""
        req_params = dict(request.params)
        req_params.update(slave_id=slave_id)
        params = self._validate(SlaveDetailsSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k])
                              for k in ('slave_id', 'starttime', 'endtime',
                                        'int_size', 'last_int_size')])

        @beaker_cache(expire=600, cache_response=False)
        def slave_details_get_report(**params):
            return GetSlaveDetailsReport(**params)

        c.report = slave_details_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            r_type = params['type']
            if r_type == 'busy':
                return gviz_slaves_busy(c.report, req_id=req_id)
            else:
                return gviz_slaves(c.report, req_id=req_id)
        else:
            return render('/reports/slave_details.mako')
Exemplo n.º 8
0
    def builders(self, branch_name='mozilla-central'):
        """Average Time per Builder Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name)
        params = self._validate(BuildersSchema(), req_params)

        format = params['format']
        if format == 'html':
            # if html, fetch all results by ignoring all filters
            # (by ignoring the fiter parameters, the defaults will be used)
            report_params = dict([
                (k, params[k]) for k in ('starttime', 'endtime', 'branch_name')
            ])
        else:
            report_params = dict([
                (k, params[k])
                for k in ('starttime', 'endtime', 'branch_name', 'platform',
                          'build_type', 'job_type', 'detail_level')
            ])

        @beaker_cache(expire=600, cache_response=False)
        def builders_get_report(**params):
            return GetBuildersReport(**params)

        c.report = builders_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            return gviz_builders(c.report, req_id=req_id)
        else:
            return render('/reports/builders.mako')
Exemplo n.º 9
0
    def slave_details(self, slave_id=None):
        """Slave Details Report Controller."""
        req_params = dict(request.params)
        req_params.update(slave_id=slave_id)
        params = self._validate(SlaveDetailsSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('slave_id', 'starttime', 'endtime', 'int_size', 'last_int_size')])

        @beaker_cache(expire=600, cache_response=False)
        def slave_details_get_report(**params):
            return GetSlaveDetailsReport(**params)
        c.report = slave_details_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            r_type = params['type']
            if r_type == 'busy':
                return gviz_slaves_busy(c.report, req_id=req_id)
            else:
                return gviz_slaves(c.report, req_id=req_id)
        else:
            return render('/reports/slave_details.mako')
Exemplo n.º 10
0
    def idlejobs(self):
        """Idle Jobs Report Controller."""
        req_params = dict(request.params)
        params = self._validate(IdleJobsSchema(), req_params)
        format = params['format']
        report_params = dict([(v, params[v])
                              for v in ('starttime', 'endtime', 'int_size')])
        c.idlejobs = GetIdleJobsReport(**report_params)

        if format == 'json':
            return c.idlejobs.jsonify()
        elif format == 'chart':
            return gviz_idlejobs(c.idlejobs)
        else:
            return render('/reports/idlejobs.mako')
Exemplo n.º 11
0
    def idlejobs(self):
        """Idle Jobs Report Controller."""
        req_params = dict(request.params)
        params = self._validate(IdleJobsSchema(), req_params)
        format = params['format']
        report_params = dict([(v, params[v]) for v in 
            ('starttime', 'endtime', 'int_size')])
        c.idlejobs = GetIdleJobsReport(**report_params)

        if format == 'json':
            return c.idlejobs.jsonify()
        elif format == 'chart':
            return gviz_idlejobs(c.idlejobs)
        else:
            return render('/reports/idlejobs.mako')
Exemplo n.º 12
0
    def testruns(self):
        """Test Runs Controller."""
        req_params = dict(request.params)
        params = self._validate(TestRunSchema(), req_params)
        format = params['format']
        report_params = dict([(v, params[v]) for v in 
            ('starttime', 'endtime', 'category', 'platform', 'group', 'btype')])
        c.testruns = GetTestRuns(**report_params)

        if format == 'json':
            return c.testruns.jsonify()
        elif format == 'chart':
            return gviz_testruns(c.testruns)
        else:
            return render('/reports/testruns.mako')
Exemplo n.º 13
0
    def testruns(self):
        """Test Runs Controller."""
        req_params = dict(request.params)
        params = self._validate(TestRunSchema(), req_params)
        format = params['format']
        report_params = dict([(v, params[v])
                              for v in ('starttime', 'endtime', 'category',
                                        'platform', 'group', 'btype')])
        c.testruns = GetTestRuns(**report_params)

        if format == 'json':
            return c.testruns.jsonify()
        elif format == 'chart':
            return gviz_testruns(c.testruns)
        else:
            return render('/reports/testruns.mako')
Exemplo n.º 14
0
    def status_builders(self):
        """Builders Report (based on statusdb) Controller."""
        params = self._validate(StatusBuildersSchema(), request.params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('starttime', 'endtime')])

        @beaker_cache(expire=600, cache_response=False)
        def status_builders_get_report(**params):
            return GetStatusBuildersReport(**params)
        c.report = status_builders_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        else:
            return render('/reports/status_builders.mako')
    def index(self, branch=None, fromtime=None, totime=None):
        # First non-mobile change in the db is "Thu May 27 08:09:58 2010 PDT"
        db_start = 1274972998
        # First mobile change in the db is "Thu Jun 24 15:13:19 2010 PDT"
        db_start_mobile = 1277417599

        if 'format' in request.GET:
            format = request.GET.getone('format')
        else:
            format = 'html'
        if format not in ('html', 'json'):
            abort(400, detail='Unsupported format: %s' % format)

        if not fromtime and 'fromtime' in request.GET:
            fromtime = request.GET.getone('fromtime')
        # magic string
        if fromtime == 'today':
            fromtime = date.today().strftime('%s')
        # sanitize a little
        if fromtime:
            fromtime = int(fromtime)
        # don't mislead over the amount of history we have
        if branch and branch.startswith(
                'mobile') and fromtime < db_start_mobile:
            fromtime = db_start_mobile
        elif fromtime < db_start:
            fromtime = db_start

        if totime:
            totime = int(totime)
        elif 'totime' in request.GET:
            totime = int(request.GET.getone('totime'))

        c.pushes = GetPushes(branch, fromtime, totime)
        c.push_limits = {
            'branch': branch,
            'fromtime': fromtime,
            'totime': totime
        }

        # Return a rendered template
        # or, return a json blob
        if format == "html":
            return render("/pushes.mako")
        else:
            return self.jsonify(c.pushes)
Exemplo n.º 16
0
 def _ok(self, obj, status=200):
     response.status = status
     #obj['status'] = "OK"
     c.raw_data = obj
     retval = self._format(obj)
     if self._fmt == 'json':
         # Disable redirecting to the Error middleware
         request.environ['pylons.status_code_redirect'] = True
         return retval
     elif self._fmt == 'html':
         c.data = obj
         c.formatted_data = retval
         action = request.environ['pylons.routes_dict']['action']
         template = '/self-serve/%s.mako' % action
         if g.mako_lookup.has_template(template):
             return render(template)
         else:
             return retval
Exemplo n.º 17
0
 def _ok(self, obj, status=200):
     response.status = status
     #obj['status'] = "OK"
     c.raw_data = obj
     retval = self._format(obj)
     if self._fmt == 'json':
         # Disable redirecting to the Error middleware
         request.environ['pylons.status_code_redirect'] = True
         return retval
     elif self._fmt == 'html':
         c.data = obj
         c.formatted_data = retval
         action = request.environ['pylons.routes_dict']['action']
         template = '/self-serve/%s.mako' % action
         if g.mako_lookup.has_template(template):
             return render(template)
         else:
             return retval
Exemplo n.º 18
0
    def status_builders(self):
        """Builders Report (based on statusdb) Controller."""
        params = self._validate(StatusBuildersSchema(), request.params)

        format = params['format']
        report_params = dict([(k, params[k])
                              for k in ('starttime', 'endtime')])

        @beaker_cache(expire=600, cache_response=False)
        def status_builders_get_report(**params):
            return GetStatusBuildersReport(**params)

        c.report = status_builders_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        else:
            return render('/reports/status_builders.mako')
Exemplo n.º 19
0
    def index(self, branch=None, platform=None, rev=None):
        if 'format' in request.GET:
            format = request.GET.getone('format')
        else:
            format = 'html'
        if format not in ('html', 'json'):
            abort(400, detail='Unsupported format: %s' % format)

        if branch is not None:
            branch = [branch]
        elif 'branch' in request.GET:
            branch = request.GET.getall('branch')

        if rev is not None:
            rev = [rev]
        elif 'rev' in request.GET:
            rev = request.GET.getone('rev')

        if self.pending:
            c.pending_builds = GetBuilds(branch=branch, type='pending')
        if self.running:
            c.running_builds = GetBuilds(branch=branch, type='running')
        if self.revision:
            c.all_builds = GetBuilds(branch=branch, type='revision', rev=rev)
            c.branch = branch[0]
            c.revision = rev[0]

        # Return a rendered template
        # or, return a json blob
        if format == "html":
            if self.template:
                return render(self.template)
        else:
            results = {}
            if self.pending:
              results['pending'] = c.pending_builds
            if self.running:
              results['running'] = c.running_builds
            if self.revision:
              results['all'] = c.all_builds
              results['branch'] = branch[0]
              results['revision'] = rev[0]
            return self.jsonify(results)
    def index(self, branch=None, platform=None, rev=None):
        if 'format' in request.GET:
            format = request.GET.getone('format')
        else:
            format = 'html'
        if format not in ('html', 'json'):
            abort(400, detail='Unsupported format: %s' % format)

        if branch is not None:
            branch = [branch]
        elif 'branch' in request.GET:
            branch = request.GET.getall('branch')

        if rev is not None:
            rev = [rev]
        elif 'rev' in request.GET:
            rev = request.GET.getone('rev')

        if self.pending:
            c.pending_builds = GetBuilds(branch=branch, type='pending')
        if self.running:
            c.running_builds = GetBuilds(branch=branch, type='running')
        if self.revision:
            c.all_builds = GetBuilds(branch=branch, type='revision', rev=rev)
            c.branch = branch[0]
            c.revision = rev[0]

        # Return a rendered template
        # or, return a json blob
        if format == "html":
            if self.template:
                return render(self.template)
        else:
            results = {}
            if self.pending:
                results['pending'] = c.pending_builds
            if self.running:
                results['running'] = c.running_builds
            if self.revision:
                results['all'] = c.all_builds
                results['branch'] = branch[0]
                results['revision'] = rev[0]
            return self.jsonify(results)
Exemplo n.º 21
0
    def builder_details(self, buildername=None):
        """Builder Report Controller."""
        req_params = dict(request.params)
        req_params.update(buildername=urllib.unquote_plus(buildername))
        params = self._validate(BuilderDetailsSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('starttime', 'endtime', 'buildername')])

        @beaker_cache(expire=600, cache_response=False)
        def builder_details_get_report(**params):
            return GetBuilderTypeReport(**params)
        c.report = builder_details_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        else:
            return render('/reports/builder_details.mako')
Exemplo n.º 22
0
    def index(self, branch=None, fromtime=None, totime=None):
        # First non-mobile change in the db is "Thu May 27 08:09:58 2010 PDT"
        db_start = 1274972998
        # First mobile change in the db is "Thu Jun 24 15:13:19 2010 PDT"
        db_start_mobile = 1277417599

        if 'format' in request.GET:
            format = request.GET.getone('format')
        else:
            format = 'html'
        if format not in ('html', 'json'):
            abort(400, detail='Unsupported format: %s' % format)

        if not fromtime and 'fromtime' in request.GET:
            fromtime = request.GET.getone('fromtime')
        # magic string
        if fromtime == 'today':
            fromtime = date.today().strftime('%s')
        # sanitize a little
        if fromtime:
            fromtime = int(fromtime);
        # don't mislead over the amount of history we have
        if branch and branch.startswith('mobile') and fromtime < db_start_mobile:
            fromtime = db_start_mobile
        elif fromtime < db_start:
            fromtime = db_start

        if totime:
            totime = int(totime)
        elif 'totime' in request.GET:
            totime = int(request.GET.getone('totime'))

        c.pushes = GetPushes(branch, fromtime, totime)
        c.push_limits = {'branch': branch, 'fromtime': fromtime, 'totime': totime}

        # Return a rendered template
        # or, return a json blob
        if format == "html":
            return render("/pushes.mako")
        else:
            return self.jsonify(c.pushes)
Exemplo n.º 23
0
    def builder_details(self, buildername=None):
        """Builder Report Controller."""
        req_params = dict(request.params)
        req_params.update(buildername=urllib.unquote_plus(buildername))
        params = self._validate(BuilderDetailsSchema(), req_params)

        format = params['format']
        report_params = dict([
            (k, params[k]) for k in ('starttime', 'endtime', 'buildername')
        ])

        @beaker_cache(expire=600, cache_response=False)
        def builder_details_get_report(**params):
            return GetBuilderTypeReport(**params)

        c.report = builder_details_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        else:
            return render('/reports/builder_details.mako')
Exemplo n.º 24
0
    def index(self):
        """Root of the API.  You're looking at it!"""
        routes = []
        for route in config['routes.map'].matchlist:
            controller = route.defaults.get('controller')
            if controller != 'selfserve':
                continue

            if route.conditions:
                method = route.conditions.get('method')[0]
            else:
                method = 'GET'

            action = route.defaults.get('action')
            docstring = getattr(self, action).__doc__

            routes.append( (route.routepath, method, docstring) )
        routes.sort()
        c.main_docstring = self.__doc__
        c.routes = routes
        return render('/self-serve/index.mako')
Exemplo n.º 25
0
    def index(self):
        """Root of the API.  You're looking at it!"""
        routes = []
        for route in config['routes.map'].matchlist:
            controller = route.defaults.get('controller')
            if controller != 'selfserve':
                continue

            if route.conditions:
                method = route.conditions.get('method')[0]
            else:
                method = 'GET'

            action = route.defaults.get('action')
            docstring = getattr(self, action).__doc__

            routes.append( (route.routepath, method, docstring) )
        routes.sort()
        c.main_docstring = self.__doc__
        c.routes = routes
        return render('/self-serve/index.mako')
Exemplo n.º 26
0
    def endtoend(self, branch_name='mozilla-central'):
        """End to End Times Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name)
        params = self._validate(EndtoendSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('starttime', 'endtime', 'branch_name')])

        @beaker_cache(expire=600, cache_response=False)
        def endtoend_get_report(**params):
            return GetEndtoEndTimes(**params)
        c.report = endtoend_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            return gviz_endtoend(c.report, req_id=req_id)
        else:
            return render('/reports/endtoend.mako')
Exemplo n.º 27
0
    def trychooser(self, branch_name='mozilla-central'):
        """TryChooser Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name)
        params = self._validate(EndtoendSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('starttime', 'endtime', 'branch_name')])

        @beaker_cache(expire=600, cache_response=False)
        def trychooser_get_report(**params):
            return TryChooserGetEndtoEndTimes(**params)
        c.report = trychooser_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        else:
            c.jscode_data_authors = gviz_trychooser_authors(c.report, 
                resp_type='JSCode')
            c.jscode_data_runs = gviz_trychooser_runs(c.report, 
                resp_type='JSCode')
            return render('/reports/trychooser.mako')
Exemplo n.º 28
0
    def waittimes(self, pool='buildpool'):
        """Wait Times Report Controller."""
        req_params = dict(request.params)
        req_params.update(pool=pool)
        params = self._validate(WaittimesSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('pool', 'mpb', 'starttime', 'endtime', 'int_size', 'maxb')])

        def waittimes_get_report(**params):
            return GetWaitTimes(**params)
        c.report = waittimes_get_report(**report_params)

        num = params['num']
        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            return gviz_waittimes(c.report, num=num, req_id=req_id)
        else:
            c.jscode_data = gviz_waittimes(c.report, num, resp_type='JSCode')
            return render('/reports/waittimes.mako')
Exemplo n.º 29
0
    def endtoend_revision(self, branch_name='mozilla-central', revision=None):
        """Revision Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name, revision=revision)
        params = self._validate(EndtoendRevisionSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k]) for k in 
            ('branch_name', 'revision')])

        @beaker_cache(expire=600, cache_response=False)
        def endtoend_revision_get_report(**params):
            return GetBuildRun(**params)
        c.report = endtoend_revision_get_report(**report_params)

        if c.report.get_total_build_requests() == 0 and \
            len(c.report.pending_changes) == 0:
            abort(404, 'no such revision')

        if format == 'json':
            return c.report.jsonify()
        else:
            return render('/reports/buildrun.mako')
Exemplo n.º 30
0
    def endtoend(self, branch_name='mozilla-central'):
        """End to End Times Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name)
        params = self._validate(EndtoendSchema(), req_params)

        format = params['format']
        report_params = dict([
            (k, params[k]) for k in ('starttime', 'endtime', 'branch_name')
        ])

        @beaker_cache(expire=600, cache_response=False)
        def endtoend_get_report(**params):
            return GetEndtoEndTimes(**params)

        c.report = endtoend_get_report(**report_params)

        if format == 'json':
            return c.report.jsonify()
        elif format == 'chart':
            req_id = params['reqid']
            return gviz_endtoend(c.report, req_id=req_id)
        else:
            return render('/reports/endtoend.mako')
Exemplo n.º 31
0
    def endtoend_revision(self, branch_name='mozilla-central', revision=None):
        """Revision Report Controller."""
        req_params = dict(request.params)
        req_params.update(branch_name=branch_name, revision=revision)
        params = self._validate(EndtoendRevisionSchema(), req_params)

        format = params['format']
        report_params = dict([(k, params[k])
                              for k in ('branch_name', 'revision')])

        @beaker_cache(expire=600, cache_response=False)
        def endtoend_revision_get_report(**params):
            return GetBuildRun(**params)

        c.report = endtoend_revision_get_report(**report_params)

        if c.report.get_total_build_requests() == 0 and \
            len(c.report.pending_changes) == 0:
            abort(404, 'no such revision')

        if format == 'json':
            return c.report.jsonify()
        else:
            return render('/reports/buildrun.mako')
Exemplo n.º 32
0
 def revision(self):
     """Revision Report Homepage."""
     return render('/reports/buildrun_home.mako')
Exemplo n.º 33
0
 def revision(self):
     """Revision Report Homepage."""
     return render('/reports/buildrun_home.mako')