You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exported constants DEFAULT_GITHUB_CACHE_TTL_SECONDS and DEFAULT_CACHE_NAMESPACE in lib/cache-store.ts are currently hardcoded. These should be configurable from the runtime environment with safe fallbacks so deployments can tune cache behavior without code changes.
Suggested env vars (already partially supported by the code):
REDIS_CACHE_TTL_SECONDS or CACHE_TTL_SECONDS (fallback default should remain 604800)
REDIS_CACHE_NAMESPACE or CACHE_NAMESPACE (fallback default should remain "devimpact:v1")
Tasks
Update lib/cache-store.ts to derive the exported defaults from environment values at runtime rather than fixed literals, or export accessor functions that return the configured values.
Ensure the module still exposes usable defaults when env vars are missing or invalid (keep existing numeric default and namespace).
Add parsing and validation (positive integer for TTL, non-empty string for namespace) and reasonable upper bounds for TTL.
Update .env.example and README.md documenting the env vars and their defaults.
Add unit tests for the parsing/validation logic and any new accessors.
The existing helper getCacheConfigFromEnv already reads these env vars for runtime configuration; consider aligning exported defaults with that helper to avoid duplication.
Tip
🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨
The exported constants
DEFAULT_GITHUB_CACHE_TTL_SECONDSandDEFAULT_CACHE_NAMESPACEinlib/cache-store.tsare currently hardcoded. These should be configurable from the runtime environment with safe fallbacks so deployments can tune cache behavior without code changes.Suggested env vars (already partially supported by the code):
REDIS_CACHE_TTL_SECONDSorCACHE_TTL_SECONDS(fallback default should remain 604800)REDIS_CACHE_NAMESPACEorCACHE_NAMESPACE(fallback default should remain "devimpact:v1")Tasks
lib/cache-store.tsto derive the exported defaults from environment values at runtime rather than fixed literals, or export accessor functions that return the configured values..env.exampleandREADME.mddocumenting the env vars and their defaults.Notes
NEXT_PUBLIC_*).getCacheConfigFromEnvalready reads these env vars for runtime configuration; consider aligning exported defaults with that helper to avoid duplication.Tip
🚀 Want to contribute?
Comment
assign meto be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨