Skip to content

Commit 240f649

Browse files
Remove label filter propagation (#3724)
CDash currently supports the ability to propagate label filters from the index page to viewTest.php. This functionality is fundamentally broken in all but the most simple case, since extracting only the label filters is not logically equivalent to the full original filters. This PR removes the feature entirely. In the future, there's an opportunity to add something which fills roughly the same niche: allowing users to select a subset of subprojects to display, which can be propagated to other pages automatically.
1 parent 48c6bc1 commit 240f649

17 files changed

Lines changed: 27 additions & 94 deletions

File tree

app/Models/Project.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
* @property int $uploadquota Maximum sum of uploaded file sizes (in bytes)
4343
* @property int $uploadquotagb Maximum sum of uploaded file sizes (in GiB)
4444
* @property bool $showcoveragecode
45-
* @property bool $sharelabelfilters
4645
* @property bool $authenticatesubmissions
4746
* @property ?string $ldapfilter
4847
* @property ?string $banner
@@ -90,7 +89,6 @@ class Project extends Model
9089
'uploadquota',
9190
'uploadquotagb',
9291
'showcoveragecode',
93-
'sharelabelfilters',
9492
'authenticatesubmissions',
9593
'ldapfilter',
9694
'banner',
@@ -109,7 +107,6 @@ class Project extends Model
109107
'displaylabels' => 'boolean',
110108
'coveragethreshold' => 'integer',
111109
'showcoveragecode' => 'boolean',
112-
'sharelabelfilters' => 'boolean',
113110
'authenticatesubmissions' => 'boolean',
114111
];
115112

app/cdash/app/Controller/Api/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ public function checkForSubProjectFilters(): void
13501350
}
13511351
}
13521352
unset($filters);
1353-
if ($filter_on_labels && $this->project->ShareLabelFilters) {
1353+
if ($filter_on_labels) {
13541354
$this->shareLabelFilters = true;
13551355
$this->labelIds = get_label_ids_from_filterdata($this->filterdata);
13561356
}

app/cdash/app/Model/Project.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class Project
6969
public $EmailMaxItems = 5;
7070
public $EmailMaxChars = 255;
7171
public $DisplayLabels = 0;
72-
public $ShareLabelFilters = 0;
7372
public $AuthenticateSubmissions = 0;
7473
public $ShowCoverageCode = 0;
7574
public $AutoremoveTimeframe = 0;
@@ -126,7 +125,6 @@ public function Save(): bool
126125
'emailbrokensubmission' => filter_var($this->EmailBrokenSubmission, FILTER_VALIDATE_BOOLEAN),
127126
'emailredundantfailures' => filter_var($this->EmailRedundantFailures, FILTER_VALIDATE_BOOLEAN),
128127
'displaylabels' => filter_var($this->DisplayLabels, FILTER_VALIDATE_BOOLEAN),
129-
'sharelabelfilters' => filter_var($this->ShareLabelFilters, FILTER_VALIDATE_BOOLEAN),
130128
'authenticatesubmissions' => filter_var($this->AuthenticateSubmissions, FILTER_VALIDATE_BOOLEAN),
131129
'showcoveragecode' => filter_var($this->ShowCoverageCode, FILTER_VALIDATE_BOOLEAN),
132130
'autoremovetimeframe' => (int) $this->AutoremoveTimeframe,
@@ -206,7 +204,6 @@ public function Fill(): void
206204
$this->EmailBrokenSubmission = (int) $project->emailbrokensubmission;
207205
$this->EmailRedundantFailures = (int) $project->emailredundantfailures;
208206
$this->DisplayLabels = $project->displaylabels;
209-
$this->ShareLabelFilters = $project->sharelabelfilters;
210207
$this->AuthenticateSubmissions = $project->authenticatesubmissions;
211208
$this->ShowCoverageCode = $project->showcoveragecode;
212209
$this->AutoremoveTimeframe = $project->autoremovetimeframe;

app/cdash/public/api/v1/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@
236236
$response['filterurl'] = get_filterurl();
237237

238238
$controller->checkForSubProjectFilters();
239-
$response['sharelabelfilters'] = $controller->shareLabelFilters;
240239
$response['testfilters'] = $controller->subProjectTestFilters;
241240

242241
$build_data = $controller->getDailyBuilds();

app/cdash/tests/test_actualtrilinossubmission.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function createProjectWithName($project)
2525
'EmailBrokenSubmission' => '1',
2626
'DisplayLabels' => '1',
2727
'NightlyTime' => '21:00:00 America/New_York',
28-
'ShareLabelFilters' => '1'];
28+
];
2929
return $this->createProject($settings);
3030
}
3131

app/cdash/tests/test_filtertestlabels.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ public function testFilterLabels()
2828
return 1;
2929
}
3030

31-
// Turn this option on.
32-
pdo_query("UPDATE project SET sharelabelfilters=TRUE
33-
WHERE name='EmailProjectExample'");
34-
3531
// Get the buildid that we just created so we can delete it later.
3632
$buildids = [];
3733
$buildid_results = pdo_query(
@@ -91,10 +87,6 @@ public function testFilterLabels()
9187
// Delete the build
9288
DatabaseCleanupUtils::removeBuild($buildid);
9389

94-
// Turn the option back off.
95-
pdo_query("UPDATE project SET sharelabelfilters=FALSE
96-
WHERE name='EmailProjectExample'");
97-
9890
if (!$success) {
9991
$this->fail($error_msg);
10092
return 1;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Support\Facades\DB;
5+
6+
return new class extends Migration {
7+
public function up(): void
8+
{
9+
DB::statement('ALTER TABLE project DROP COLUMN sharelabelfilters');
10+
}
11+
12+
public function down(): void
13+
{
14+
}
15+
};

graphql/schema.graphql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ type Project {
340340
"""
341341
showCoverageCode: Boolean! @rename(attribute: "showcoveragecode")
342342

343-
"Forward label filters from index.php to queryTests.php and viewTest.php."
344-
shareLabelFilters: Boolean! @rename(attribute: "sharelabelfilters")
345-
346343
"Custom text displayed at the top of a project's dashboard."
347344
banner: String
348345

@@ -494,8 +491,6 @@ input UpdateProjectInput @validator {
494491

495492
showCoverageCode: Boolean @rename(attribute: "showcoveragecode")
496493

497-
shareLabelFilters: Boolean @rename(attribute: "sharelabelfilters")
498-
499494
banner: String
500495
}
501496

phpstan-baseline.neon

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9879,12 +9879,6 @@ parameters:
98799879
count: 1
98809880
path: app/cdash/app/Model/Project.php
98819881

9882-
-
9883-
rawMessage: Property CDash\Model\Project::$ShareLabelFilters has no type specified.
9884-
identifier: missingType.property
9885-
count: 1
9886-
path: app/cdash/app/Model/Project.php
9887-
98889882
-
98899883
rawMessage: Property CDash\Model\Project::$ShowCoverageCode has no type specified.
98909884
identifier: missingType.property
@@ -18924,7 +18918,7 @@ parameters:
1892418918
04/01/2023
1892518919
'''
1892618920
identifier: function.deprecated
18927-
count: 3
18921+
count: 1
1892818922
path: app/cdash/tests/test_filtertestlabels.php
1892918923

1893018924
-

resources/js/angular/controllers/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,6 @@ export function IndexController($scope, $rootScope, $location, $http, $filter, $
220220
$scope.pageChanged($scope.cdash.buildgroups[i]);
221221
}
222222

223-
// Check for label filters
224-
$scope.cdash.extrafilterurl = '';
225-
if ($scope.cdash.sharelabelfilters) {
226-
$scope.cdash.extrafilterurl = filters.getLabelString($scope.cdash.filterdata);
227-
$scope.cdash.querytestfilters = $scope.cdash.extrafilterurl;
228-
}
229-
230223
// Read simple/advanced view cookie setting.
231224
var advanced_cookie = $.cookie('cdash_'+$scope.cdash.projectname+'_advancedview');
232225
var show_time_columns = 0;

0 commit comments

Comments
 (0)