feat: improve base URL configuration#532
Open
adityakrmishra wants to merge 1 commit intopalantir:developfrom
Open
feat: improve base URL configuration#532adityakrmishra wants to merge 1 commit intopalantir:developfrom
adityakrmishra wants to merge 1 commit intopalantir:developfrom
Conversation
Generate changelog in
|
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.
Addresses #5
Hi team,
This PR simplifies the client configuration by allowing users to provide a single
BaseURLfrom which the Web, APIv3, and APIv4 URLs are automatically derived, as outlined in the original issue.Key Changes:
URLsstruct andParseURLslogic (urls.go) that intelligently routes between publicgithub.comendpoints and GitHub Enterprise endpoints.Configto supportBaseURLvia YAML/JSON/Env, but existing explicit fields (WebURL,V3APIURL,V4APIURL) are preserved and take precedence if defined.NewDefaultCachingClientCreatorto utilize the newconfig.GetURLs()method.urls_test.go) covering public GitHub, Enterprise URLs (with and without schemes/stray paths), and the fallback precedence logic.The code adheres to the existing project style, and all tests pass cleanly. Let me know if you'd like any adjustments to the enterprise URL parsing logic!