Skip to content

feat: expose device-level autoconnect and managed controls - #547

Merged
cachebag merged 2 commits into
freedesktop-rs:masterfrom
ryux1:feat/541-device-control
Sep 7, 2026
Merged

cachebag merged 2 commits into
freedesktop-rs:masterfrom
ryux1:feat/541-device-control

Conversation

@ryux1

@ryux1 ryux1 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose Device.autoconnect alongside the existing managed-state snapshot
  • add high-level set_device_autoconnect and set_device_managed methods for any NetworkManager device
  • cover both writes in the isolated veth lifecycle and document the new API

set_device_autoconnect(false) deliberately leaves an active connection alone, matching NetworkManager's property semantics. set_device_managed uses the writable property rather than the newer 1.58-only SetManaged method, preserving the crate's compatibility with older NetworkManager releases; its state is therefore temporary and resets when NetworkManager restarts.

Closes #541.

Validation

  • cargo check
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test -p nmrs --lib --all-features (647 passed)
  • cargo test --doc --all-features --workspace (134 passed, 16 ignored)
  • cargo test --all-features --workspace (647 unit tests and 134 doc tests passed; 5 environmental integration tests ignored)
  • git diff --check

The Docker integration harness was not run locally because Docker is unavailable on this host. The updated ignored veth contract compiled as part of the workspace test and is ready for the repository's isolated CI environment.

AI assistance

I used OpenAI Codex to help inspect the existing API patterns, check the implementation, and draft parts of the code and documentation. I reviewed the complete diff and ran the validation listed above.

@ryux1
ryux1 had a problem deploying to self-hosted-pr-integration September 7, 2026 00:01 — with GitHub Actions Failure
@cachebag cachebag added api-surface Public API design, re-exports, and semver-relevant changes tests Add, remove or adjust tests wifi WiFi connection management dbus D-Bus types, signatures, or NM D-Bus API labels Sep 7, 2026
@ryux1

ryux1 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

The failing NetworkManager Integration job is in the pre-existing wifi_wpa_saved_connection_lifecycle test: NetworkManager returned DeviceFailed(Unknown) instead of the expected AuthFailed for a deliberately incorrect WPA passphrase. This PR only changes the wired lifecycle coverage, and the latest master CI run passed the same integration job. All other PR checks, including unit tests, Clippy, formatting, semver, aarch64, and docs, are green. I tried to rerun the failed job, but GitHub restricts reruns to repository admins; could a maintainer rerun it?

@cachebag cachebag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just need to tighten up this integration test. Great work!

Comment thread nmrs/tests/integration_test.rs Outdated
Comment thread nmrs/tests/integration_test.rs Outdated
Comment thread nmrs/tests/integration_test.rs Outdated
@ryux1
ryux1 deployed to self-hosted-pr-integration September 7, 2026 02:43 — with GitHub Actions Active
@cachebag

cachebag commented Sep 7, 2026

Copy link
Copy Markdown
Member

The failing NetworkManager Integration job is in the pre-existing wifi_wpa_saved_connection_lifecycle test: NetworkManager returned DeviceFailed(Unknown) instead of the expected AuthFailed for a deliberately incorrect WPA passphrase. This PR only changes the wired lifecycle coverage, and the latest master CI run passed the same integration job. All other PR checks, including unit tests, Clippy, formatting, semver, aarch64, and docs, are green. I tried to rerun the failed job, but GitHub restricts reruns to repository admins; could a maintainer rerun it?

@ryux1 I appreciate the work on this and LLMs are more than okay to use; but I don't need you to laundry the feedback I give through an LLM. I would like to speak to you as a human, since it is presumed that you take responsibility for your work regardless of how it was generated.

@cachebag cachebag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cachebag
cachebag merged commit 4355146 into freedesktop-rs:master Sep 7, 2026
8 checks passed
@ryux1
ryux1 deleted the feat/541-device-control branch September 7, 2026 02:50
@ryux1

ryux1 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Understood. Thanks for being direct, and thanks for reviewing and merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-surface Public API design, re-exports, and semver-relevant changes dbus D-Bus types, signatures, or NM D-Bus API tests Add, remove or adjust tests wifi WiFi connection management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] expose device-level Autoconnect and Managed properties

2 participants