Skip to content

RSDK-7229 add machine_id to cloud metadata #585

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

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

maximpertsov
Copy link
Contributor

@maximpertsov maximpertsov commented Apr 12, 2024

Breaking change! Not anymore!

Add machine_id to the get_cloud_metadata robot client method. Also change the return type and rename robot_part_id to machine_part_id for clarity. We are just deprecating the duplicate field instead.

Depends on:

@maximpertsov maximpertsov force-pushed the RSDK-7229-machine-id branch from ace4005 to 34bd29a Compare April 17, 2024 14:14
@maximpertsov maximpertsov marked this pull request as ready for review April 17, 2024 15:12
@maximpertsov maximpertsov requested a review from a team as a code owner April 17, 2024 15:12
@maximpertsov maximpertsov requested review from njooma and stuqdog April 17, 2024 15:12
Comment on lines 56 to 63
@dataclass
class CloudMetadata:
"""App-related information about the robot"""

primary_org_id: str
location_id: str
machine_id: str
machine_part_id: str
Copy link
Member

Choose a reason for hiding this comment

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

I would rather use a TypeAlias here rather than creating a new type, especially since everything simply mirrors the GetCloudMetadataResponse anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would making a TypeAlias expose the robot_part_id field on GetCloudMetadataResponse too? this is a duplicate of machine_part_id - we left it to prevent a breaking proto change

Copy link
Member

Choose a reason for hiding this comment

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

Yes it would. So if you're trying to hide that field, then sure you can create a dataclass. But this is a brewaking change in all the SDKs anyway, so maybe might as well make it a breaking proto change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's fair - I guess there was a feeling that breaking protos is a bit more significant than breaking the client method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

discussed IRL - we're gonna explicitly deprecate the proto field but leave it in: viamrobotics/api#487

Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

lgtm (modulo Naveed's comment)

@maximpertsov maximpertsov requested a review from njooma April 19, 2024 14:06
@maximpertsov maximpertsov merged commit 7063337 into viamrobotics:main Apr 19, 2024
12 checks passed
@maximpertsov maximpertsov deleted the RSDK-7229-machine-id branch April 19, 2024 16:20
njooma pushed a commit to njooma/viam-python-sdk that referenced this pull request Apr 23, 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.

3 participants