Replace instance with serverURL in generated code samples#90
Draft
chris-freeman-glean wants to merge 1 commit intomainfrom
Draft
Replace instance with serverURL in generated code samples#90chris-freeman-glean wants to merge 1 commit intomainfrom
chris-freeman-glean wants to merge 1 commit intomainfrom
Conversation
Update code sample transformer to use hardcoded serverURL values instead of instance environment variables across Python, TypeScript, Go, and Java code samples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates generated code samples from using
instancetoserverURLas the primary configuration parameter. This is part of a broader effort to promoteserverURLas the primary way users configure their Glean SDK, replacing theinstanceconcept in all documentation and examples.What changed
addInstanceToCodeSamples→addServerURLToCodeSamplesinsrc/code-sample-transformer.jsserverURLinstead ofinstanceconfigurationWhy this goes first
This change must land before Speakeasy SDK regeneration (Phase 3) so that regenerated READMEs automatically use
serverURLin their code samples.Language-specific code sample changes
instance=os.environ.get("GLEAN_INSTANCE")server_url="mycompany-be.glean.com"instance: process.env["GLEAN_INSTANCE"]serverURL: "mycompany-be.glean.com"apiclientgo.WithInstance(os.Getenv("GLEAN_INSTANCE"))apiclientgo.WithServerURL("mycompany-be.glean.com").instance("<value>").serverURL("mycompany-be.glean.com")Backwards compatibility
The
instanceparameter remains in the generated SDK code (from the OpenAPI spec transformer). This change only affects documentation/examples — no breaking changes.Test plan