Skip to content

SDK method generator drops Go tabs for methods inherited via embedded interfaces (gripper CurrentInputs/GoToInputs) #5192

Description

@btshrewsbury-viam

Summary

update_sdk_methods.py scrapes each resource's own pkg.go.dev page for Go methods. When a Go method is inherited via an embedded interface, pkg.go.dev renders it on the interface's page rather than inline on the resource page, so the scraper can't find it and drops the Go tab. The pre-existing guard in the generator intentionally blanks the method in that case (to avoid a KeyError), so the affected Go documentation silently disappears on the next regeneration.

Concrete case

The gripper page (static/include/components/apis/generated/gripper.md) documents GetCurrentInputs and GoToInputs. The Go Gripper interface really does implement both — via the embedded framesystem.InputEnabled interface:

  • components/gripper/gripper.gotype Gripper interface { … framesystem.InputEnabled }
  • robot/framesystem/framesystem.goInputEnabled declares CurrentInputs(...) and GoToInputs(...)

On pkg.go.dev these now render under the embedded InputEnabled interface link, not as inline methods on the gripper package, so the scraper misses them.

Impact

  • After a full regeneration (see Document GetStatus across component and service APIs #5184), the gripper GetCurrentInputs / GoToInputs sections lose their Go tab. Python and TypeScript tabs remain.
  • These are the only pages in the entire docs site that document these two methods, so their Go documentation disappears from docs.viam.com entirely. Arm and gantry (which also embed InputEnabled) never documented them, so nothing backfills the gap.

Root cause (generator)

The blanking guard already on main in update_sdk_methods.py:

## …gripper's CurrentInputs/GoToInputs, which are inherited via
## framesystem.InputEnabled and documented on that interface's
## page, not the gripper page. If the scraper did not find the
## mapped method for a given SDK, treat that SDK as not having it…
if go_method_name and "go" in sdks and go_method_name not in methods['go'][type].get(resource, {}):
    go_method_name = ''

This correctly prevents a crash, but the accepted behavior is that valid Go docs get dropped.

Proposed fix

Teach the Go scraper to follow embedded interfaces (at minimum framesystem.InputEnabled) and attribute the inherited methods (CurrentInputs, GoToInputs) back to the embedding resource, so the Go tab is restored durably.

Acceptance:

  • Regenerate and diff — confirm the gripper GetCurrentInputs/GoToInputs Go tabs return and no other page changes (arm/gantry/etc. unaffected).
  • No new WARNING: … not found in Go SDK docs for these methods.

Context

Surfaced while reviewing #5184 (Document GetStatus across component and service APIs). Not caused by that PR — it's pre-existing generator behavior that #5184's regeneration makes visible. Filing separately so #5184 stays scoped to GetStatus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions