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

data_updater_plant: refute incomplete objects #574

Open
wants to merge 1 commit into
base: release-1.0
Choose a base branch
from

Conversation

rbino
Copy link
Collaborator

@rbino rbino commented Apr 23, 2021

Data Updater Plant was accepting objects containing a subset of the required
keys. This MR fixes that behaviour, leaving a way to accept the old (incorrect)
one for a transition period: passing
DATA_UPDATER_PLANT_ACCEPT_INCOMPLETE_OBJECTS=true as environment variable.

Fix #550

Signed-off-by: Riccardo Binetti riccardo.binetti@ispirata.com

@rbino rbino added bug Something isn't working blocking This issue or pull request blocks a release (e.g. API change, major bug) app:data_updater_plant This issue or pull request is about astarte_data_updater_plant application labels Apr 23, 2021
@rbino rbino requested a review from bettio April 23, 2021 14:32
@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #574 (c0ba934) into release-1.0 (6b5e474) will increase coverage by 1.63%.
The diff coverage is n/a.

❗ Current head c0ba934 differs from pull request most recent head 365a262. Consider uploading reports for the commit 365a262 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##           release-1.0     #574      +/-   ##
===============================================
+ Coverage        67.19%   68.82%   +1.63%     
===============================================
  Files              246      219      -27     
  Lines             5447     3894    -1553     
===============================================
- Hits              3660     2680     -980     
+ Misses            1787     1214     -573     
Impacted Files Coverage Δ
...tarte_data_updater_plant/message_tracker/server.ex
...astarte_data_updater_plant_web/plug/health_plug.ex
...ata_updater_plant/amqp_data_consumer/supervisor.ex
...nt/lib/astarte_data_updater_plant_web/telemetry.ex
...astarte_data_updater_plant/amqp_events_producer.ex
...ata_updater_plant/data_updater/event_type_utils.ex
...nt/lib/astarte_data_updater_plant/health/health.ex
...lib/astarte_data_updater_plant/triggers_handler.ex
...astarte_data_updater_plant/data_updater/queries.ex
...b/astarte_data_updater_plant/amqp_data_consumer.ex
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b5e474...365a262. Read the comment docs.

@rbino rbino force-pushed the fix-550 branch 3 times, most recently from 7d12e9a to 94246f2 Compare April 23, 2021 15:14
Data Updater Plant was accepting objects containing a subset of the required
keys. This MR fixes that behaviour, leaving a way to accept the old (incorrect)
one for a transition period: passing
DATA_UPDATER_PLANT_ACCEPT_INCOMPLETE_OBJECTS=true as environment variable.

Fix astarte-platform#550

Signed-off-by: Riccardo Binetti <riccardo.binetti@ispirata.com>
Copy link
Contributor

@bettio bettio left a comment

Choose a reason for hiding this comment

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

At the moment this would break any existing installation since devices having an older interface minor version have less keys than expected, however their data are still valid.
We need to compare keys against expected objects for given major and minor.
We already keeping track of the minor version which introduced any endpoint, however this sounds like a complex change.

@bettio
Copy link
Contributor

bettio commented Apr 23, 2021

I suggest documenting this "issue" as a known issue and we must tell our users to pay attention to this that will have stricter checks in future versions.
I think that at the moment the easiest approach would be a device SDK side check.

@bettio bettio removed the blocking This issue or pull request blocks a release (e.g. API change, major bug) label May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:data_updater_plant This issue or pull request is about astarte_data_updater_plant application bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants