-
Notifications
You must be signed in to change notification settings - Fork 5
fix: error boundary, NavLink remount, env var standardization, useQuery refactor #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DevanshuNEU
merged 6 commits into
OpenCodeIntel:main
from
DevanshuNEU:fix/p0-and-p1-sprint
Feb 20, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0ae310d
feat: add React Error Boundary to prevent white-screen crashes
DevanshuNEU 4462c6f
fix: NavLink remount bug, standardize Docker env vars
DevanshuNEU 8464527
fix: align supabase_service.py env var fallback to SUPABASE_ANON_KEY
DevanshuNEU b9817f3
refactor: replace fetch-in-useEffect with useQuery for repo list
DevanshuNEU 4f5fb27
fix: address CodeRabbit review findings -- 6 issues
DevanshuNEU 3010c16
fix: .env.example inline comments parsed as values, remove unused fir…
DevanshuNEU File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| """ | ||
| Startup environment validation. | ||
| Fails fast with clear error messages if required config is missing. | ||
| """ | ||
| import os | ||
| import sys | ||
| from typing import List, Tuple | ||
|
|
||
| from services.observability import logger | ||
|
|
||
|
|
||
| # (env_var_name, description) | ||
| REQUIRED_VARS: List[Tuple[str, str]] = [ | ||
| ("SUPABASE_URL", "Supabase project URL"), | ||
| ("SUPABASE_ANON_KEY", "Supabase anon/public key"), | ||
| ("SUPABASE_JWT_SECRET", "Supabase JWT secret for token verification"), | ||
| ("OPENAI_API_KEY", "OpenAI API key for embeddings"), | ||
| ("PINECONE_API_KEY", "Pinecone API key for vector storage"), | ||
| ] | ||
|
|
||
| OPTIONAL_VARS: List[Tuple[str, str, str]] = [ | ||
| ("SUPABASE_SERVICE_ROLE_KEY", "Supabase service role key", "Using anon key as fallback"), | ||
| ("COHERE_API_KEY", "Cohere API key for reranking", "Search reranking disabled"), | ||
| ("VOYAGE_API_KEY", "Voyage AI key for code embeddings", "Using OpenAI embeddings"), | ||
| ("SENTRY_DSN", "Sentry DSN for error tracking", "Error tracking disabled"), | ||
| ("REDIS_HOST", "Redis host for caching", "Using default localhost"), | ||
| ] | ||
|
|
||
|
|
||
| def validate_environment() -> None: | ||
| """Check required env vars exist. Log warnings for optional ones.""" | ||
| missing: List[str] = [] | ||
|
|
||
| for var_name, description in REQUIRED_VARS: | ||
| value = os.getenv(var_name) | ||
| if not value: | ||
| missing.append(f" {var_name} -- {description}") | ||
|
|
||
| if missing: | ||
| msg = "Missing required environment variables:\n" + "\n".join(missing) | ||
| msg += "\n\nSee .env.example for configuration reference." | ||
| logger.error(msg) | ||
| print(f"\n[FATAL] {msg}\n", file=sys.stderr) | ||
| sys.exit(1) | ||
|
|
||
| # warn about optional vars | ||
| for var_name, description, fallback_msg in OPTIONAL_VARS: | ||
| if not os.getenv(var_name): | ||
| logger.warning(f"{var_name} not set ({description}). {fallback_msg}") | ||
|
|
||
| logger.info("Environment validation passed") |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.