[pkg-nagios-changes] [Git][nagios-team/icingadb-web][experimental] 4 commits: New upstream version 1.2.1
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Fri Jun 20 14:01:44 BST 2025
Bas Couwenberg pushed to branch experimental at Debian Nagios Maintainer Group / icingadb-web
Commits:
51c7ad84 by Bas Couwenberg at 2025-06-20T14:58:12+02:00
New upstream version 1.2.1
- - - - -
376aed07 by Bas Couwenberg at 2025-06-20T14:58:17+02:00
Update upstream source from tag 'upstream/1.2.1'
Update to upstream version '1.2.1'
with Debian dir 4e43ba997cda790b7beea583b52fb348f4131a1d
- - - - -
46376c06 by Bas Couwenberg at 2025-06-20T14:58:27+02:00
New upstream release.
- - - - -
30e77ddf by Bas Couwenberg at 2025-06-20T14:59:17+02:00
Set distribution to experimental.
- - - - -
4 changed files:
- debian/changelog
- library/Icingadb/ProvidedHook/IcingaHealth.php
- library/Icingadb/Widget/Health.php
- + test/php/library/Icingadb/ProvidedHook/IcingaHealthTest.php
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+icingadb-web (1.2.1-1~exp1) experimental; urgency=medium
+
+ * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org> Fri, 20 Jun 2025 14:59:02 +0200
+
icingadb-web (1.2.0-1~exp1) experimental; urgency=medium
* New upstream release.
=====================================
library/Icingadb/ProvidedHook/IcingaHealth.php
=====================================
@@ -16,6 +16,24 @@ class IcingaHealth extends HealthHook
public const REQUIRED_ICINGADB_VERSION = '1.4.0';
+ /**
+ * normalizeVersion extracts a version string from Icinga DB's reported
+ * version comparable with REQUIRED_ICINGADB_VERSION via version_compare.
+ *
+ * @param string $version Icinga DB version string to normalize.
+ *
+ * @return string Normalized Icinga DB version string.
+ */
+ public static function normalizeVersion(string $version): string
+ {
+ // Ignore leading "v" when the git tag is used, e.g., "v1.4.0".
+ $version = ltrim($version, 'v');
+ // Ignore everything after "-" used by git describe, e.g., "1.4.0-g...".
+ $version = explode('-', $version, 2)[0];
+
+ return $version;
+ }
+
/** @var Instance */
protected $instance;
@@ -47,7 +65,11 @@ class IcingaHealth extends HealthHook
));
} elseif (
! isset($instance->icingadb_version)
- || version_compare($instance->icingadb_version, self::REQUIRED_ICINGADB_VERSION, '<')
+ || version_compare(
+ self::normalizeVersion($instance->icingadb_version),
+ self::REQUIRED_ICINGADB_VERSION,
+ '<'
+ )
) {
$this->setState(self::STATE_CRITICAL);
$this->setMessage(sprintf(
=====================================
library/Icingadb/Widget/Health.php
=====================================
@@ -26,7 +26,11 @@ class Health extends BaseHtmlElement
{
if (
! isset($this->data->icingadb_version)
- || version_compare($this->data->icingadb_version, IcingaHealth::REQUIRED_ICINGADB_VERSION, '<')
+ || version_compare(
+ IcingaHealth::normalizeVersion($this->data->icingadb_version),
+ IcingaHealth::REQUIRED_ICINGADB_VERSION,
+ '<'
+ )
) {
$this->addHtml(Html::tag('div', ['class' => 'icinga-health down'], [
sprintf(
=====================================
test/php/library/Icingadb/ProvidedHook/IcingaHealthTest.php
=====================================
@@ -0,0 +1,19 @@
+<?php
+
+/* Icinga DB Web | (c) 2025 Icinga GmbH | GPLv2 */
+
+namespace Tests\Icinga\Modules\Icingadb\ProvidedHook;
+
+use Icinga\Module\Icingadb\ProvidedHook\IcingaHealth;
+use PHPUnit\Framework\TestCase;
+
+class IcingaHealthTest extends TestCase
+{
+ public function testNormalizeVersion()
+ {
+ $this->assertEquals('1.4.0', IcingaHealth::normalizeVersion('1.4.0'));
+ $this->assertEquals('1.4.0', IcingaHealth::normalizeVersion('1.4.0-1d5a35da5'));
+ $this->assertEquals('1.4.0', IcingaHealth::normalizeVersion('v1.4.0'));
+ $this->assertEquals('1.4.0', IcingaHealth::normalizeVersion('v1.4.0-1d5a35da5'));
+ }
+}
View it on GitLab: https://salsa.debian.org/nagios-team/icingadb-web/-/compare/146e3b94a29cdfd58c3d2227bae837470bfba810...30e77ddfb5ef901ef53ae1cb2276102ce1ea8a24
--
View it on GitLab: https://salsa.debian.org/nagios-team/icingadb-web/-/compare/146e3b94a29cdfd58c3d2227bae837470bfba810...30e77ddfb5ef901ef53ae1cb2276102ce1ea8a24
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20250620/3bfe4ec0/attachment-0001.htm>
More information about the pkg-nagios-changes
mailing list