[fix] Added support for PPPoE management interfaces#259
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
📝 WalkthroughWalkthroughThis PR extends openwisp.net.get_interface to detect when a UCI network section's proto is "pppoe" and construct the interface name as "pppoe-" (mirroring existing bridge "br-" handling). It adds LuaUnit tests that stub UCI and nixio to verify bridge and PPPoE name resolution and updates the runtests script to run the new test file. Sequence Diagram(s)sequenceDiagram
participant Caller
participant net.get_interface
participant UCI
participant nixio
Caller->>net.get_interface: get_interface("<name>")
net.get_interface->>UCI: cursor(): get("network", "<name>", "proto")
alt proto == "pppoe"
net.get_interface->>nixio: interfaces(): find name "pppoe-<name>"
else proto == "bridge"
net.get_interface->>nixio: interfaces(): find name "br-<name>"
else
net.get_interface->>nixio: interfaces(): find name "<name>"
end
nixio-->>net.get_interface: interface object / nil
net.get_interface-->>Caller: interface or nil
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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 |
Commit Message Style FailureHello @tizbac, Your commit message is missing a required prefix in the short description. Correct Format Example: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@openwisp-config/files/lib/openwisp/net.lua`:
- Around line 10-15: Add a regression test that exercises the PPPoE branch:
create a temporary UCI network section with name "<section_name>" and set
proto='pppoe' and a known address, then invoke the code path that resolves
interface names (the logic using uci_cursor:get(...,'proto') and the
is_pppoe/ifname branch in net.lua or by calling the public entry used by
openwisp-get-address) and assert the resolved interface name equals
"pppoe-<section_name>" and the returned address matches the known address; place
the test alongside existing network/net.lua tests and mirror their
setup/teardown of UCI state so it is isolated and repeatable.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 5a3cf27e-77be-421d-9274-65d89dd273b0
📒 Files selected for processing (1)
openwisp-config/files/lib/openwisp/net.lua
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: QA-Checks and Tests
- GitHub Check: Kilo Code Review
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by gpt-5.4-20260305 · 18,436 tokens |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
a8ae8d8 to
a4610a2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@openwisp-config/tests/test_net.lua`:
- Around line 33-51: The tests TestNet.test_get_interface_uses_bridge_prefix and
TestNet.test_get_interface_uses_pppoe_prefix currently only assert
interface.name; update both to also assert the resolved IP by checking
interface.addr equals the expected addr (e.g., '192.168.1.1' for br-lan and
'192.0.2.1' for pppoe-wan) so net.get_interface's returned nixio entry
(interface.addr) is validated; locate the assertions in those test_* functions
and add luaunit.assertEquals(interface.addr, '<expected ip>') for each case.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 380f05ae-8436-4aee-ba6b-8d7eb7a5b582
📒 Files selected for processing (3)
openwisp-config/files/lib/openwisp/net.luaopenwisp-config/tests/test_net.luaruntests
📜 Review details
🔇 Additional comments (3)
openwisp-config/files/lib/openwisp/net.lua (1)
10-20: LGTM!runtests (1)
12-12: LGTM!openwisp-config/tests/test_net.lua (1)
6-31: LGTM!
a4610a2 to
95870e5
Compare
|
Proposed change log entry: |
|
Thanks @tizbac 🙏 FYI, we have a matrix dev chat if you ever need to discuss changes. |
Checklist
Reference to Existing Issue
Closes #258
Description of Changes
The interface protocol is checked for it being
pppoeif true since openwrt names the actual interface returned by nixio to pppoe-xxx ,pppoe-is prepended like done for the bridge case