Repository navigation
merg jules - #169
merg jules#169sjoerd2025 wants to merge 40 commits into
Conversation
…on-1476546773550709856 ⚡ Optimize webhook performance with batch operations
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Batched repository upserts in `syncInstallation` to reduce N+1 queries. - Replaced iterative deletion with `deleteMany` in `cleanupSuspendedInstallations`. - Added `src/lib/installation-service.test.ts` to verify behavior. Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds angular-standards (testing & docs enforcement), angular-best-practices, angular-migration, and ng-update from sjoerd2025/cli-docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…y-upsert-1394745518843308883 Refactor: extract duplicate repository upsert logic
…082335678021 ⚡ Optimize retryAllFlaggedTasks to avoid redundant DB fetch
…020874637062 🧪 Add tests for getInstallationStatus
…tar-check-7064352253284591806 🔒 Security: Fix DoS vulnerability in checkIfUserStarredRepository
…service-10460793182449338768 ⚡ Bolt: Optimize Installation Service Sync and Cleanup
…8792540152619938779 Refactor: remove leftover debug logging in label setup handler
…17552834892220776312 refactor: remove debug logging in installation status handler
…96648701832816 🧪 Add tests for src/lib/number.ts
…ts-4789700094769845220 🧪 Testing Improvement: Add tests for crypto.ts
…484581071 Secure tasks router endpoints with adminProcedure
…ts-12691864612353580486 🧪 Testing Improvement: Add tests for crypto utility
…1252433783763 🔒 Fix timing attack in cron secret verification
…ueries Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
…797207216585041 ⚡ Bolt: optimize rate-limiter.ts to prevent TOCTOU race condition
Fixes N+1 API querying and sequentially-blocking operations inside `syncAllInstallations` by pre-fetching the necessary data globally and executing batched synchronization chunks concurrently. Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Replaced manual findUnique and conditionally update/create pattern with a single Prisma upsert call in src/lib/jules.ts. This reduces database round-trips from two to one. Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
Refactored the repository removal handler in \`src/app/api/webhooks/github-app/route.ts\` to use a single \`updateMany\` query with Prisma's \`in\` operator instead of executing multiple separate queries within a \`Promise.all\`. This eliminates N+1 query bottlenecks during bulk uninstallation or repository access removal events. Co-authored-by: sjoerd2025 <244033076+sjoerd2025@users.noreply.github.com>
…sk-12040283002622463515 ⚡ Bolt: Refactor manual upsert to use Prisma native upsert for JulesTask
…al-11189785954534146822 ⚡ Bolt: Optimize bulk repository removal
…ions-3088437305465949765 ⚡ Bolt: Optimize syncAllInstallations performance
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8ef5c0130
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -712,7 +711,7 @@ export async function retryAllFlaggedTasks( | |||
| const task = queue.shift(); | |||
| if (!task) break; | |||
| try { | |||
| const success = await processTaskRetry(task.id); | |||
| const success = await processTaskRetry(task); | |||
There was a problem hiding this comment.
Revalidate queued tasks before processing snapshots
If another retry run or an admin update clears flaggedForRetry after getFlaggedTasks() returns but before this worker reaches the row, passing the snapshot skips processTaskRetry's database re-read and still sees flaggedForRetry: true; it can swap labels and resubmit a task that was already completed or cancelled. Keep passing the ID or re-read the task immediately before the side effects.
Useful? React with 👍 / 👎.
| }); | ||
|
|
||
| // Batch create labels in the repositories | ||
| await createJulesLabelsForRepositories( |
There was a problem hiding this comment.
Defer large label batches out of the webhook transaction
For an installation_repositories event with the all label preference and 601 or more added repositories, the helper sleeps one second between 10-repository batches (src/lib/github-labels.ts:121-150), so the pauses alone consume at least 60 seconds before any API-call time. This exceeds the webhook route's 60-second Vercel maxDuration (vercel.json:12-14), leaving later repositories unlabeled and the transaction unfinished; queue or checkpoint this work instead of awaiting the full batch in the webhook.
Useful? React with 👍 / 👎.
| if (page > MAX_PAGES) { | ||
| logger.warn( | ||
| `Stopped checking user stars for ${username} after ${MAX_PAGES} pages. Target: ${targetOwner}/${targetRepo}` | ||
| ); | ||
| break; |
There was a problem hiding this comment.
Do not report an incomplete star scan as a negative
If the target repository falls beyond the first 2,000 starred repositories, this breaks out and returns false even when the user has starred it. The star-check route treats that as a negative and sends the user to limbo instead of label setup, so an already-starred installation cannot complete; treat the cutoff as indeterminate or check the target repository directly.
Useful? React with 👍 / 👎.
No description provided.