Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces environment-aware API endpoint management to support both production and staging environments. It centralizes URL definitions in the common package and updates all API calls throughout the codebase to use environment-specific URLs. The Kindling HTTP client is also modified to disable domain fronting in staging mode and add the staging server to proxyless hosts.
Changes:
- Added environment detection (
Stage()) and URL getter functions (GetProServerURL(),GetBaseURL()) in the common package - Replaced hardcoded API URLs across multiple modules with calls to centralized URL getter functions
- Modified Kindling client to handle staging environments differently (disabling domain fronting)
- Added
Set()function to env package for runtime environment variable updates - Removed unused
sing-dnsdependency - Increased max uncompressed log size from 40 MB to 50 MB in issue reporter
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| common/constants.go | Added URL constants for production and staging, with getter functions |
| common/init.go | Added Stage() function for staging environment detection |
| common/env/env.go | Added Set() function for runtime environment variable updates |
| kindling/client.go | Modified to disable domain fronting and use different transports in staging |
| api/api.go | Updated to use centralized URL getters for pro-server and base URLs |
| api/subscription.go | Updated Stripe billing portal URL to use GetProServerURL() |
| api/user.go | Updated OAuth and streaming URLs to use GetBaseURL() |
| config/fetcher.go | Updated config endpoint URL to use GetBaseURL() |
| issue/issue.go | Updated issue reporting URL to use GetBaseURL(); increased max log size |
| go.mod, go.sum | Removed unused sing-dns dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
garmr-ulfr
reviewed
Feb 13, 2026
garmr-ulfr
reviewed
Feb 13, 2026
garmr-ulfr
reviewed
Feb 17, 2026
garmr-ulfr
approved these changes
Feb 18, 2026
Contributor
Author
|
Pulling this 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.
This pull request refactors how API endpoint URLs are managed throughout the codebase, introducing environment-aware URL selection to support both production and staging environments. The changes centralize URL definitions and logic in the
commonpackage, replacing hardcoded URLs in multiple modules. Additionally, the Kindling client is updated to handle staging environments more gracefully, and a utility function for setting environment variables in-memory is added.Environment-aware URL management:
ProServerURL,StageProServerURL,BaseURL, andStageBaseURLconstants and correspondingGetProServerURL()andGetBaseURL()functions tocommon/constants.gofor dynamic selection of API endpoints based on environment. Also added aStage()function incommon/init.goto detect staging mode. [1] [2]api/api.go,api/subscription.go,api/user.go,config/fetcher.go, andissue/issue.gowith calls to the newcommon.GetProServerURL()andcommon.GetBaseURL()functions, ensuring correct URLs are used for production or staging. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Kindling client improvements:
kindling/client.goso that when running in staging, domain fronting is disabled and the staging API endpoint is added to proxyless hosts, improving reliability against staging server issues.Environment variable utilities:
Setfunction tocommon/env/env.goto allow in-memory and OS-level updates of environment variables, making it easier to change environment settings at runtime for testing or configuration purposes.These changes make the codebase more flexible and robust when switching between production and staging environments, and reduce the risk of errors from hardcoded URLs.