Skip to content

Un-namespace platform SDK groups (glean.agents.search())#119

Closed
travis-hoover-glean wants to merge 1 commit into
mainfrom
unnamespace-platform-sdk-groups
Closed

Un-namespace platform SDK groups (glean.agents.search())#119
travis-hoover-glean wants to merge 1 commit into
mainfrom
unnamespace-platform-sdk-groups

Conversation

@travis-hoover-glean

Copy link
Copy Markdown
Contributor

What

Downstream SDKs currently generate platform endpoints under a redundant platform namespace, e.g. glean.platform.agents.search() (see gleanwork/api-client-typescript#130). This makes them top-level instead: glean.agents.search().

Why

The platform namespace comes entirely from the x-speakeasy-group extension (platform.agents, platform.search, ...), which Speakeasy turns into a nested SDK namespace. That group is derived in source-spec-transformer.js from the x-glean-sdk.group source contract that scio provides.

Changes

  • src/source-spec-transformer.js — strip the leading platform. segment when deriving x-speakeasy-group (sdk.group.replace(/^platform\./, '')). scio still sends platform.agents as the source contract; only the derived SDK grouping is un-namespaced. The existing validation pattern guarantees at least one segment remains after platform..
  • Regenerated specs (generated_specs/platform.yaml, overlayed_specs/glean-merged-spec.yaml, overlayed_specs/glean-platform-api-specs.yaml) so platform.agentsagents, platform.searchsearch.
  • Tests updated to expect the un-namespaced groups (source-spec-transformer.test.js, post_transform_smoke.test.js).

Notes

  • Breaking change for the platform SDK surface (glean.platform.*glean.*); should land with an SDK major bump / changelog and coordinated downstream regeneration.
  • No collision risk in the merged SDK: client stays under client.*, indexing under indexing.*, so top-level agents/search don't clash.
  • Regeneration also drops stale skills endpoints that were removed from source in Remove skills operations from post-transform smoke test #118 but never regenerated in the committed artifacts. CI would remove these on the next transform regardless.
  • All 70 tests pass; prettier clean.

Platform endpoints currently generate under a redundant `platform`
namespace (glean.platform.agents.search()). Strip the leading
`platform.` segment when deriving `x-speakeasy-group` from the
`x-glean-sdk.group` source contract so Speakeasy emits top-level SDK
namespaces instead (glean.agents.search()).

- src/source-spec-transformer.js: drop the `platform.` prefix from the
  derived x-speakeasy-group. scio keeps sending the platform-prefixed
  group as the source contract; only the SDK grouping is un-namespaced.
- Regenerate generated_specs/platform.yaml and the overlayed merged /
  platform specs. Regeneration also drops the stale `skills` endpoints
  that were removed from source in #118 but never regenerated.
- Update transformer + smoke tests to expect the un-namespaced groups.
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.

1 participant