From c69d0894124b55ebd0712045c9e6df2f4657b097 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 5 May 2026 10:57:49 +0200 Subject: [PATCH 1/5] fix(sc-event): replay status-change events after a downtime ends --- .../canopsis/canopsis2x-events-apiv2.lua | 3 + .../datadog/datadog-events-apiv2.lua | 3 + .../elasticsearch/elastic-events-apiv2.lua | 3 + .../google/bigquery-events-apiv2.lua | 3 + .../kafka/kafka-events-apiv2.lua | 3 + centreon-certified/keep/keep-events-apiv2.lua | 3 + .../logstash/logstash-events-apiv2.lua | 3 + centreon-certified/omi/omi_events-apiv2.lua | 3 + .../opsgenie/opsgenie-events-apiv2.lua | 3 + .../pagerduty/pagerduty-events-apiv2.lua | 3 + .../servicenow/servicenow-em-events-apiv2.lua | 3 + .../servicenow-incident-events-apiv2.lua | 3 + .../signl4/signl4-events-apiv2.lua | 3 + .../splunk/splunk-events-apiv2.lua | 3 + .../sc_event.lua | 102 +++++++++++++++--- .../sc_storage.lua | 4 +- 16 files changed, 134 insertions(+), 14 deletions(-) diff --git a/centreon-certified/canopsis/canopsis2x-events-apiv2.lua b/centreon-certified/canopsis/canopsis2x-events-apiv2.lua index cbefe05f..5203d6b4 100644 --- a/centreon-certified/canopsis/canopsis2x-events-apiv2.lua +++ b/centreon-certified/canopsis/canopsis2x-events-apiv2.lua @@ -631,6 +631,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/datadog/datadog-events-apiv2.lua b/centreon-certified/datadog/datadog-events-apiv2.lua index c4b524a0..7254be4a 100644 --- a/centreon-certified/datadog/datadog-events-apiv2.lua +++ b/centreon-certified/datadog/datadog-events-apiv2.lua @@ -297,6 +297,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/elasticsearch/elastic-events-apiv2.lua b/centreon-certified/elasticsearch/elastic-events-apiv2.lua index 2480e01f..1977272e 100644 --- a/centreon-certified/elasticsearch/elastic-events-apiv2.lua +++ b/centreon-certified/elasticsearch/elastic-events-apiv2.lua @@ -286,6 +286,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/google/bigquery-events-apiv2.lua b/centreon-certified/google/bigquery-events-apiv2.lua index 3acbe1a9..7d50b315 100644 --- a/centreon-certified/google/bigquery-events-apiv2.lua +++ b/centreon-certified/google/bigquery-events-apiv2.lua @@ -384,6 +384,9 @@ local queue function init(params) queue = EventQueue.new(params) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end function write(event) diff --git a/centreon-certified/kafka/kafka-events-apiv2.lua b/centreon-certified/kafka/kafka-events-apiv2.lua index b1b790dd..168a6b80 100644 --- a/centreon-certified/kafka/kafka-events-apiv2.lua +++ b/centreon-certified/kafka/kafka-events-apiv2.lua @@ -243,6 +243,9 @@ local queue function init(params) queue = EventQueue.new(params) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/keep/keep-events-apiv2.lua b/centreon-certified/keep/keep-events-apiv2.lua index 49f4e37e..c28198c7 100644 --- a/centreon-certified/keep/keep-events-apiv2.lua +++ b/centreon-certified/keep/keep-events-apiv2.lua @@ -471,6 +471,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/logstash/logstash-events-apiv2.lua b/centreon-certified/logstash/logstash-events-apiv2.lua index 508aff68..55f63086 100644 --- a/centreon-certified/logstash/logstash-events-apiv2.lua +++ b/centreon-certified/logstash/logstash-events-apiv2.lua @@ -283,6 +283,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -------------------------------------------------------------------------------- diff --git a/centreon-certified/omi/omi_events-apiv2.lua b/centreon-certified/omi/omi_events-apiv2.lua index 996df4a1..96a35fe9 100644 --- a/centreon-certified/omi/omi_events-apiv2.lua +++ b/centreon-certified/omi/omi_events-apiv2.lua @@ -312,6 +312,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- Fonction write() diff --git a/centreon-certified/opsgenie/opsgenie-events-apiv2.lua b/centreon-certified/opsgenie/opsgenie-events-apiv2.lua index cfe3c1ea..a51537d2 100644 --- a/centreon-certified/opsgenie/opsgenie-events-apiv2.lua +++ b/centreon-certified/opsgenie/opsgenie-events-apiv2.lua @@ -424,6 +424,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/pagerduty/pagerduty-events-apiv2.lua b/centreon-certified/pagerduty/pagerduty-events-apiv2.lua index 0009db9b..0c5af935 100644 --- a/centreon-certified/pagerduty/pagerduty-events-apiv2.lua +++ b/centreon-certified/pagerduty/pagerduty-events-apiv2.lua @@ -419,6 +419,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/servicenow/servicenow-em-events-apiv2.lua b/centreon-certified/servicenow/servicenow-em-events-apiv2.lua index fc52538f..d83bf3d0 100644 --- a/centreon-certified/servicenow/servicenow-em-events-apiv2.lua +++ b/centreon-certified/servicenow/servicenow-em-events-apiv2.lua @@ -375,6 +375,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -------------------------------------------------------------------------------- diff --git a/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua b/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua index 634d6db8..b7e376b7 100644 --- a/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua +++ b/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua @@ -384,6 +384,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -------------------------------------------------------------------------------- diff --git a/centreon-certified/signl4/signl4-events-apiv2.lua b/centreon-certified/signl4/signl4-events-apiv2.lua index 7c0d52aa..44cc6351 100644 --- a/centreon-certified/signl4/signl4-events-apiv2.lua +++ b/centreon-certified/signl4/signl4-events-apiv2.lua @@ -282,6 +282,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -- -------------------------------------------------------------------------------- diff --git a/centreon-certified/splunk/splunk-events-apiv2.lua b/centreon-certified/splunk/splunk-events-apiv2.lua index ea3fe2c9..4cac6745 100644 --- a/centreon-certified/splunk/splunk-events-apiv2.lua +++ b/centreon-certified/splunk/splunk-events-apiv2.lua @@ -280,6 +280,9 @@ local queue -- Fonction init() function init(conf) queue = EventQueue.new(conf) + sc_event.set_pending_event_handler(function(pending_broker_event) + write(pending_broker_event) + end) end -------------------------------------------------------------------------------- diff --git a/modules/centreon-stream-connectors-lib/sc_event.lua b/modules/centreon-stream-connectors-lib/sc_event.lua index 48ccee2f..ade6ae70 100644 --- a/modules/centreon-stream-connectors-lib/sc_event.lua +++ b/modules/centreon-stream-connectors-lib/sc_event.lua @@ -14,6 +14,15 @@ local sc_broker = require("centreon-stream-connectors-lib.sc_broker") local sc_storage = require("centreon-stream-connectors-lib.sc_storage") local ScEvent = {} +local pending_event_handler = nil + +--- sc_event.set_pending_event_handler: register a callback called by the library when a stored event +-- (saved during a downtime) is ready to be sent because the downtime ended with a status change. +-- The callback receives an already-validated sc_event object. +-- @param handler (function) function(sc_event_obj) called for each valid pending event +function sc_event.set_pending_event_handler(handler) + pending_event_handler = handler +end function sc_event.new(broker_event, params, common, logger, broker, storage) local self = {} @@ -42,10 +51,10 @@ function sc_event.new(broker_event, params, common, logger, broker, storage) self.validation_steps = {} for accepted_element, info in pairs(self.params.accepted_elements_info) do - if not self.validation_steps[info.category_id] then + if not self.validation_steps[info.category_id] then self.validation_steps[info.category_id] = {} end - + self.validation_steps[info.category_id][info.element_id] = {} end @@ -55,7 +64,7 @@ end --- is_valid_category: check if the event is in an accepted category --- @retun true|false (boolean) +-- @return true|false (boolean) function ScEvent:is_valid_category() return self:find_in_mapping(self.params.category_mapping, self.params.accepted_categories, self.event.category) end @@ -63,7 +72,59 @@ end --- is_valid_element: check if the event is an accepted element -- @return true|false (boolean) function ScEvent:is_valid_element() - return self:find_in_mapping(self.params.element_mapping[self.event.category], self.params.accepted_elements, self.event.element) + local is_valid_element = false + is_valid_element = self:find_in_mapping(self.params.element_mapping[self.event.category], self.params.accepted_elements, self.event.element) + if self.event.element == self.params.bbdo.elements.downtime.id and self.params.in_downtime == 0 then + if not self.downtimes_storage then + self.downtimes_storage = sc_storage.new(self.sc_common, self.sc_logger, self.params) + end + local object_id + if self.event.type == 1 then + object_id = 'downtime_service_' .. self.event.host_id .. '_' .. self.event.service_id + elseif self.event.type == 2 then + object_id = 'downtime_host_' .. self.event.host_id + else + self.sc_logger:error("[sc_event:is_valid_element]: unknown downtime type: " .. tostring(self.event.type)) + return is_valid_element + end + if self:is_valid_downtime_event_start() then + local status = -1 + if self.event.type == 1 then + status = broker_cache:get_service(self.event.host_id, self.event.service_id).state + elseif self.event.type == 2 then + status = broker_cache:get_host(self.event.host_id).state + end + local storage_data = { + object_type = self.event.type, + status = status, + downtime_start = self.event.actual_start_time, + downtime_end = self.event.actual_end_time + } + if not self.downtimes_storage:set_multiple(object_id, storage_data) then + self.sc_logger:error("[sc_event:is_valid_element]: Cannot register downtime datas in storage.") + end + elseif self:is_valid_downtime_event_end() then + local ok, stored = self.downtimes_storage:get_multiple(object_id, {"object_type", "status", "broker_event"}) + if ok then + if stored.broker_event and pending_event_handler then + -- delete broker_event from storage before sending to prevent duplicate dispatch + -- on the second downtime end event (cancellation + deletion both trigger this path) + self.downtimes_storage:delete(object_id, "broker_event") + -- broker_event is stored as a JSON string: decode it explicitly + local broker_event = broker.json_decode(stored.broker_event) + if broker_event then + broker_event.scheduled_downtime_depth = 0 + pending_event_handler(broker_event) + else + self.sc_logger:error("[sc_event:is_valid_element]: failed to decode stored broker_event") + end + end + else + self.sc_logger:error("[sc_event:is_valid_element]: Cannot get downtime datas from storage.") + end + end + end + return is_valid_element end --- find_in_mapping: check if item type is in the mapping and is accepted @@ -79,7 +140,6 @@ function ScEvent:find_in_mapping(mapping, reference, item) end end end - return false end @@ -741,9 +801,29 @@ function ScEvent:is_valid_event_downtime_state() self.event.scheduled_downtime_depth = self.event.downtime_depth end - if not self.sc_common:compare_numbers(self.params.in_downtime, self.event.scheduled_downtime_depth, ">=") then - self.sc_logger:warning("[sc_event:is_valid_event_downtime_state]: event is not in an valid downtime state. Event downtime state must be below or equal to " .. tostring(self.params.in_downtime) - .. ". Current downtime state: " .. tostring(self.sc_common:boolean_to_number(self.event.scheduled_downtime_depth))) + if self.params.in_downtime == 0 and self.event.scheduled_downtime_depth > 0 then + if not self.downtimes_storage then + self.downtimes_storage = sc_storage.new(self.sc_common, self.sc_logger, self.params) + end + local object_id + if self.event.service_id and self.event.service_id ~= 0 then + object_id = 'downtime_service_' .. self.event.host_id .. '_' .. self.event.service_id + else + object_id = 'downtime_host_' .. self.event.host_id + end + local ok, stored = self.downtimes_storage:get_multiple(object_id, {"object_type", "status"}) + if ok then + if stored.status ~= self.event.state then + -- store broker_event as explicit JSON string to avoid relying on storage backend type conversion + if not self.downtimes_storage:set(object_id, "broker_event", broker.json_encode(self.broker_event)) then + self.sc_logger:error("[sc_event:is_valid_event_downtime_state]: event hasn't been stored in storage") + end + else + self.downtimes_storage:set(object_id, "broker_event", nil) + end + end + self.sc_logger:warning("[sc_event:is_valid_event_downtime_state]: event is not in a valid downtime state. Event downtime depth must be equal to " .. tostring(self.params.in_downtime) + .. ". Current downtime depth value: " .. tostring(self.sc_common:boolean_to_number(self.event.scheduled_downtime_depth))) return false end @@ -1244,8 +1324,6 @@ function ScEvent:is_valid_service_severity() return true end - - -- return false if service severity doesn't match if not self.sc_common:compare_numbers(self.params.service_severity_threshold, self.event.cache.severity.service, self.params.service_severity_operator) then self.sc_logger:debug("[sc_event:is_valid_service_severity]: dropping event because service with id: " .. tostring(self.event.service_id) .. " has an invalid severity. Severity is: " @@ -1341,7 +1419,7 @@ function ScEvent:is_valid_acknowledgement_event() return true end ---- is_vaid_downtime_event: check if the event is a valid downtime event +--- is_valid_downtime_event: check if the event is a valid downtime event -- return true|false (boolean) function ScEvent:is_valid_downtime_event() -- return false if the event is one of all the "fake" start or end downtime event received from broker @@ -1613,12 +1691,10 @@ function ScEvent:is_downtime_event_useless() if self:is_valid_downtime_event_start() then return true end - -- return false if downtime event is not a valid end of downtime event if self:is_valid_downtime_event_end() then return true end - return false end diff --git a/modules/centreon-stream-connectors-lib/sc_storage.lua b/modules/centreon-stream-connectors-lib/sc_storage.lua index 4552c39c..5caad58c 100644 --- a/modules/centreon-stream-connectors-lib/sc_storage.lua +++ b/modules/centreon-stream-connectors-lib/sc_storage.lua @@ -24,7 +24,9 @@ function sc_storage.new(common, logger, params) "host_%d+", "service_%d+_%d+", "ba_%d+", - "metric_.*" + "metric_.*", + "downtime_host_%d+", + "downtime_service_%d+_%d+" } -- make sure we are able to load the desired storage backend. If not, fall back to the one provided by broker From 40929d5fa47cd8f1a95dd6c27c17b16cf7fd5d4b Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Fri, 17 Jul 2026 16:06:07 +0200 Subject: [PATCH 2/5] fix after review --- .../sc_event.lua | 18 ++++++------------ .../sc_storage.lua | 6 +++--- .../centreon-stream-connectors-lib.yaml | 10 ++++++---- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/modules/centreon-stream-connectors-lib/sc_event.lua b/modules/centreon-stream-connectors-lib/sc_event.lua index ade6ae70..bf0b7b35 100644 --- a/modules/centreon-stream-connectors-lib/sc_event.lua +++ b/modules/centreon-stream-connectors-lib/sc_event.lua @@ -75,9 +75,6 @@ function ScEvent:is_valid_element() local is_valid_element = false is_valid_element = self:find_in_mapping(self.params.element_mapping[self.event.category], self.params.accepted_elements, self.event.element) if self.event.element == self.params.bbdo.elements.downtime.id and self.params.in_downtime == 0 then - if not self.downtimes_storage then - self.downtimes_storage = sc_storage.new(self.sc_common, self.sc_logger, self.params) - end local object_id if self.event.type == 1 then object_id = 'downtime_service_' .. self.event.host_id .. '_' .. self.event.service_id @@ -100,16 +97,16 @@ function ScEvent:is_valid_element() downtime_start = self.event.actual_start_time, downtime_end = self.event.actual_end_time } - if not self.downtimes_storage:set_multiple(object_id, storage_data) then + if not self.sc_storage:set_multiple(object_id, storage_data) then self.sc_logger:error("[sc_event:is_valid_element]: Cannot register downtime datas in storage.") end elseif self:is_valid_downtime_event_end() then - local ok, stored = self.downtimes_storage:get_multiple(object_id, {"object_type", "status", "broker_event"}) + local ok, stored = self.sc_storage:get_multiple(object_id, {"object_type", "status", "broker_event"}) if ok then if stored.broker_event and pending_event_handler then -- delete broker_event from storage before sending to prevent duplicate dispatch -- on the second downtime end event (cancellation + deletion both trigger this path) - self.downtimes_storage:delete(object_id, "broker_event") + self.sc_storage:delete(object_id, "broker_event") -- broker_event is stored as a JSON string: decode it explicitly local broker_event = broker.json_decode(stored.broker_event) if broker_event then @@ -802,24 +799,21 @@ function ScEvent:is_valid_event_downtime_state() end if self.params.in_downtime == 0 and self.event.scheduled_downtime_depth > 0 then - if not self.downtimes_storage then - self.downtimes_storage = sc_storage.new(self.sc_common, self.sc_logger, self.params) - end local object_id if self.event.service_id and self.event.service_id ~= 0 then object_id = 'downtime_service_' .. self.event.host_id .. '_' .. self.event.service_id else object_id = 'downtime_host_' .. self.event.host_id end - local ok, stored = self.downtimes_storage:get_multiple(object_id, {"object_type", "status"}) + local ok, stored = self.sc_storage:get_multiple(object_id, {"object_type", "status"}) if ok then if stored.status ~= self.event.state then -- store broker_event as explicit JSON string to avoid relying on storage backend type conversion - if not self.downtimes_storage:set(object_id, "broker_event", broker.json_encode(self.broker_event)) then + if not self.sc_storage:set(object_id, "broker_event", broker.json_encode(self.broker_event)) then self.sc_logger:error("[sc_event:is_valid_event_downtime_state]: event hasn't been stored in storage") end else - self.downtimes_storage:set(object_id, "broker_event", nil) + self.sc_storage:set(object_id, "broker_event", nil) end end self.sc_logger:warning("[sc_event:is_valid_event_downtime_state]: event is not in a valid downtime state. Event downtime depth must be equal to " .. tostring(self.params.in_downtime) diff --git a/modules/centreon-stream-connectors-lib/sc_storage.lua b/modules/centreon-stream-connectors-lib/sc_storage.lua index 5caad58c..f0a3fa9f 100644 --- a/modules/centreon-stream-connectors-lib/sc_storage.lua +++ b/modules/centreon-stream-connectors-lib/sc_storage.lua @@ -29,15 +29,15 @@ function sc_storage.new(common, logger, params) "downtime_service_%d+_%d+" } - -- make sure we are able to load the desired storage backend. If not, fall back to the one provided by broker + -- make sure we are able to load the desired storage backend. If not, fall back to the one provided by sqlite if pcall(require, "centreon-stream-connectors-lib.storage_backends.sc_storage_" .. params.storage_backend) then local storage_backend = require("centreon-stream-connectors-lib.storage_backends.sc_storage_" .. params.storage_backend) self.storage_backend = storage_backend.new(self.sc_common, logger, params) else self.sc_logger:error("[sc_storage:new]: Couldn't load storage backend: " .. tostring(params.storage_backend) .. ". Make sure that the file sc_storage_" .. tostring(params.storage_backend) .. ".lua exists on your server." - .. " The stream connector is going to use the broker storage backend.") - self.storage_backend = require("centreon-stream-connectors-lib.storage_backends.sc_storage_broker") + .. " The stream connector is going to use the sqlite storage backend.") + self.storage_backend = require("centreon-stream-connectors-lib.storage_backends.sc_storage_sqlite") end setmetatable(self, { __index = ScStorage}) diff --git a/packaging/connectors-lib/centreon-stream-connectors-lib.yaml b/packaging/connectors-lib/centreon-stream-connectors-lib.yaml index e3492391..6bb5dd8f 100644 --- a/packaging/connectors-lib/centreon-stream-connectors-lib.yaml +++ b/packaging/connectors-lib/centreon-stream-connectors-lib.yaml @@ -26,16 +26,18 @@ contents: overrides: rpm: depends: - - lua-socket >= 3.0 - centreon-broker-core >= 24.04.0 - - lua-curl >= 0.3.13-10 - lua + - lua-curl >= 0.3.13-10 + - lua-lsqlite3 >= 0.9.7 + - lua-socket >= 3.0 deb: depends: - "centreon-broker-core (>= 24.04.0)" - - "lua-socket (>= 3.0~)" - - "lua-curl (>= 0.3.13-10)" - "lua@luaver@" + - "lua-curl (>= 0.3.13-10)" + - "lua-lsqlite3 (>= 0.9.7)" + - "lua-socket (>= 3.0~)" rpm: summary: Centreon stream connectors lua modules From a4a2234c884af029466e0f500b74916b8cecde27 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Mon, 20 Jul 2026 10:04:16 +0200 Subject: [PATCH 3/5] fix repos --- .github/actions/test-packages/action.yml | 31 +++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-packages/action.yml b/.github/actions/test-packages/action.yml index 5e3b4dc9..729cd0ac 100644 --- a/.github/actions/test-packages/action.yml +++ b/.github/actions/test-packages/action.yml @@ -166,11 +166,16 @@ runs: # Select the correct repo and version depending on distrib # Format <= 24.10: https://packages.centreon.com/{repo}-{stability}/ {distrib} main # Format >= 25.10: https://packages.centreon.com/{repo}/ {distrib}-{version}-{stability} main + use_standard_stable=true + use_standard_testing=true + use_standard_unstable=true if [[ "$DISTRIB" == "jammy" ]]; then standard_base="ubuntu-standard-24.04" standard_distrib="$DISTRIB" plugins_prefix="ubuntu-plugins" new_repo_format=false + use_standard_testing=false + use_standard_unstable=false elif [[ "$DISTRIB" == "noble" ]]; then standard_base="ubuntu-standard-24.10" standard_distrib="$DISTRIB" @@ -181,6 +186,8 @@ runs: standard_distrib="$DISTRIB" plugins_prefix="apt-plugins" new_repo_format=false + use_standard_testing=false + use_standard_unstable=false elif [[ "$DISTRIB" == "bookworm" ]]; then standard_base="apt-standard" standard_distrib="${DISTRIB}-25.10" @@ -195,13 +202,25 @@ runs: # Add Centreon standard repository (provides centreon-broker-core and other core packages) if [[ "$TEST_TYPE" != "dependency" ]]; then if [[ "$new_repo_format" == "true" ]]; then - echo "deb https://packages.centreon.com/${standard_base}/ ${standard_distrib}-stable main" | tee /etc/apt/sources.list.d/centreon-standard.list - echo "deb https://packages.centreon.com/${standard_base}/ ${standard_distrib}-testing main" | tee -a /etc/apt/sources.list.d/centreon-standard.list - echo "deb https://packages.centreon.com/${standard_base}/ ${standard_distrib}-unstable main" | tee -a /etc/apt/sources.list.d/centreon-standard.list + if [[ "$use_standard_stable" == "true" ]]; then + echo "deb https://packages.centreon.com/${standard_base}/ ${standard_distrib}-stable main" | tee /etc/apt/sources.list.d/centreon-standard.list + fi + if [[ "$use_standard_testing" == "true" ]]; then + echo "deb https://packages.centreon.com/${standard_base}/ ${standard_distrib}-testing main" | tee -a /etc/apt/sources.list.d/centreon-standard.list + fi + if [[ "$use_standard_unstable" == "true" ]]; then + echo "deb https://packages.centreon.com/${standard_base}/ ${standard_distrib}-unstable main" | tee -a /etc/apt/sources.list.d/centreon-standard.list + fi else - echo "deb https://packages.centreon.com/${standard_base}-stable/ ${standard_distrib} main" | tee /etc/apt/sources.list.d/centreon-standard.list - echo "deb https://packages.centreon.com/${standard_base}-testing/ ${standard_distrib} main" | tee -a /etc/apt/sources.list.d/centreon-standard.list - echo "deb https://packages.centreon.com/${standard_base}-unstable/ ${standard_distrib} main" | tee -a /etc/apt/sources.list.d/centreon-standard.list + if [[ "$use_standard_stable" == "true" ]]; then + echo "deb https://packages.centreon.com/${standard_base}-stable/ ${standard_distrib} main" | tee /etc/apt/sources.list.d/centreon-standard.list + fi + if [[ "$use_standard_testing" == "true" ]]; then + echo "deb https://packages.centreon.com/${standard_base}-testing/ ${standard_distrib} main" | tee -a /etc/apt/sources.list.d/centreon-standard.list + fi + if [[ "$use_standard_unstable" == "true" ]]; then + echo "deb https://packages.centreon.com/${standard_base}-unstable/ ${standard_distrib} main" | tee -a /etc/apt/sources.list.d/centreon-standard.list + fi fi fi # Add Centreon plugins repositories (stable, testing, unstable) From 277d628d602793973f6e2b3b3a0300ba1fa38c97 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Mon, 20 Jul 2026 12:09:03 +0200 Subject: [PATCH 4/5] fix version --- .github/actions/test-packages/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-packages/action.yml b/.github/actions/test-packages/action.yml index 729cd0ac..9abdf0d1 100644 --- a/.github/actions/test-packages/action.yml +++ b/.github/actions/test-packages/action.yml @@ -170,7 +170,7 @@ runs: use_standard_testing=true use_standard_unstable=true if [[ "$DISTRIB" == "jammy" ]]; then - standard_base="ubuntu-standard-24.04" + standard_base="ubuntu-standard-24.10" standard_distrib="$DISTRIB" plugins_prefix="ubuntu-plugins" new_repo_format=false From 06156b3da9572713b25eb501c90b14c22fe7b83d Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Mon, 20 Jul 2026 15:08:52 +0200 Subject: [PATCH 5/5] fix ubuntu --- .github/actions/test-packages/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/test-packages/action.yml b/.github/actions/test-packages/action.yml index 9abdf0d1..10ca4bab 100644 --- a/.github/actions/test-packages/action.yml +++ b/.github/actions/test-packages/action.yml @@ -174,8 +174,6 @@ runs: standard_distrib="$DISTRIB" plugins_prefix="ubuntu-plugins" new_repo_format=false - use_standard_testing=false - use_standard_unstable=false elif [[ "$DISTRIB" == "noble" ]]; then standard_base="ubuntu-standard-24.10" standard_distrib="$DISTRIB"