Add support for diff overrides in handle_updates; fix updating default_firewall_ids when None#731
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for custom diffing logic in the handle_updates helper function and fixes an issue with updating default_firewall_ids when it contains None values.
Key changes:
- Introduces a
diff_overridesparameter tohandle_updatesallowing modules to provide custom comparison logic for specific fields - Updates firewall settings module to use custom diff logic that preserves
Nonevalues indefault_firewall_ids - Adjusts integration test to properly handle null values in firewall settings
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/module_utils/linode_helper.py | Refactored handle_updates to support custom diff functions via diff_overrides parameter |
| plugins/modules/firewall_settings.py | Added custom diff override for default_firewall_ids field using matching_keys_eq |
| tests/integration/targets/firewall_settings/tasks/main.yaml | Updated test to handle null values in default_firewall_ids field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e01939c to
8830f01
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yec-akamai
left a comment
There was a problem hiding this comment.
Tests passed on my end with null values, nice work!
📝 Description
This pull request introduces a new
diff_overridesfield on thehandle_updateshelper, which allows modules to override the default diffing logic for fields that may require custom diff logic.Integration tests run: https://github.com/linode/ansible_linode/actions/runs/19909274376/job/57073583771
✔️ How to Test
The following test steps assume you have pulled down this PR locally and run
make install.Integration Testing
NOTE: This test was previously failing only when the user has a null entry in the
default_firewall_idsfield.