refactor: centralize hardcoded URLs, storage keys, and magic numbers in lib/constants/config.ts#232
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @RavindiFernando!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR centralizes scattered hardcoded values—deploy API URLs, localStorage keys, and debounce magic numbers—into a single ChangesConfiguration and Hardcoded Value Centralization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
piyushdotcomm
left a comment
There was a problem hiding this comment.
@coderabbitai full review
Summary
lib/constants/config.ts- addedDEPLOY_API(nestedVERCEL.DEPLOYMENTS,NETLIFY.SITES,NETLIFY.deploys(siteId)) andEDITOR_CONFIG(INLINE_SUGGESTION_DEBOUNCE_MS: 1500); renamedSTORAGE_KEYSkeys toGEMINI_KEY/GROQ_KEY/MISTRAL_KEYper specapp/api/deploy/vercel/route.ts- replaced hardcoded Vercel URL withDEPLOY_API.VERCEL.DEPLOYMENTSapp/api/deploy/netlify/route.ts- replaced both hardcoded Netlify URLs withDEPLOY_API.NETLIFY.SITESandDEPLOY_API.NETLIFY.deploys(siteId)modules/playground/components/playground-editor.tsx- replaced magic number1500withEDITOR_CONFIG.INLINE_SUGGESTION_DEBOUNCE_MSmodules/playground/hooks/useAI.ts- updated allSTORAGE_KEYS.*references to use the renamed keysImportant
modules/playground/hooks/useAI.test.tswas already failing onmainbefore this PR — the suite crashes at import due tolocalStoragebeingundefinedin the jsdom/Node.js 22 environment at store initialisation time. This is a pre-existing test infrastructure issue, not introduced by this refactor. All 59 previously passing tests still pass.Type of change
Related issue
Closes #113
Validation
npm run lintnpm testnpm run buildList any additional manual verification you performed:
Screenshots or recordings
Add screenshots or short recordings for UI changes when relevant.
Checklist
Summary by CodeRabbit