5252 </tr >
5353 </thead >
5454 <tbody >
55- <tr >
56- <th >
57- <b >Update</b >
58- </th >
59- <td
60- align =" right"
61- :class =" cdash.previousbuild.nupdateerrors > 0 ? 'error' : 'normal'"
62- >
63- <b >
64- <a
65- class =" tw-link tw-link-hover"
66- :href =" $baseURL + '/builds/' + cdash.previousbuild.buildid + '/update'"
67- >
68- {{ cdash.previousbuild.nupdateerrors }}
69- </a >
70- </b >
71- </td >
72- <td
73- align =" right"
74- :class =" cdash.previousbuild.nupdatewarnings > 0 ? 'warning' : 'normal'"
75- >
76- <b >
77- <a
78- class =" tw-link tw-link-hover"
79- :href =" $baseURL + '/builds/' + cdash.previousbuild.buildid + '/update'"
80- >
81- {{ cdash.previousbuild.nupdatewarnings }}
82- </a >
83- </b >
84- </td >
85- </tr >
86-
8755 <tr v-if =" cdash.hasconfigure" >
8856 <th >
8957 <b >Configure</b >
206174 </tr >
207175 </thead >
208176 <tbody >
209- <tr >
210- <th >
211- <a
212- v-if =" cdash.hasupdate"
213- href =" #Update"
214- >
215- <b >Update</b >
216- </a >
217- <span v-if =" !cdash.hasupdate" >
218- Update
219- </span >
220- </th >
221- <td
222- align =" right"
223- :class =" cdash.update.nerrors > 0 ? 'error' : 'normal'"
224- >
225- <b >
226- <a
227- class =" tw-link tw-link-hover"
228- :href =" $baseURL + '/builds/' + cdash.build.id + '/update'"
229- >
230- {{ cdash.update.nerrors }}
231- </a >
232- </b >
233- </td >
234- <td
235- align =" right"
236- :class =" cdash.update.nwarnings > 0 ? 'warning' : 'normal'"
237- >
238- <b >
239- <a
240- class =" tw-link tw-link-hover"
241- :href =" $baseURL + '/builds/' + cdash.build.id + '/update'"
242- >
243- {{ cdash.update.nwarnings }}
244- </a >
245- </b >
246- </td >
247- </tr >
248177 <tr v-if =" cdash.hasconfigure" >
249178 <th >
250179 <a
386315 </tr >
387316 </thead >
388317 <tbody >
389- <tr >
390- <th >
391- <b >Update</b >
392- </th >
393- <td
394- align =" right"
395- :class =" cdash.nextbuild.nupdateerrors > 0 ? 'error' : 'normal'"
396- >
397- <b >
398- <a
399- class =" tw-link tw-link-hover"
400- :href =" $baseURL + '/builds/' + cdash.nextbuild.buildid + '/update'"
401- >
402- {{ cdash.nextbuild.nupdateerrors }}
403- </a >
404- </b >
405- </td >
406- <td
407- align =" right"
408- :class =" cdash.nextbuild.nupdatewarnings > 0 ? 'warning' : 'normal'"
409- >
410- <b >
411- <a
412- class =" tw-link tw-link-hover"
413- :href =" $baseURL + '/builds/' + cdash.nextbuild.buildid + '/update'"
414- >
415- {{ cdash.nextbuild.nupdatewarnings }}
416- </a >
417- </b >
418- </td >
419- </tr >
420-
421318 <tr v-if =" cdash.hasconfigure" >
422319 <th >
423320 <b >Configure</b >
461358 <b >
462359 <a
463360 class =" tw-link tw-link-hover"
464- :href =" $baseURL + '/builds/' + cdash.nextbuild.buildid + 'errors '"
361+ :href =" $baseURL + '/builds/' + cdash.nextbuild.buildid + '/build '"
465362 >
466363 {{ cdash.nextbuild.nerrors }}
467364 </a >
728625
729626<script >
730627import $ from ' jquery' ;
731- import ApiLoader from ' ./shared/ApiLoader' ;
732628import {
733629 faQuestionCircle ,
734630} from ' @fortawesome/free-solid-svg-icons' ;
@@ -748,6 +644,26 @@ export default {
748644 type: Number ,
749645 required: true ,
750646 },
647+ previousBuildId: {
648+ type: Number ,
649+ default: 0 ,
650+ },
651+ nextBuildId: {
652+ type: Number ,
653+ default: 0 ,
654+ },
655+ newIssueUrl: {
656+ type: String ,
657+ default: ' ' ,
658+ },
659+ bugTracker: {
660+ type: String ,
661+ default: ' ' ,
662+ },
663+ userId: {
664+ type: Number ,
665+ default: 0 ,
666+ },
751667 },
752668
753669 data () {
@@ -780,6 +696,133 @@ export default {
780696 },
781697
782698 apollo: {
699+ buildData: {
700+ query: gql `
701+ query BuildSummary ($buildId : ID ! , $prevId : ID , $nextId : ID , $hasPrev : Boolean ! , $hasNext : Boolean ! ) {
702+ buildData : build (id : $buildId ) {
703+ id
704+ name
705+ startTime
706+ buildType
707+ configureErrorsCount
708+ configureWarningsCount
709+ buildErrorsCount
710+ buildWarningsCount
711+ failedTestsCount
712+ notRunTestsCount
713+ site {
714+ id
715+ name
716+ }
717+ project {
718+ id
719+ name
720+ }
721+ configure {
722+ id
723+ }
724+ }
725+ prevBuild : build (id : $prevId ) @include (if : $hasPrev ) {
726+ id
727+ configureErrorsCount
728+ configureWarningsCount
729+ buildErrorsCount
730+ buildWarningsCount
731+ failedTestsCount
732+ notRunTestsCount
733+ }
734+ nextBuild : build (id : $nextId ) @include (if : $hasNext ) {
735+ id
736+ configureErrorsCount
737+ configureWarningsCount
738+ buildErrorsCount
739+ buildWarningsCount
740+ failedTestsCount
741+ notRunTestsCount
742+ }
743+ }
744+ ` ,
745+ variables () {
746+ return {
747+ buildId: this .buildId ,
748+ prevId: this .previousBuildId || null ,
749+ nextId: this .nextBuildId || null ,
750+ hasPrev: !! this .previousBuildId ,
751+ hasNext: !! this .nextBuildId ,
752+ };
753+ },
754+ result ({ data }) {
755+ this .loading = false ;
756+ const build = data .buildData ;
757+
758+ this .cdash .newissueurl = this .newIssueUrl ;
759+ this .cdash .bugtracker = this .bugTracker ;
760+
761+ if (data .prevBuild ) {
762+ const prev = data .prevBuild ;
763+ this .cdash .previousbuild = {
764+ buildid: prev .id ,
765+ nconfigureerrors: Math .max (0 , prev .configureErrorsCount ),
766+ nconfigurewarnings: Math .max (0 , prev .configureWarningsCount ),
767+ nerrors: Math .max (0 , prev .buildErrorsCount ),
768+ nwarnings: Math .max (0 , prev .buildWarningsCount ),
769+ ntestfailed: Math .max (0 , prev .failedTestsCount ),
770+ ntestnotrun: Math .max (0 , prev .notRunTestsCount ),
771+ };
772+ }
773+ else {
774+ this .cdash .previousbuild = null ;
775+ }
776+
777+ if (data .nextBuild ) {
778+ const next = data .nextBuild ;
779+ this .cdash .nextbuild = {
780+ buildid: next .id ,
781+ nconfigureerrors: Math .max (0 , next .configureErrorsCount ),
782+ nconfigurewarnings: Math .max (0 , next .configureWarningsCount ),
783+ nerrors: Math .max (0 , next .buildErrorsCount ),
784+ nwarnings: Math .max (0 , next .buildWarningsCount ),
785+ ntestfailed: Math .max (0 , next .failedTestsCount ),
786+ ntestnotrun: Math .max (0 , next .notRunTestsCount ),
787+ };
788+ }
789+ else {
790+ this .cdash .nextbuild = null ;
791+ }
792+
793+ this .cdash .hasconfigure = !! build .configure ;
794+
795+ this .cdash .build = {
796+ id: build .id ,
797+ nerrors: Math .max (0 , build .buildErrorsCount ),
798+ nwarnings: Math .max (0 , build .buildWarningsCount ),
799+ name: build .name ,
800+ type: build .buildType ,
801+ starttime: build .startTime ,
802+ sitename_encoded: encodeURIComponent (build .site .name ),
803+ };
804+
805+ this .cdash .configure = {
806+ nerrors: Math .max (0 , build .configureErrorsCount ),
807+ nwarnings: Math .max (0 , build .configureWarningsCount ),
808+ };
809+
810+ this .cdash .test = {
811+ nfailed: Math .max (0 , build .failedTestsCount ),
812+ nnotrun: Math .max (0 , build .notRunTestsCount ),
813+ };
814+
815+ this .cdash .projectname_encoded = encodeURIComponent (build .project .name );
816+ this .cdash .user = {
817+ id: this .userId ,
818+ };
819+ },
820+ error (error ) {
821+ this .errored = true ;
822+ this .cdash .error = error;
823+ this .loading = false ;
824+ },
825+ },
783826 comments: {
784827 query: gql `
785828 query ($buildId : ID ) {
@@ -827,9 +870,6 @@ export default {
827870 // Ensure jQuery is globally available before loading plugins
828871 window .jQuery = $;
829872 await import (' flot/dist/es5/jquery.flot' );
830-
831- const endpoint_path = ` /api/v1/buildSummary.php?buildid=${ this .buildId } ` ;
832- ApiLoader .loadPageData (this , endpoint_path);
833873 },
834874
835875 methods: {
@@ -852,19 +892,19 @@ export default {
852892 const t = build[' timestamp' ];
853893
854894 this .cdash .buildtimes .push ([t, build[' time' ] / 60 ]);
855- this .cdash .builderrors .push ([t, build[' builderrors' ]]);
856- this .cdash .buildwarnings .push ([t, build[' buildwarnings' ]]);
857- this .cdash .testfailed .push ([t, build[' testfailed' ]]);
895+ this .cdash .builderrors .push ([t, Math . max ( 0 , build[' builderrors' ]) ]);
896+ this .cdash .buildwarnings .push ([t, Math . max ( 0 , build[' buildwarnings' ]) ]);
897+ this .cdash .testfailed .push ([t, Math . max ( 0 , build[' testfailed' ]) ]);
858898 this .cdash .buildids [t] = build[' id' ];
859899
860900 const history_build = [];
861901 history_build[' id' ] = build[' id' ];
862- history_build[' nfiles' ] = build[' nfiles' ];
863- history_build[' configureerrors' ] = build[' configureerrors' ];
864- history_build[' configurewarnings' ] = build[' configurewarnings' ];
865- history_build[' builderrors' ] = build[' builderrors' ];
866- history_build[' buildwarnings' ] = build[' buildwarnings' ];
867- history_build[' testfailed' ] = build[' testfailed' ];
902+ history_build[' nfiles' ] = Math . max ( 0 , build[' nfiles' ]) ;
903+ history_build[' configureerrors' ] = Math . max ( 0 , build[' configureerrors' ]) ;
904+ history_build[' configurewarnings' ] = Math . max ( 0 , build[' configurewarnings' ]) ;
905+ history_build[' builderrors' ] = Math . max ( 0 , build[' builderrors' ]) ;
906+ history_build[' buildwarnings' ] = Math . max ( 0 , build[' buildwarnings' ]) ;
907+ history_build[' testfailed' ] = Math . max ( 0 , build[' testfailed' ]) ;
868908 history_build[' starttime' ] = build[' starttime' ];
869909 this .cdash .buildhistory .push (history_build);
870910 }
0 commit comments