Skip to content

fix(mqtt): backport Home Assistant state topic parity to v1.6 - #1203

Merged
scttbnsn merged 2 commits into
dev/v1.6from
scttbnsn/fix-v1.6-ha-state-topics
Sep 15, 2026
Merged

scttbnsn merged 2 commits into
dev/v1.6from
scttbnsn/fix-v1.6-ha-state-topics

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Backports #1139 by Scott Benson (f6b5e82) for the topic mismatch investigated in discussion #1201.

Home Assistant discovery and state publishing now use the same topic builder. This keeps v1.6 canonical container names, the agenttopicsegment=false default, and unchanged plain-MQTT behavior. No v1.8 durable identity, Compose identity or update-progress features are included. This affects v1.6 only when HA agent topic segmentation is explicitly enabled.

The regression compares actual retained state publishes with emitted discovery payloads. Two cases failed before the fix; all 240 MQTT tests now pass with 100% focused coverage. The normal full pre-push passed in 252.94 seconds, including both workspace coverage gates at 100%, builds, workflow tests and website tests. Initial fresh-worktree website dependencies were missing, then installed and verified without bypassing hooks.

Includes unreleased notes and MQTT documentation. No live-broker verification or reporter-version confirmation yet. No release tag, main update or deployment is part of this PR.

Changelog

  • ✨ Added shared MQTT topic builders in topics.ts.
  • 🔧 Aligned MQTT state publishing with Home Assistant discovery topics.
  • 🔧 Preserved v1.6 defaults and plain MQTT behavior.
  • 🐛 Fixed agent-segmented Home Assistant state topics.
  • ✨ Added topic-parity regression tests.
  • 🔧 Updated Alpine tzdata to 2026d-r0 and its regression assertion.
  • ✨ Documented retained-topic cleanup.

Concerns

  • Verify that old unscoped retained topics are unused before removal.
  • Perform live-broker verification.

Backport PR #1139 by Scott Benson, commit f6b5e82. Share topic construction between state publishing and Home Assistant discovery while retaining v1.6 canonical names and agenttopicsegment=false by default.

Do not include later plain-MQTT segmentation, Compose identity, or update-progress changes. Compare actual state and discovery publishes in regression tests, and document retained old-topic cleanup in unreleased notes.
@vercel

vercel Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Sep 15, 2026 12:39pm UTC
drydockdemo-website Ready Ready Preview Sep 15, 2026 12:39pm UTC

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9dacc225-d55d-4933-a081-c9b8dadc6b5b

📥 Commits

Reviewing files that changed from the base of the PR and between c3fb8c3 and d696961.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (2)
  • Dockerfile
  • app/configuration/dockerfile-defaults.test.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

MQTT topic construction now uses a shared topics.ts module. Mqtt.ts applies Home Assistant agent segmentation only when enabled. Hass.ts uses the same helpers for discovery topics. Tests cover agent values, segmentation settings, canonical names, and non-Home Assistant publishing. Documentation describes the v1.6 maintenance fix and retained-topic behavior. The Dockerfile updates the pinned tzdata revision, with matching test assertions.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to d6969

The MQTT parity change preserves the documented defaults and aligns state and discovery topics. The maintenance pin and its regression check match, so the change is ready to merge.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scttbnsn/fix-v1.6-ha-state-topics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn

Copy link
Copy Markdown
Contributor Author

The build failure was the stale Alpine tzdata pin, not the MQTT change. d696961 updates only that package pin, its regression assertion and the changelog. Official Alpine 3.24 indexes and downloaded package metadata confirm 2026d-r0 for amd64 and arm64. The full pre-push gate passed again in 263.33 seconds, with app/UI coverage at 100% and both builds passing. Local Docker could not test APK installation because its containerd storage returned an I/O error before startup; hosted image checks remain the installation gate. No release or main change.

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please verify the incremental timezone-pin repair at exact head d696961. Your first review cleared the MQTT change at c3fb8c3; its runtime source is unchanged. The new diff only updates the exact Alpine timezone package pin, the existing regression assertion and the changelog. Preserve the 1.6 curl contract and image-index pins. All required hosted checks are now green, including both architecture builds, Cucumber, Playwright and Grype. This is a self-hosted Docker manager with operator-owned configuration; no hostile-maintainer or new release-policy scenario is in scope.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='d6969615fde8b79e4f82cf4b19e869021fcd56df'
base='c3fb8c38b'

printf '%s\n' '== HEAD =='
git rev-parse HEAD
git show -s --format='%H%n%P%n%s' "$head"
git merge-base --is-ancestor "$base" "$head"
printf '%s\n' 'base is an ancestor of head'

printf '%s\n' '== Incremental changed paths =='
git diff --name-status "$base" "$head"
printf '%s\n' '== Incremental diff =='
git diff --find-renames --find-copies --unified=80 "$base" "$head"

printf '%s\n' '== tzdata references at head =='
rg -n -i -C 3 'tzdata|2026d-r0' -g '!node_modules' -g '!dist' -g '!build' .

printf '%s\n' '== curl and image pin references changed by incremental commit =='
git diff --unified=3 "$base" "$head" | rg -n -i -C 2 'curl|image.*(digest|index)|sha256|alpine' || true

printf '%s\n' '== Alpine Dockerfile candidates =='
fd -i 'dockerfile|Dockerfile' . -E node_modules -E dist -E build | sort

Length of output: 48284


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Package validation script structure =='
ast-grep outline scripts/dockerfile-system-packages.test.mjs --items all
printf '%s\n' '== Package validation references =='
rg -n -C 4 'tzdata|apk add|Dockerfile|2026[c-d]-r0' \
  scripts/dockerfile-system-packages.test.mjs \
  scripts/check-dockerfile-base-indexes.sh \
  scripts/check-dockerfile-base-indexes.test.mjs \
  app/configuration/dockerfile-defaults.test.ts

printf '%s\n' '== Exact incremental changed lines excluding tzdata and changelog =='
git diff --unified=0 c3fb8c38b87ac8e765304ad756b598045431a22f d6969615fde8b79e4f82cf4b19e869021fcd56df \
  -- Dockerfile app/configuration/dockerfile-defaults.test.ts \
  | grep -E '^[+-]' \
  | grep -vE '^(---|\+\+\+|[-+]    tzdata=|[-+]    expect\(dockerfile\)\.(toContain|not\.toContain)\('\''tzdata=)' \
  || true

Length of output: 12558


@scttbnsn No actionable feedback.

Verified exact head d6969615fde8b79e4f82cf4b19e869021fcd56df. The commit is directly based on c3fb8c38b87ac8e765304ad756b598045431a22f.

The incremental diff only updates:

  • Dockerfile: tzdata=2026c-r0 → tzdata=2026d-r0.
  • app/configuration/dockerfile-defaults.test.ts: matching positive and stale-version assertions.
  • CHANGELOG.md: repair documentation.

The diff does not change the v1.6 unpinned curl contract. The diff does not change any digest-pinned FROM image reference. No other package-version test asserts the tzdata revision.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@scttbnsn
scttbnsn merged commit aec21d5 into dev/v1.6 Sep 15, 2026
33 of 34 checks passed
@scttbnsn
scttbnsn deleted the scttbnsn/fix-v1.6-ha-state-topics branch September 15, 2026 13:16

This branch was successfully deployed

2 active deployments
Preview – drydock-website — d6969615 Deployed Sep 15, 2026 by vercel[bot]
Preview – drydockdemo-website — d6969615 Deployed Sep 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant