perf(webapp): scope env var create pre-check to submitted keys - #4579
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (17)
🧰 Additional context used🧠 Learnings (6)📚 Learning: 2026-07-26T13:14:02.968ZApplied to files:
📚 Learning: 2026-04-15T15:39:31.575ZApplied to files:
📚 Learning: 2026-08-05T16:10:45.358ZApplied to files:
📚 Learning: 2026-07-30T18:44:03.619ZApplied to files:
📚 Learning: 2026-07-15T18:37:08.044ZApplied to files:
📚 Learning: 2026-05-14T14:54:39.095ZApplied to files:
🔇 Additional comments (1)
WalkthroughThe environment-variable repository now imports 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
EnvironmentVariablesRepository.create() ran a conflict pre-check that loaded every variable in the project and every value across all environments, just to check whether the submitted keys already had a value in the target environments. Scope the pre-check to the submitted keys and target environments (wrapped in boundedIn) so it reads a handful of rows instead of the whole project's env-var values.
7a49950 to
81520bf
Compare
Summary
Setting or importing environment variables ran a conflict pre-check that loaded every variable in the project and every value across all of its environments, only to decide whether the submitted keys already had a value in the target environments. On projects with many variables and environments that meant reading tens of thousands of rows on each create/import call.
This scopes the pre-check to the submitted keys and target environments, so it reads only the rows it actually inspects (submitted keys × target envs), wrapped in
boundedInto keep the prepared-statement cache stable. Same conflict detection, a handful of rows instead of the whole project's env-var values.