diff --git a/docs/releases/stage-z2m-1.0.1.md b/docs/releases/stage-z2m-1.0.1.md new file mode 100644 index 0000000..25a2afa --- /dev/null +++ b/docs/releases/stage-z2m-1.0.1.md @@ -0,0 +1,6 @@ +# Zigbee2MQTT stage 1.0.1 + +- Moved `StartLimitIntervalSec=0` from `[Service]` to `[Unit]` in the shared Zigbee2MQTT unit generator. systemd now honors the setting without an unknown-key warning; the existing wrapper remains responsible for retry backoff. +- Zigbee2MQTT application version and device configuration are unchanged. The stage version is raised so installed Edges can receive the correction through Console. + +Validation: shell syntax check, systemd unit validation with local executable/user substitutions, and stage release catalog tests. diff --git a/offline/test_stage_versions.py b/offline/test_stage_versions.py index 09e83df..19389a0 100644 --- a/offline/test_stage_versions.py +++ b/offline/test_stage_versions.py @@ -156,7 +156,7 @@ class StageVersionsTest(unittest.TestCase): self.assertEqual('queued', job['state']) def test_worker_installs_only_confirmed_stage_and_records_failure(self): - versions.delivery.write_json(versions.STATE / 'job.json', {'stage':'stage_z2m', 'commit':COMMIT, 'version':'1.0.0', 'unit':'test-job'}) + versions.delivery.write_json(versions.STATE / 'job.json', {'stage':'stage_z2m', 'commit':COMMIT, 'version':self.catalog['stages']['stage_z2m']['version'], 'unit':'test-job'}) checkout = Path(versions.read_json(versions.CONFIG)['checkout']) checkout.mkdir() (checkout / 'stage-releases.json').write_text(json.dumps(self.catalog)) @@ -181,7 +181,7 @@ class StageVersionsTest(unittest.TestCase): self.assertFalse((versions.STATE / 'stage_ui.json').exists()) def test_success_requires_receipt_from_this_job(self): - job = {'stage':'stage_z2m', 'commit':COMMIT, 'version':'1.0.0', 'unit':'unique-job'} + job = {'stage':'stage_z2m', 'commit':COMMIT, 'version':self.catalog['stages']['stage_z2m']['version'], 'unit':'unique-job'} checkout = Path(versions.read_json(versions.CONFIG)['checkout']) checkout.mkdir() (checkout / 'stage-releases.json').write_text(json.dumps(self.catalog)) @@ -190,7 +190,7 @@ class StageVersionsTest(unittest.TestCase): def finish(*args, **kwargs): self.assertEqual('unique-job', kwargs['env']['IOMATEX_INSTALL_JOB_ID']) versions.delivery.write_json(versions.STATE / 'stage_z2m.json', { - 'commit':COMMIT, 'version':'1.0.0', 'job_id':job_id, + 'commit':COMMIT, 'version':job['version'], 'job_id':job_id, }) with mock.patch.object(versions.delivery, 'bootstrap'), mock.patch.object(versions.subprocess, 'run', side_effect=finish): if expected == 'failed': @@ -222,14 +222,17 @@ class StageVersionsTest(unittest.TestCase): for stage, release in self.catalog['stages'].items(): (root / stage).mkdir(parents=True) (root / stage / 'version.json').write_text(json.dumps(release)) - bump_stage_version.bump(root, 'stage_z2m', '1.0.1') + current = self.catalog['stages']['stage_z2m']['version'] + major, minor, patch = map(int, current.split('.')) + next_version = f'{major}.{minor}.{patch + 1}' + bump_stage_version.bump(root, 'stage_z2m', next_version) catalog = versions.validate_manifest(json.loads((root / 'stage-releases.json').read_text())) - self.assertEqual({'version':'1.0.1'},catalog['stages']['stage_z2m']) + self.assertEqual({'version':next_version},catalog['stages']['stage_z2m']) raw = json.loads((root / 'stage-releases.json').read_text()) self.assertNotIn('stage_ip_stream', raw['stages']) self.assertIn('stage_ip_stream', raw['optional_stages']) self.assertEqual(catalog['stages']['stage_z2m'],json.loads((root / 'stage_z2m/version.json').read_text())) - with self.assertRaises(ValueError): bump_stage_version.bump(root, 'stage_z2m', '1.0.0') + with self.assertRaises(ValueError): bump_stage_version.bump(root, 'stage_z2m', current) def test_missing_catalog_and_denied_credentials_have_specific_messages(self): from urllib.error import HTTPError diff --git a/stage-releases.json b/stage-releases.json index dd8ee54..6cc2a1c 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -11,7 +11,7 @@ "version": "1.0.2" }, "stage_z2m": { - "version": "1.0.0" + "version": "1.0.1" }, "stage_ui": { "version": "3.1.20" diff --git a/stage_z2m/stage_z2m_lib.sh b/stage_z2m/stage_z2m_lib.sh index 9593935..b7c368e 100755 --- a/stage_z2m/stage_z2m_lib.sh +++ b/stage_z2m/stage_z2m_lib.sh @@ -1214,6 +1214,8 @@ install_systemd_units() { Description=Zigbee2MQTT (local MQTT only) with dongle-aware wrapper After=network-online.target mosquitto.service Wants=network-online.target mosquitto.service +# Disable systemd start throttling; the wrapper owns retry backoff. +StartLimitIntervalSec=0 [Service] Type=simple @@ -1225,7 +1227,6 @@ Environment=PATH=/usr/bin:/bin ExecStart=/usr/local/sbin/iomatex-z2m-wrapper.sh Restart=on-failure RestartSec=30 -StartLimitIntervalSec=0 LimitNOFILE=65536 [Install] diff --git a/stage_z2m/version.json b/stage_z2m/version.json index 1587a66..ca84e70 100644 --- a/stage_z2m/version.json +++ b/stage_z2m/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.0" + "version": "1.0.1" }