Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.

Commit 4867a88

Browse files
adr-motuntoja
andauthored
fix(resource): duplicated lines displayed on resource status (#12055)
* chore(hotfix): update version to 22.10.1 * fix(resource): possible duplicated lines on resource status * fix unit tests * fix tests * centreon-bot you are annoying * update jenkinsfile Co-authored-by: tuntoja <[email protected]>
1 parent 2c0ac1a commit 4867a88

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed

Jenkinsfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@ def devBranch = "develop"
1010
env.REF_BRANCH = stableBranch
1111
env.PROJECT='centreon-web'
1212

13-
14-
15-
1613
if (env.BRANCH_NAME.startsWith('release-22.10.0-next')) {
1714
env.BUILD = 'QA'
1815
env.REPO = 'unstable'
1916
env.DELIVERY_STAGE = 'Delivery to unstable'
20-
} else if (env.BRANCH_NAME.startsWith('release-')) {
17+
} else if (env.BRANCH_NAME.startsWith('hotfix-') || env.BRANCH_NAME.startsWith('release-')) {
2118
env.BUILD = 'RELEASE'
2219
env.REPO = 'testing'
2320
env.DELIVERY_STAGE = 'Delivery to testing'

src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function generateFindResourcesRequest(
127127
): string {
128128
$this->sqlRequestTranslator->setConcordanceArray($this->resourceConcordances);
129129

130-
$request = "SELECT SQL_CALC_FOUND_ROWS DISTINCT
130+
$request = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT
131131
resources.resource_id,
132132
resources.name,
133133
resources.alias,
@@ -171,7 +171,8 @@ private function generateFindResourcesRequest(
171171
FROM `:dbstg`.`resources`
172172
LEFT JOIN `:dbstg`.`resources` parent_resource
173173
ON parent_resource.id = resources.parent_id
174-
LEFT JOIN `:dbstg`.`severities`
174+
AND parent_resource.type = ' . self::RESOURCE_TYPE_HOST .
175+
" LEFT JOIN `:dbstg`.`severities`
175176
ON `severities`.severity_id = `resources`.severity_id
176177
LEFT JOIN `:dbstg`.`resources_tags` AS rtags
177178
ON `rtags`.resource_id = `resources`.resource_id

tests/php/Core/Resources/Infrastructure/Repository/DbReadResourceRepositoryTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,13 @@ function generateExpectedSQLQuery(string $accessGroupRequest): string
110110
FROM `centreon-monitoring`.`resources`
111111
LEFT JOIN `centreon-monitoring`.`resources` parent_resource
112112
ON parent_resource.id = resources.parent_id
113-
LEFT JOIN `centreon-monitoring`.`severities`
113+
AND parent_resource.type = 1' .
114+
" LEFT JOIN `centreon-monitoring`.`severities`
114115
ON `severities`.severity_id = `resources`.severity_id
115116
LEFT JOIN `centreon-monitoring`.`resources_tags` AS rtags
116117
ON `rtags`.resource_id = `resources`.resource_id
117118
INNER JOIN `centreon-monitoring`.`instances`
118-
ON `instances`.instance_id = `resources`.poller_id WHERE ' .
119+
ON `instances`.instance_id = `resources`.poller_id WHERE " .
119120
" resources.name NOT LIKE '\_Module\_%'
120121
AND resources.parent_name NOT LIKE '\_Module\_BAM%'
121122
AND resources.enabled = 1 AND resources.type != 3 " .

www/install/insertBaseConf.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- Insert version
33
--
44

5-
INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '22.10.0');
5+
INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '22.10.1');
66

77
--
88
-- Contenu de la table `contact`

www/install/php/Update-22.10.1.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/*
4+
* Copyright 2005 - 2022 Centreon (https://www.centreon.com/)
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* For more information : [email protected]
19+
*
20+
*/

0 commit comments

Comments
 (0)