-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for Device Custom Attributes #205
Merged
bettio
merged 8 commits into
edgehog-device-manager:main
from
rbino:device-custom-attributes
Jun 15, 2022
Merged
Add support for Device Custom Attributes #205
bettio
merged 8 commits into
edgehog-device-manager:main
from
rbino:device-custom-attributes
Jun 15, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generated with: mix phx.gen.schema Devices.Attribute device_attributes \ tenant_id:references:tenants device_id:references:devices \ namespace:enum:custom:other key:string typed_value:map Copyright headers added after generation, and "custom" value removed from enum (it was needed because the generator wants at least two values for an enum field) Signed-off-by: Riccardo Binetti <[email protected]>
rbino
force-pushed
the
device-custom-attributes
branch
from
June 13, 2022 15:30
90ccfd1
to
72956e6
Compare
szakhlypa
reviewed
Jun 13, 2022
Pull Request Test Coverage Report for Build cb67fdd1c1908bde54fc32193e9f3b0d9e754525-PR-205Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
rbino
force-pushed
the
device-custom-attributes
branch
from
June 14, 2022 07:04
72956e6
to
70d5d08
Compare
backend/priv/repo/migrations/20220607055759_create_device_attributes.exs
Show resolved
Hide resolved
davidebriani
approved these changes
Jun 14, 2022
Allow storing variants in the database Signed-off-by: Riccardo Binetti <[email protected]>
Use a compound primary key to make cast_assoc work correctly. This way we're not inserting new attributes everytime and on the other hand we don't need to send an explicit id. Signed-off-by: Riccardo Binetti <[email protected]>
Also add relevant tests Signed-off-by: Riccardo Binetti <[email protected]>
Support variants for input and output in the schema Signed-off-by: Riccardo Binetti <[email protected]>
Add relevant tests to verify all types are correctly serialized Signed-off-by: Riccardo Binetti <[email protected]>
Also add relevant tests Signed-off-by: Riccardo Binetti <[email protected]>
Signed-off-by: Riccardo Binetti <[email protected]>
rbino
force-pushed
the
device-custom-attributes
branch
from
June 14, 2022 12:43
70d5d08
to
8ea6a99
Compare
davidebriani
approved these changes
Jun 14, 2022
Pavinati
reviewed
Jun 14, 2022
Pavinati
approved these changes
Jun 15, 2022
szakhlypa
approved these changes
Jun 15, 2022
bettio
approved these changes
Jun 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the concept of Attributes already present in the draft OTA Documentation.
The first kind of attributes implemented are Custom Attributes, which are completely user-defined.
This PR introduces the infrastructure to support attributes both at the database and at the GraphQL level.
A variant type is also introduced at both ends of the solution to support attributes of all types (currently only scalar types, support for arrays will be tracked by this issue.