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

Changing ListMetaData to correspond to reality #106

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erikbosch
Copy link
Contributor

@erikbosch erikbosch commented Nov 20, 2024

We do not use the filter field, and the name root is not that logical. In older API supporting same wildcard syntax we use the term path, so proposing to change to that.

https://github.com/eclipse-kuksa/kuksa-databroker/blob/main/proto/kuksa/val/v1/val.proto#L104

message SubscribeEntry {
  string path           = 1;
  View view             = 2;
  repeated Field fields = 3;
}

Related to discussion at https://github.com/eclipse-kuksa/kuksa-databroker/pull/105/files#r1848167147

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.34%. Comparing base (66b1c91) to head (21c7bd0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
- Coverage   59.38%   59.34%   -0.05%     
==========================================
  Files          33       33              
  Lines       16048    16043       -5     
==========================================
- Hits         9530     9520      -10     
- Misses       6518     6523       +5     

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


🚨 Try these New Features:

@erikbosch
Copy link
Contributor Author

There is ongoing discussion if we better should change implementation to reflect the *.proto file. I.e. have

  • root - that must be a path to branch without wildcards.
    • OK Examples Vehicle, Vehicle.Cabin.
    • Bad Examples: Vehicle*, Vehicle.Speed, *
  • filter: Path possibly including wildcard

Below some possible examples to show results for a spec containing

Branch A
  Branch A.B
    Sensor A.B.C
    Sensor A.B.CC
    Sensor A.B.D
  Branch A.BB
    Sensor A.BB.A
  Branch A.C // Empty branch
Root Filter Result
A None A.B.C, A.B.CC, A.B.D and A.BB.A
A "" A.B.C, A.B.CC, A.B.D and A.BB.A
A * A.B.C, A.B.CC, A.B.D and A.BB.A Or should * only match a single level to differentatiate from **
A.B None A.B.C, A.B.CC and A.B.D
A.B "" A.B.C, A.B.CC and A.B.D
A.B * A.B.C, A.B.CC and A.B.D
A.B C A.B.C Only!
A.B C* A.B.C and A.B.CC
A.B* None Error - wildcard not allowed in root - INVALID_ARGUMENT
A.B.C None Error - root must not be a signal! - INVALID_ARGUMENT
A.C None Empty list returned as branch exist but is empty (if we can differentiate the case from the next)
A.D None Error - Branch does not exist - NOT_FOUND
A.B Sebastian Empty list returned as signal A.B.Sebastian does not exist

FYI @rafaeling

@argerus - does the table match how you think it should work

@erikbosch
Copy link
Contributor Author

Put on hold for now, we possibly want to have root plus filter anyway, so at least no proto update for 5.0

string filter = 2;
// A path which may include wildcards
// See https://github.com/eclipse-kuksa/kuksa-databroker/blob/main/doc/wildcard_matching.md
string path = 1;
Copy link
Contributor

@BjoernAtBosch BjoernAtBosch Nov 22, 2024

Choose a reason for hiding this comment

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

Some points of critic:

  • With the removed filter one cannot request certain "types" of metadata any longer (like "I just want to get the numeric ids"). This may result in a lot of (unneeded) data.
  • Having just one path (formerly root), it's hard to request metadata in a single request for completely different branches, like Vehicle.Speed and Vehicle.Cabin.Seat.*. (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.

Well as of today we do not care about "filter" at all. I have no problem having a filter field if we actually intend to use it, but we do not describe how filter shall/can be used at all right now, like if it going to support the use-cases you mention. But as we seem to be uncertain I put this PR on hold.

In #105 I instead pointed out that filter currently is not used, and that current implementation may change. Like to be on the safe side, do not use wildcards in root, as it may not be supported in the future.

Copy link
Contributor

@BjoernAtBosch BjoernAtBosch Nov 22, 2024

Choose a reason for hiding this comment

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

(Don't know, where to put this finding else:)
Rename field datapoints of message PublishValuesRequest to data_points(w/ underscore).

@erikbosch erikbosch mentioned this pull request Nov 25, 2024
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.

2 participants