-
Notifications
You must be signed in to change notification settings - Fork 11
chore: Readd resource workers #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes re-enable and refine the handling of release targets across several modules in the event worker. The previously commented code in the utility for upserting release targets is now active, ensuring that targets are inserted into the database with conflict handling. Additionally, both the new resource and updated resource workers have been modified: the new resource worker now processes resources by upserting release targets and queuing jobs, while the updated resource worker captures results to filter out and delete stale targets and concurrently dispatch exit hooks along with evaluation queue updates. Changes
Sequence Diagram(s)sequenceDiagram
participant NRW as newResourceWorker
participant DB as Database/upsertReleaseTargets
participant Q as Job Queue
NRW ->> DB: Call upsertReleaseTargets(db, resource)
DB -->> NRW: Return list of release targets (rts)
NRW ->> NRW: Map rts to job objects
NRW ->> Q: Enqueue jobs in bulk (queue.addBulk)
sequenceDiagram
participant URW as updatedResourceWorker
participant DB as Database (upsert & delete)
participant H as Exit Hooks/Evaluation Queue
URW ->> DB: Call upsertReleaseTargets and capture result
URW ->> URW: Filter currentReleaseTargets against upsertedReleaseTargets
URW ->> DB: Delete stale release targets (db.delete)
URW ->> H: Dispatch exit hooks & add to evaluation queue concurrently
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (1)`**/*.{ts,tsx}`: **Note on Error Handling:** Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error...
🧬 Code Graph Analysis (2)apps/event-worker/src/workers/updated-resources/index.ts (4)
apps/event-worker/src/workers/new-resource.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (5)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Summary by CodeRabbit