Fix emqx data dir and bump emqx version#164
Conversation
|
Warning Review limit reached
More reviews will be available in 16 minutes and 28 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughAdds node name persistence to the EMQX s6 run script: it reads a stored ChangesEMQX Node Name Persistence and Upgrade Testing
Sequence Diagram(s)sequenceDiagram
participant HA as Home Assistant s6
participant Run as emqx/run script
participant FS as /data/emqx filesystem
participant Hosts as /etc/hosts
HA->>Run: start EMQX service
Run->>FS: read /data/emqx/etc/node.name
alt node.name exists
FS-->>Run: return persisted node name
else no node.name
Run->>FS: list /data/emqx/data/mnesia subdirs
alt 0 subdirs
Run->>Run: use default node name
else 1 subdir
Run->>Run: use legacy directory node name
else multiple subdirs
Run->>Run: warn, use fallback/default node name
end
end
Run->>FS: write chosen name to /data/emqx/etc/node.name
Run->>Run: export EMQX_HOST, EMQX_NAME, EMQX_NODE__NAME, dirs
Run->>Hosts: getent hosts EMQX_HOST
alt host not resolvable
Run->>Hosts: append 127.0.0.1 EMQX_HOST
end
Run->>HA: exec EMQX foreground with resolved node name
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)
18-39: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd a timeout for the
upgrade-testjob.This Docker-heavy job can hang indefinitely on runner/network edge cases; add
timeout-minutesat the job level to fail fast and keep CI unblocked.Suggested change
upgrade-test: name: EMQX Upgrade Test runs-on: ubuntu-latest + timeout-minutes: 20 permissions: contents: read🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yaml around lines 18 - 39, The upgrade-test job lacks a timeout mechanism and can hang indefinitely due to runner or network edge cases. Add a timeout-minutes property at the job level (positioned after the job name and before the runs-on field) to specify an appropriate timeout threshold that will fail the job quickly if it exceeds the time limit, keeping the CI pipeline unblocked.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@emqx/DOCS.md`:
- Around line 3-12: The markdown links in DOCS.md use invalid syntax with square
brackets around the URL. Fix both malformed links by changing the syntax from
[text][https://url] to [text](url) using parentheses instead of square brackets.
Locate the two links for "EMQX" and "EMQX MQTT broker" that reference
https://www.emqx.com/en/products/emqx and update them to use proper inline link
syntax with parentheses.
In `@emqx/rootfs/etc/s6-overlay/s6-rc.d/emqx/run`:
- Around line 21-39: The node_name variable read from the persisted
node_name_file at the beginning of the conditional block is used without
validation, which could lead to malformed values poisoning environment variables
like EMQX_HOST and /etc/hosts entries. Add validation logic after the node_name
is determined (after the first if-elif-else chain that sets node_name) to ensure
it contains only valid characters for a hostname or node identifier before it is
written back to the node_name_file. Additionally, validate node_name at the
locations referenced in lines 61-64 where it is used for environment setup and
/etc/hosts configuration to prevent invalid entries from being written.
In `@README.md`:
- Around line 27-36: The README.md file contains malformed markdown link syntax
using the format [text][https://url] on two occasions where EMQX is referenced.
Replace these with the correct inline link syntax [text](url) using parentheses
instead of square brackets for the URL. Specifically, fix the EMQX links that
currently use square brackets around the full URL to use parentheses instead,
which is the proper markdown format for inline links.
---
Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 18-39: The upgrade-test job lacks a timeout mechanism and can hang
indefinitely due to runner or network edge cases. Add a timeout-minutes property
at the job level (positioned after the job name and before the runs-on field) to
specify an appropriate timeout threshold that will fail the job quickly if it
exceeds the time limit, keeping the CI pipeline unblocked.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0998c30e-96b4-4959-a352-5ca79c1c4446
📒 Files selected for processing (6)
.github/scripts/emqx-upgrade-test.sh.github/workflows/ci.yamlREADME.mdemqx/DOCS.mdemqx/Dockerfileemqx/rootfs/etc/s6-overlay/s6-rc.d/emqx/run
Proposed Changes
Related Issues
#161
#158
Summary by CodeRabbit
New Features
Documentation
Chores