Skip to content

feat(platform): platform-first routing with legacy fallback#132

Open
steve-calvert-glean wants to merge 1 commit into
sc/platform-01-sdk-bump-v0133from
sc/platform-02-platform-pkg
Open

feat(platform): platform-first routing with legacy fallback#132
steve-calvert-glean wants to merge 1 commit into
sc/platform-01-sdk-bump-v0133from
sc/platform-02-platform-pkg

Conversation

@steve-calvert-glean

Copy link
Copy Markdown
Collaborator

New internal/platform package:

  • Legacy(): GLEAN_LEGACY_APIS=1 forces the classic client APIs
  • IsGateClosed(): detects the hidden 404 returned when a tenant has not enabled experimental platform endpoints
  • Run(): platform-first execution with a once-per-endpoint warned fallback to the legacy endpoint; non-404 errors (401/403/500) never fall back
  • GateClosedErr(): actionable error for call sites that cannot auto-fall-back (user-authored request bodies)

client.New now always sends X-Glean-Include-Experimental via glean.WithIncludeExperimental(true) — verified on the wire by an httptest-backed test. The X_GLEAN_INCLUDE_EXPERIMENTAL env var takes precedence inside the SDK.

Part 2/9.

🤖 Generated with Claude Code

New internal/platform package:
- Legacy(): GLEAN_LEGACY_APIS=1 forces classic client APIs
- IsGateClosed(): detects the hidden 404 returned when a tenant has not
  enabled experimental platform endpoints
- Run(): platform-first execution with one-time warned fallback to the
  legacy endpoint; non-404 errors never fall back
- GateClosedErr(): guidance error for call sites that cannot auto-fall-back
  (user-authored request bodies)

client.New now always sends X-Glean-Include-Experimental via
glean.WithIncludeExperimental(true); verified on the wire by an
httptest-backed test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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