From 03cd1e17c51024d824f6abe9fe7c8bbddd2e97d5 Mon Sep 17 00:00:00 2001 From: Brandon Shrewsbury Date: Mon, 13 Jul 2026 15:39:13 -0600 Subject: [PATCH] Scrape gripper Go CurrentInputs/GoToInputs via InputEnabled interface The Go method scraper reads each resource's own pkg.go.dev page. Methods inherited via the embedded framesystem.InputEnabled interface (CurrentInputs, GoToInputs) render on the interface's page, not the resource's, so the inline scraper misses them and a pre-existing guard blanks the Go tab on regeneration. This dropped the only Go documentation for gripper's GetCurrentInputs/GoToInputs from the docs site. parse_go.py already special-cases the InputEnabled block but only added Kinematics. Add CurrentInputs and GoToInputs there too, matching the interface's actual methods. Add both to the Go unused-method ignore list in update_sdk_methods.py so arm/gantry (which embed InputEnabled but do not map these in the CSV) do not raise spurious coverage warnings. Verified by regenerating gripper (Go tabs restored with correct signatures and links) and arm/gantry (no new sections, no unused warnings, Kinematics intact). Fixes #5192 --- .github/workflows/parse_go.py | 12 +++++++++++- .github/workflows/update_sdk_methods.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/parse_go.py b/.github/workflows/parse_go.py index 2a0b2d5a6c..6d3cb8f1a4 100755 --- a/.github/workflows/parse_go.py +++ b/.github/workflows/parse_go.py @@ -365,7 +365,9 @@ def parse(self, type, viam_resources): self.go_methods[type][resource]['Readings']['code_sample'] = code_sample[0].find_next('pre').text.replace("\t", " ") ## Similarly, if the resource being considered inherits from framesystem.InputEnabled (Arm, for example), - ## then add the one inherited method manually: Kinematics(): + ## then add its three inherited methods manually: Kinematics(), CurrentInputs(), and GoToInputs(). + ## These are documented on the framesystem.InputEnabled interface page, not the resource's own + ## pkg.go.dev page, so the inline method scraper above does not find them. if '\tframesystem.InputEnabled' in resource_interface.text: self.go_methods[type][resource]['Kinematics'] = {'proto': 'GetKinematics', \ 'description': 'Kinematics returns the kinematics model of the resource.', \ @@ -374,6 +376,14 @@ def parse(self, type, viam_resources): code_sample = resource_soup.find_all(lambda code_sample_tag: code_sample_tag.name == 'p' and "Kinematics example:" in code_sample_tag.text) if code_sample: self.go_methods[type][resource]['Kinematics']['code_sample'] = code_sample[0].find_next('pre').text.replace("\t", " ") + self.go_methods[type][resource]['CurrentInputs'] = {'proto': 'GetCurrentInputs', \ + 'description': 'CurrentInputs returns the current inputs of the resource.', \ + 'usage': 'CurrentInputs(ctx context.Context) ([]referenceframe.Input, error)', \ + 'method_link': 'https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#InputEnabled'} + self.go_methods[type][resource]['GoToInputs'] = {'proto': 'GoToInputs', \ + 'description': 'GoToInputs moves the resource to the specified inputs, in order.', \ + 'usage': 'GoToInputs(ctx context.Context, inputSteps ...[]referenceframe.Input) error', \ + 'method_link': 'https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#InputEnabled'} ## For SLAM service only, additionally fetch data for two helper methods defined outside of the resource's interface: if resource == 'slam': diff --git a/.github/workflows/update_sdk_methods.py b/.github/workflows/update_sdk_methods.py index 47778dfcf6..25f24e3b86 100755 --- a/.github/workflows/update_sdk_methods.py +++ b/.github/workflows/update_sdk_methods.py @@ -772,7 +772,7 @@ def check_for_unused_methods(methods, type): if resource in ["data_sync", "dataset", "data"]: continue if lang == "python" and method not in ["from_robot", "close", "get_resource_name", "get_geometries", "do_command", "proto", "transform", "updated_fields", "ListUUIDs", "GetTransform", "StreamTransformChanges", "DoCommand"] or \ - lang == "go" and method not in ["Reconfigure", "ListTunnels", "Close", "DoCommand", "CurrentPosition", "AddTagsToBinaryDataByFilter", "RemoveTagsFromBinaryDataByFilter"] or \ + lang == "go" and method not in ["Reconfigure", "ListTunnels", "Close", "DoCommand", "CurrentPosition", "AddTagsToBinaryDataByFilter", "RemoveTagsFromBinaryDataByFilter", "CurrentInputs", "GoToInputs"] or \ lang == "flutter" and method not in ["getResources", "getStream", "getStreamOptions", "resetStreamOptions", "setStreamOptions", "Discovery.fromProto", "addCallbacks", "getResource"] or \ lang == "typescript" and method not in ["connect", "disconnect", "dial", "isConnected", "discoverComponents", "createServiceClient", "getRoverRentalRobots", "doCommand"]: print(f"WARNING: {lang} {type} {resource} {method} is unused")