edgehog-device-manager / edgehog

Easily manage your IoT device fleet with Edgehog at once. Get information on device status, deploy updates, geolocate your devices and much more!
Apache License 2.0
34 stars 21 forks source link

trigger_payload: accept trigger_name key #673

Closed rbino closed 2 weeks ago

rbino commented 2 weeks ago

Astarte >= 1.2.0 sends an additional trigger_name key in the trigger payload. This was making Edgehog crash since Ash doesn't accept additional input keys by default. Fix this allowing unknown keys to be accepted. This should future-proof the trigger handler in case further additional keys are added in the future.

Since 1.2.0 is the current stable version of Astarte, add the trigger_name key to all existing tests and explicitly test support for the key missing to avoid regressions with old Astarte versions.

Fix #664

coveralls commented 2 weeks ago

Pull Request Test Coverage Report for Build ffb34868d1347e89c11dac69a3b70f0a2701b68e-PR-673

Details


Totals Coverage Status
Change from base Build 11517605088: 80.6%
Covered Lines: 1227
Relevant Lines: 1523

💛 - Coveralls
rbino commented 2 weeks ago

Added the references in both places. Let me know if you prefer handling this with skip_unknown_inputs, either now or in the future (in that case open an issue).