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

Add allowed values to metadata #69

Merged

Conversation

argerus
Copy link
Contributor

@argerus argerus commented Sep 24, 2024

No description provided.

@argerus argerus force-pushed the feature/add_allowed_to_metadata branch from edd5b04 to 4f1a0b0 Compare September 24, 2024 20:20
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 4.76190% with 100 lines in your changes missing coverage. Please review.

Project coverage is 50.02%. Comparing base (ecfeb0b) to head (9741da2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
databroker/src/grpc/kuksa_val_v1/val.rs 3.07% 63 Missing ⚠️
...tabroker/src/grpc/sdv_databroker_v1/conversions.rs 0.00% 37 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
- Coverage   50.44%   50.02%   -0.42%     
==========================================
  Files          31       31              
  Lines       11702    11805     +103     
==========================================
+ Hits         5903     5906       +3     
- Misses       5799     5899     +100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukasmittag
Copy link
Contributor

As quick fix okay. But shouldn't we add it in kuksa.val.v1/v2 as well as message in types?

@rafaeling
Copy link
Contributor

@argerus
Copy link
Contributor Author

argerus commented Sep 25, 2024

As quick fix okay. But shouldn't we add it in kuksa.val.v1/v2 as well as message in types?

This adds it to kuksa.val.v1 and sdv.databroker.v1. kuksa.val.v2 is not a thing (yet)

@lukasmittag
Copy link
Contributor

yes, in code but why only add message Allowed in types.proto of sdv.databroker.v1?

@lukasmittag
Copy link
Contributor

Okay, my fault. It is nested in ValueRestriction here

message ValueRestriction {

r#type: Some(proto::value_restriction::Type::Signed(
proto::ValueRestrictionInt {
allowed_values: vec.iter().cloned().map(i64::from).collect(),
min: None, // TODO: Implement
Copy link
Contributor

Choose a reason for hiding this comment

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

So for now just creating a placeholder for supporting min/max?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were already defined in kuksa.val.v1.ValueRestriction.. this PR doesn't change anything regarding them, it's limited to adding support for allowed values.

But maybe it would be better to add support for min / max as well in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no strong opinion, depends on how much time that would take I think. If it is quick go for it, if not keep the TODOs and do it later.

int32 id = 1;
EntryType entry_type = 2;
string name = 4;
DataType data_type = 5;
ChangeType change_type = 6; // CONTINUOUS or STATIC or ON_CHANGE
string description = 7;

Allowed allowed = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we ever used the metadata on the lines below? Even if the lines below are commented I assume it would be better to not have the same number (10) on this line and the line below, or?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They have never been used. I guess it's better to just remove them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then just remove them I would say

Copy link
Contributor

@erikbosch erikbosch left a comment

Choose a reason for hiding this comment

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

Looks good enough

@erikbosch erikbosch force-pushed the feature/add_allowed_to_metadata branch from 4f1a0b0 to c511caa Compare October 10, 2024 08:28
@erikbosch erikbosch merged commit 1247130 into eclipse-kuksa:main Oct 15, 2024
18 checks passed
@erikbosch erikbosch deleted the feature/add_allowed_to_metadata branch October 15, 2024 13:05
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.

4 participants