Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger_payload: accept trigger_name key #673

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

rbino
Copy link
Collaborator

@rbino rbino commented Oct 28, 2024

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
Copy link

coveralls commented Oct 28, 2024

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

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+80.6%) to 80.565%

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

💛 - Coveralls

Copy link
Collaborator

@davidebriani davidebriani left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, the PR is very welcome.

Would you care adding references to the originating issue?
It would be nice to have a quick reference to #664 in the commit, PR description, and CHANGELOG line.

Besides that, as noted in the issue we could also use skip_unknown_inputs so that future additions to Astarte APIs will not break existing Edgehog deployments.

@rbino
Copy link
Collaborator Author

rbino commented Oct 28, 2024

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).

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 edgehog-device-manager#664

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
@davidebriani davidebriani merged commit 1988782 into edgehog-device-manager:release-0.9 Oct 28, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants