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-3438 Add resourceSubtype to data source specification #594

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

kaywux
Copy link
Member

@kaywux kaywux commented Nov 20, 2024

Currently a data source is defined as a unique <part_id, resource_name, method_name> tuple. We should also add resource_type to this specification.

Corresponding app change: https://github.com/viamrobotics/app/pull/6947

@github-actions github-actions bot added the safe to test committer is a member of this org label Nov 20, 2024
@kaywux kaywux added the ready-for-protos add this when you want protos to compile on every commit label Nov 20, 2024
@@ -234,6 +234,7 @@ message GetLatestTabularDataRequest {
string part_id = 1;
string resource_name = 2;
string method_name = 3;
string resource_type = 4;
Copy link
Member

Choose a reason for hiding this comment

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

would it make more sense to call this resource_subtype? according to the viam glossary resource type is either component or service and subtype is the actual component/service type like sensor or arm etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good callout! Changing this to resource_subtype instead

@@ -234,6 +234,7 @@ message GetLatestTabularDataRequest {
string part_id = 1;
string resource_name = 2;
string method_name = 3;
string resource_type = 4;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason that this is after method_name instead of before?

Copy link
Member Author

@kaywux kaywux Nov 21, 2024

Choose a reason for hiding this comment

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

Yes - this is to keep method_name with the field number 3 which it's already been defined with. For protobuf the number each field is assigned to can't really be changed once the message type is in use, so if I were to have resource_type "before" method_name here, it would require us to do something like this:

string resource_subtype = 4;
string method_name = 5;

reserved 3;

which seems unnecessary given that the field order here doesn't really matter semantically.

Copy link
Member

Choose a reason for hiding this comment

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

Ooh, in my head it wasn't really in use yet. But I guess that's not true! 😬

Copy link
Member

@gloriacai01 gloriacai01 left a comment

Choose a reason for hiding this comment

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

🎉

@kaywux kaywux changed the title DATA-3438 Add resourceType to data source specification DATA-3438 Add resourceSubtype to data source specification Nov 21, 2024
@kaywux kaywux added ready-for-protos add this when you want protos to compile on every commit and removed ready-for-protos add this when you want protos to compile on every commit labels Nov 21, 2024
@kaywux kaywux merged commit e277fcc into viamrobotics:main Nov 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-protos add this when you want protos to compile on every commit safe to test committer is a member of this org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants