hotfix(cron): invoke pending-jobs endpoint alongside evaluations#882
hotfix(cron): invoke pending-jobs endpoint alongside evaluations#882vprashrex wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 53 minutes and 42 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the 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 have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe cron invocation script is refactored to support invoking multiple API endpoints sequentially. A new ChangesMulti-endpoint cron invocation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
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)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/python/invoke-cron.py`:
- Around line 96-97: Update the log messages that currently read
logger.debug(f"Request URL: {self.base_url}{endpoint}") and
logger.debug(f"Request headers: {headers}") (and the other changed statements at
the same function: lines around 136–137, 147–151) to include the required
function-name prefix in square brackets; replace them with messages like
logger.debug(f"[<enclosing_function_name>] Request URL:
{self.base_url}{endpoint}") and logger.debug(f"[<enclosing_function_name>]
Request headers: {mask_string(headers)}") (substitute <enclosing_function_name>
with the actual name of the function/method that contains these logger calls and
mask any sensitive values using mask_string where appropriate). Ensure all four
affected logger calls use the same pattern and include the function name prefix.
- Around line 149-151: The loop over self.endpoints currently lets a raised
exception from invoke_endpoint abort the whole cycle; modify the for endpoint in
self.endpoints loop to wrap the await self.invoke_endpoint(client, endpoint)
call in a per-endpoint try/except so one failing endpoint does not stop others,
e.g. call invoke_endpoint inside try, on success log via
logger.info(f"[{endpoint}] invoked successfully: {result}"), and on except catch
the exception, log it with logger.error including endpoint and exception
details, then continue to the next endpoint; keep the outer exception handling
for cycle-level failures but ensure per-endpoint errors are handled locally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 733966bd-f710-45eb-b363-4594ffe23dc5
📒 Files selected for processing (1)
scripts/python/invoke-cron.py
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Target issue is #881
Summary
Explain the motivation for making this change. What existing problem does the pull request solve?
In the previous PR that added pending job monitoring, the invoke-cron.py script was modified locally but the changes were never pushed/included in the PR. The server-side implementation existed, but since the updated script wasn't shipped, the cron script was never calling /api/v1/cron/pending-jobs — so pending job monitoring was never actually running. This PR ships that missing change.
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.