Kevin Turcios
d7a8b8f227
perf: fix CI build + lazy-load heavy libs + parallelize DB queries ( #2601 )
...
## Summary
- **Fix CI build failure**: Auth0Client crashes during Next.js
prerendering when env vars aren't set. Returns a no-op stub (`getSession
→ null`) when domain is missing — semantically correct for static
generation
- **Lazy-load markdown libs (~260kb)**: ReactMarkdown, remarkGfm, and
react-syntax-highlighter were eagerly imported in monaco-diff-viewer but
only rendered when user expands "Generated Tests". Extracted into a
dynamic component
- **Parallelize repo detail query**: `getRepositoryById` ran the
activity count sequentially after the repo lookup. Since `repoId` is
already available, all three queries now run in parallel
## Test plan
- [ ] CI `build` check passes (was failing since #2598 )
- [ ] Trace page still renders generated tests correctly when expanded
- [ ] Repository detail page loads correctly with activity status
2026-04-13 11:03:05 -05:00
Sarthak Agarwal
f48531fb14
cf-api fix ( #1512 )
...
### **PR Type**
- Enhancement
- Bug fix
___
### **Description**
- Update ES module import paths with explicit .js extensions.
- Refactor function signatures and type annotations for TypeScript.
- Wrap Express app with @awaitjs/express for async support.
- Upgrade package configurations and tsconfig settings.
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>6
files</summary><table>
<tr>
<td><strong>diff_utils.test.ts</strong><dd><code>Adjust import paths to
include .js extensions.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-c0991313f3fcb63fa2a553856b85d7df03e6d99cf98d19277fe689025f89ede1 ">+2/-2</a>
</td>
</tr>
<tr>
<td><strong>create-pr-from-diffcontents.ts</strong><dd><code>Update
import paths and adjust Octokit typing.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-b30d5e0c89beb70c0333a025726867aba5db7614911be3c46664bb59d1ab594a ">+12/-11</a>
</td>
</tr>
<tr>
<td><strong>index.ts</strong><dd><code>Use @awaitjs/express wrap to
create AsyncExpressApp.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-c3e60be1461b6e80f9181080342927fd9df095197e8784ae0ff51daaec8d71d5 ">+7/-5</a>
</td>
</tr>
<tr>
<td><strong>setupAction.ts</strong><dd><code>Update workflow setup
action and adjust GitHub API usage.</code></dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-88c84a935a854855fb103dbf560f6ed5ea2e73e45750c97b5a3b901a5f9399a2 ">+5/-3</a>
</td>
</tr>
<tr>
<td><strong>types.d.ts</strong><dd><code>Add new type definitions for
Octokit and AsyncExpressApp.</code></dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-370b1e96082f265e191b7aac76caa9feb60d32d56c36a2924725200b3d41f423 ">+45/-0</a>
</td>
</tr>
<tr>
<td><strong>types.ts</strong><dd><code>Remove obsolete types; migrate to
types.d.ts.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-8d1257d2e60e56e9c02c59b85078e89ad41af60267b02842daf203da3231902f ">+0/-6</a>
</td>
</tr>
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>4 files</summary><table>
<tr>
<td><strong>is-github-app-installed.ts</strong><dd><code>Add ts-ignore
and adjust GitHub app installation endpoint.</code></dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-4b97bd2b461108930999b4af7e47d4763ad1b9490f7352130109c39f5abf4561 ">+1/-0</a>
</td>
</tr>
<tr>
<td><strong>suggest-pr-changes.ts</strong><dd><code>Refactor types, cast
Octokit instance, and update parameters.</code></dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-b4a862986fd70827b8dabcb3157972bd0d5d507cf9c12e5fbf56f24979d073f3 ">+22/-15</a>
</td>
</tr>
<tr>
<td><strong>check-valid-api-key.ts</strong><dd><code>Refine middleware
typing with NextFunction.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-c04a6087bbabce916c7547acf14c186caf7af3ec6ff68b7e49102c3fe87e453c ">+9/-3</a>
</td>
</tr>
<tr>
<td><strong>track-usage.ts</strong><dd><code>Change Request type to
AuthorizedUserReq in usage tracker.</code></dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-9248228a33147544ca9b58ff8b9c737b33763dd3e29717c82c38808bb7e34db3 ">+2/-1</a>
</td>
</tr>
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>2 files</summary><table>
<tr>
<td><strong>package.json</strong><dd><code>Upgrade dependencies and
refine build/deploy scripts.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-53ddfb1f8a02f1231d3d15a2e694ffe1407d2cc01d3e685de5653b67fec571c7 ">+8/-3</a>
</td>
</tr>
<tr>
<td><strong>tsconfig.json</strong><dd><code>Modify module, strict, and
lib options for NodeNext.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-3532a852c82c88daeed6b57a35cd52c4a2589c909edc756613d67e280ab9b23e ">+6/-5</a>
</td>
</tr>
</table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>1
files</summary><table>
<tr>
<td><strong>migration.sql</strong><dd><code>Add placeholder migration
for rolled back changes.</code>
</dd></td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1512/files#diff-98f5513f409a695839ec0bb0ee8e77d3c858e26c30db2113a83973dc1fa46c25 ">+1/-0</a>
</td>
</tr>
</table></details></td></tr></tr></tbody></table>
___
> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/ ">documentation</a>
for more information.</li></details>
2025-03-12 22:30:10 +00:00