Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions app/Http/Controllers/BuildController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use CDash\Model\BuildGroupRule;
use CDash\Model\BuildRelationship;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
Expand Down Expand Up @@ -534,93 +533,6 @@ public function apiBuildSummary(): JsonResponse
return response()->json(cast_data_for_JSON($response));
}

/**
* TODO: (williamjallen) this function contains legacy XSL templating and should be converted
* to a proper Blade template with Laravel-based DB queries eventually. This contents
* this function are originally from buildOverview.php and have been copied (almost) as-is.
*/
public function buildOverview(): View|RedirectResponse
{
$this->setProjectByName(htmlspecialchars($_GET['project'] ?? ''));

$date = htmlspecialchars($_GET['date'] ?? '');

// We select the builds
$currentstarttime = get_dates($date, $this->project->NightlyTime)[1];

// Return the available groups
$selected_group = (int) ($_POST['groupSelection'] ?? 0);

// Check the builds
$beginning_timestamp = $currentstarttime;
$end_timestamp = $currentstarttime + 3600 * 24;

$beginning_UTCDate = gmdate(FMT_DATETIME, $beginning_timestamp);
$end_UTCDate = gmdate(FMT_DATETIME, $end_timestamp);

$groupSelectionSQL = '';
$params = [];
if ($selected_group > 0) {
$groupSelectionSQL = ' AND b2g.groupid=? ';
$params[] = $selected_group;
}

$builds = DB::select("
SELECT
s.name AS sitename,
b.name AS buildname,
be.type,
be.sourcefile,
be.sourceline,
be.stderror as text
FROM
build AS b,
builderror as be,
site AS s,
build2group AS b2g
WHERE
b.starttime<?
AND b.starttime>?
AND b.projectid=?
AND be.buildid=b.id
AND s.id=b.siteid
AND b2g.buildid=b.id
$groupSelectionSQL
ORDER BY
be.sourcefile ASC,
be.type ASC,
be.sourceline ASC
", array_merge([$end_UTCDate, $beginning_UTCDate, $this->project->Id], $params));

$sourcefiles = [];

// NOTE: Query results are already ordered by sourcefile...
foreach ($builds as $build_array) {
$filename = $build_array->sourcefile;

if (!isset($sourcefiles[$filename])) {
$sourcefiles[$filename] = [
'name' => $filename,
'errors' => [],
'warnings' => [],
];
}

$type = (int) $build_array->type === 0 ? 'errors' : 'warnings';
$sourcefiles[$filename][$type][] = [
'line' => (int) $build_array->sourceline,
'sitename' => $build_array->sitename,
'buildname' => $build_array->buildname,
'text' => $build_array->text,
];
}

return $this->view('build.overview', 'Build Overview')
->with('selected_group', $selected_group)
->with('sourcefiles', $sourcefiles)
->with('startdate', date('l, F d Y H:i:s', $currentstarttime));
}

public function viewUpdatePageContent(): JsonResponse
{
$pageTimer = new PageTimer();
Expand Down
5 changes: 1 addition & 4 deletions app/cdash/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,8 @@ set_tests_properties(buildconfigure PROPERTIES DEPENDS aggregatecoverage)
add_php_test(buildgrouprule)
set_tests_properties(buildgrouprule PROPERTIES DEPENDS buildconfigure)

add_php_test(buildoverview)
set_tests_properties(buildoverview PROPERTIES DEPENDS buildgrouprule)

add_php_test(committerinfo)
set_tests_properties(committerinfo PROPERTIES DEPENDS buildoverview)
set_tests_properties(committerinfo PROPERTIES DEPENDS buildgrouprule)

add_php_test(displayimage)
set_tests_properties(displayimage PROPERTIES DEPENDS committerinfo)
Expand Down
31 changes: 0 additions & 31 deletions app/cdash/tests/test_buildoverview.php

This file was deleted.

32 changes: 1 addition & 31 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ parameters:
-
rawMessage: Cannot cast mixed to int.
identifier: cast.int
count: 11
count: 10
path: app/Http/Controllers/BuildController.php

-
Expand Down Expand Up @@ -756,12 +756,6 @@ parameters:
count: 1
path: app/Http/Controllers/BuildController.php

-
rawMessage: 'Method App\Http\Controllers\BuildController::buildOverview() never returns Illuminate\Http\RedirectResponse so it can be removed from the return type.'
identifier: return.unusedType
count: 1
path: app/Http/Controllers/BuildController.php

-
rawMessage: 'Only numeric types are allowed in *, (int|false) given on the left side.'
identifier: mul.leftNonNumeric
Expand Down Expand Up @@ -816,12 +810,6 @@ parameters:
count: 4
path: app/Http/Controllers/BuildController.php

-
rawMessage: 'Parameter #1 $string of function htmlspecialchars expects string, mixed given.'
identifier: argument.type
count: 2
path: app/Http/Controllers/BuildController.php

-
rawMessage: 'Parameter #1 $value of function count expects array|Countable, array|false given.'
identifier: argument.type
Expand All @@ -834,12 +822,6 @@ parameters:
count: 11
path: app/Http/Controllers/BuildController.php

-
rawMessage: 'Parameter #2 $timestamp of function gmdate expects int|null, (float|int) given.'
identifier: argument.type
count: 1
path: app/Http/Controllers/BuildController.php

-
rawMessage: 'Parameter #3 $length of function substr expects int|null, int|false given.'
identifier: argument.type
Expand Down Expand Up @@ -18372,18 +18354,6 @@ parameters:
count: 1
path: app/cdash/tests/test_buildmodel.php

-
rawMessage: 'Call to deprecated method pass() of class SimpleTestCase.'
identifier: method.deprecated
count: 1
path: app/cdash/tests/test_buildoverview.php

-
rawMessage: 'Method BuildOverviewTestCase::testBuildOverview() has no return type specified.'
identifier: missingType.return
count: 1
path: app/cdash/tests/test_buildoverview.php

-
rawMessage: '''
Call to deprecated function pdo_execute():
Expand Down
54 changes: 0 additions & 54 deletions resources/views/build/overview.blade.php

This file was deleted.

2 changes: 0 additions & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@

Route::get('/testOverview.php', 'TestController@testOverview');

Route::match(['get', 'post'], '/buildOverview.php', 'BuildController@buildOverview');

Route::get('/viewBuildGroup.php', 'BuildController@viewBuildGroup');

Route::get('/viewSubProjects.php', 'SubProjectController@viewSubProjects');
Expand Down