fix: production URL + browser fallback, remove unused staging infra#6
Merged
Conversation
Three small fixes triggered by manual testing of the freshly-rebuilt binary: - DefaultServerURL was a placeholder (searchlight.io) that never existed — there is no production deploy at that hostname. Switched to searchlight.headline.com and updated all docs/tests that referenced the bogus URL. Removed staging URL examples since there is no staging deploy. - internal/oauth/flow.go now always prints the authorize URL to stderr before attempting browser.OpenURL. On WSL (and headless containers / remote SSH sessions) OpenURL frequently returns nil even when nothing opens, leaving the user staring at a blank prompt; printing the URL unconditionally lets them paste it manually. - Added /searchlight.exe to .gitignore so the cross-compiled Windows binary doesn't escape the existing /searchlight rule. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There is no staging deploy of the Searchlight server — only production. The CLI was carrying a parallel staging configuration path (separate client_id ldflag, env-var-driven routing in config.Load, a STAGING_CID Makefile variable, a SEARCHLIGHT_STAGING_CLIENT_ID GitHub secret reference, and matching test) that has never pointed at anything real. Removed everything staging-specific: - internal/config/config.go: dropped the stagingClientID variable and the staging/localhost branch in Load(); the baked-in client_id is now just prodClientID, used unconditionally when SEARCHLIGHT_CLIENT_ID is unset. - internal/config/config_test.go: removed TestLoad_SelectsStagingClientID, simplified the surrounding tests that backed up both client_id variables. - .goreleaser.yaml: removed the stagingClientID ldflag. - .github/workflows/release-please.yml: dropped the SEARCHLIGHT_STAGING_CLIENT_ID env var injected into the GoReleaser step. - .github/workflows/ci.yml: removed the staging ldflag from the smoke build. - Makefile: dropped the STAGING_CID variable from the LDFLAGS recipe. - CLAUDE.md, README.md: collapsed the "register two OAuth apps" sections into a single production-only application, removed the SEARCHLIGHT_ STAGING_CLIENT_ID mention from the pre-release setup checklist, and updated the file-purpose table + verification checklist accordingly. Tests still pass (config coverage 81.2%, above the 80% floor) and the smoke build still produces a working binary. Follow-up: the SEARCHLIGHT_STAGING_CLIENT_ID GitHub secret can now be deleted with `gh secret delete SEARCHLIGHT_STAGING_CLIENT_ID` — that's outside this commit since secret state is owned by the repo, not the codebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📊 Code Quality Score: 14/100
Scored by GitVelocity · How are scores calculated? |
📊 Code Quality Score: 13/100
Scored by GitVelocity · How are scores calculated? |
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
Two related cleanups triggered by manually testing the freshly-built CLI binary against the real server, before flipping the repo public.
Commit 1 —
fix: correct default server URL and always surface OAuth URLDefaultServerURLwas a placeholder (https://searchlight.io) that never resolved to a real deploy. The actual production host ishttps://searchlight.headline.com. Fixed the constant + all docs/tests that referenced the bogus URL.internal/oauth/flow.goonly printed the authorize URL whenbrowser.OpenURLreturned an error. On WSL (and headless containers / remote SSH sessions)OpenURLfrequently returns nil while nothing actually opens, leaving the user stuck at a blank prompt. The URL is now printed to stderr unconditionally so manual paste is always possible..gitignoreupdated so cross-compiledsearchlight.exeis covered alongsidesearchlight.Commit 2 —
chore: remove unused staging infrastructureThere is no staging deploy of the Searchlight server. The CLI was carrying a parallel staging configuration path (separate
stagingClientIDldflag, env-var-driven routing inconfig.Load, aSTAGING_CIDMakefile variable, aSEARCHLIGHT_STAGING_CLIENT_IDGitHub secret reference, and matching test) that has never pointed at anything real.Removed:
stagingClientIDvariable + thestrings.Contains(server, "staging")branch inconfig.Load()TestLoad_SelectsStagingClientIDand the staging-related cleanup in surrounding testsstagingClientIDldflag from.goreleaser.yamlSEARCHLIGHT_STAGING_CLIENT_IDenv injected into the GoReleaser workflow stepSTAGING_CIDvariable from the MakefileCLAUDE.md+README.md, plus matching tweaks in the file-purpose table and pre-release setup checklistThe
SEARCHLIGHT_STAGING_CLIENT_IDGitHub secret itself can be deleted viagh secret delete SEARCHLIGHT_STAGING_CLIENT_ID --repo headlinevc/searchlight-cli— left out of this PR because secret state is owned by the repo, not the codebase.Test plan
go test -race -cover ./...— all packages pass; config coverage 81.2% (above 80% floor)make build PROD_CID=<real-uuid>— produces working Linux binaryGOOS=windows GOARCH=amd64 go build— produces working Windows binary./searchlight version --prettyshowsserver_url: "https://searchlight.headline.com"auth loginround-trip against production succeeded (verified separately)🤖 Generated with Claude Code