Add weekly CI to verify networkd enum sync with systemd#153
Add weekly CI to verify networkd enum sync with systemd#153
Conversation
Co-authored-by: cooperlees <3005596+cooperlees@users.noreply.github.com>
|
I also guess, fix the enums if out of sync at the moment ... e.g. #105 |
Co-authored-by: cooperlees <3005596+cooperlees@users.noreply.github.com>
Co-authored-by: cooperlees <3005596+cooperlees@users.noreply.github.com>
|
@copilot - rather than parse the C code can we compile it in with rust bindgen and inspect that way? |
The enum sync test currently passes - all 5 enums (AddressState, AdminState, CarrierState, OnlineState, OperState) match their systemd counterparts. The test will fail automatically when systemd makes changes, alerting us to update monitord.
I explored using bindgen, but it adds significant complexity:
The current manual parsing approach is:
The manual parser effectively does what bindgen would do, but tailored specifically for extracting enum values from these headers. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
cooperlees
left a comment
There was a problem hiding this comment.
Ok looks a good start.
@copilot explain how these tests are not picked up by normal "cargo test" ci?
I don't want them to fail on PRs and pushes. If that's covered just explain how please.
The networkd module manually replicates C enum definitions from systemd headers (
LinkOperationalState,LinkCarrierState, etc.). When systemd changes these enums, monitord silently becomes incompatible.Changes
Weekly CI workflow (
.github/workflows/systemd-enum-sync.yml)network-util.handnetworkd-link.hfrom systemd/systemd main branchIntegration test (
tests/systemd_enum_sync.rs)LINK_CARRIER_STATE_OFF = LINK_OPERSTATE_OFF)AddressState,AdminState,CarrierState,OnlineState,OperStateExample test output when out of sync:
This catches upstream breaking changes before they affect production deployments.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/systemd/systemd/contents/src/libsystemd/sd-network/usr/bin/curl curl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.