Skip to content

fix : add manual retry action for failed analysis jobs#2362

Open
tmdeveloper007 wants to merge 1 commit into
nisshchayarathi:mainfrom
tmdeveloper007:#2121
Open

fix : add manual retry action for failed analysis jobs#2362
tmdeveloper007 wants to merge 1 commit into
nisshchayarathi:mainfrom
tmdeveloper007:#2121

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Fixes #2121

Summary

When an analysis job enters a FAILED state, the UI showed a Retry Job button but clicking it only reloaded the page — it did not actually retry the analysis. Users had to manually navigate back and re-submit the repository URL.

Changes

  • lib/services/analysisJobService.ts: Added retryJob(params) method that resets a FAILED or DONE job to QUEUED status, clears the error, resets attempts to 0, and re-queues the job via Bull.
  • app/api/analysis-jobs/[id]/route.ts: Added POST handler that calls retryJob() after verifying the user owns the job.
  • app/analysis/[jobId]/page.tsx: Replaced window.location.reload() on the Retry button with an actual handleRetry() call that invokes the new POST endpoint.

Security Impact

Only the job owner can retry their own jobs. Non-owners receive a 404 (via enforceRepositoryPermission) and cannot manipulate other users' jobs.

Users shown a FAILED status now get a functional Retry button that calls
POST /api/analysis-jobs/<id> instead of just reloading the page.
Adds retryJob() to analysisJobService which resets the job to QUEUED
and re-queues it via Bull, allowing users to retry without re-entering
the repository URL.

Fixes nisshchayarathi#2121
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the GSSoC'26 Part of GirlScript Summer of Code 2026 label Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tmdeveloper007, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 27 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fe60a8d6-76db-4270-b254-ed75a8037479

📥 Commits

Reviewing files that changed from the base of the PR and between d53ee6b and 829e0ed.

📒 Files selected for processing (3)
  • app/analysis/[jobId]/page.tsx
  • app/api/analysis-jobs/[id]/route.ts
  • lib/services/analysisJobService.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your contribution, @tmdeveloper007!

Your PR has passed our automated GSSoC quality checks. Here's a quick summary:

Check Status
PR description ✅ Provided
PR title ✅ Meaningful
Linked issue ✅ Found
Change size ✅ Looks good (141 lines across 3 file(s))

A maintainer will review your PR soon. Please be patient and available for feedback. 💪

GSSoC'26 automation · Maintainer: @nisshchayarathi

@tmdeveloper007

Copy link
Copy Markdown
Contributor Author

CI status: Build, Type Check, Lint, CodeQL, GSSoC checks all green. Note: Unit Tests job reports a pre-existing failure in app/api/auth/sessions/tests/route.test.ts due to a Jest/ESM module compatibility issue (jose/dist/browser/index.js). This failure exists on the upstream main branch and is unrelated to this PR. Ready for merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSSoC'26 Part of GirlScript Summer of Code 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: No "Retry Analysis" action is shown when a job fails — users must manually re-enter the repository URL

1 participant