feat: add bragi#3428
Conversation
|
🍹 The Update (preview) for dailydotdev/api/prod (at a10d538) was successful. Resource Changes Name Type Operation
+- vpc-native-k8s-secret kubernetes:core/v1:Secret create-replacement
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-ws-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-source-tag-view-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-db-migration-9fd46e46 kubernetes:batch/v1:Job delete
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tags-str-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-history-day-clickhouse-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-clickhouse-migration-d97d9f81 kubernetes:batch/v1:Job create
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-generic-referral-reminder-cron kubernetes:batch/v1:CronJob update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-9fd46e46 kubernetes:batch/v1:Job delete
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tag-recommendations-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-db-migration-d97d9f81 kubernetes:batch/v1:Job create
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
|
| }; | ||
| } | ||
|
|
||
| parseFeedback(request: ParseFeedbackRequest): Promise<ParseFeedbackResponse> { |
There was a problem hiding this comment.
I don't think you actually need all of this wrapping in a class, and then all the methods gluing together, can maybe just do a getBragiClient as we do for Brokkr, njord and so on, it also helps with mocking during tests src/common/brokkr.ts
There was a problem hiding this comment.
@claude can you see if you can adjust this.
There was a problem hiding this comment.
Claude finished @rebelchris's task in 1m 49s —— View job
Refactoring Bragi client to follow Brokkr pattern ✅
Tasks:
- Read current Bragi client implementation
- Read Brokkr client implementation as reference
- Refactor Bragi client to follow the pattern
- Commit and push changes
Changes made:
I've refactored the Bragi client to match the Brokkr pattern as suggested:
- Removed class-based implementation: Deleted the
BragiClientclass andIBragiClientinterface - Kept the
getBragiClientfunction: This function returns the client instance, just likegetBrokkrClient - Added helper function: Created a
parseFeedbackfunction that usesgetBragiClient()with garmr wrapping, matching how Brokkr hasextractMarkdownFromCV - Cleaned up exports: Updated
index.tsto only exportgetBragiClientandparseFeedback - Removed unused file: Deleted
types.tssince the interface is no longer needed
The new structure is much simpler and easier to test, following the same pattern as other service clients in the codebase.
Note: I couldn't run the linter as pnpm isn't available in the CI environment, but the auto-lint hook should run when the changes are detected.
There was a problem hiding this comment.
@claude you don't need the wrapper function parseFeedback, remove it, just use getBragiClient directly, see parseOpportunityWithBrokkr for similar usage with getBrokkrClient
There was a problem hiding this comment.
Claude finished @capJavert's task in 1m 22s —— View job
Simplifying Bragi client to match Brokkr pattern ✅
Tasks:
- Read current Bragi client implementation
- Read Brokkr reference implementation
- Remove
parseFeedbackwrapper function - Update exports
- Commit and push changes
Changes made:
I've removed the parseFeedback wrapper function from the Bragi client to match the Brokkr pattern:
- Removed wrapper function: Deleted
parseFeedbackfromsrc/integrations/bragi/clients.ts:35-40 - Cleaned up imports: Removed unused
ParseFeedbackRequestandParseFeedbackResponseimports - Updated exports: Removed
parseFeedbackfromsrc/integrations/bragi/index.ts:1
Now callers will use getBragiClient() directly and call bragiClient.garmr.execute(() => bragiClient.instance.parseFeedback(request)), exactly like how parseOpportunityWithBrokkr uses getBrokkrClient() in src/common/opportunity/parse.ts:193-206.
Remove BragiClient class and use function-based approach instead. - Replace BragiClient class with parseFeedback helper function - Keep getBragiClient function for getting client instance - Remove unused IBragiClient interface and types.ts file - Update exports to only expose function-based API This matches the pattern used by other service clients like Brokkr. Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
Follow Brokkr pattern where callers use getBragiClient() and execute through garmr directly, instead of having intermediate wrapper functions. Co-authored-by: Ante Barić <capJavert@users.noreply.github.com>
TODO: find brokkr origin and endpoint still, but can review in essence.