Skip to content

feat: add bragi#3428

Merged
rebelchris merged 7 commits intomainfrom
feat-bragi
Jan 12, 2026
Merged

feat: add bragi#3428
rebelchris merged 7 commits intomainfrom
feat-bragi

Conversation

@rebelchris
Copy link
Copy Markdown
Contributor

TODO: find brokkr origin and endpoint still, but can review in essence.

@pulumi
Copy link
Copy Markdown

pulumi Bot commented Jan 12, 2026

🍹 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

Comment thread src/integrations/bragi/clients.ts Outdated
@rebelchris rebelchris requested a review from capJavert January 12, 2026 09:53
Comment thread src/integrations/bragi/clients.ts Outdated
};
}

parseFeedback(request: ParseFeedbackRequest): Promise<ParseFeedbackResponse> {
Copy link
Copy Markdown
Contributor

@capJavert capJavert Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude can you see if you can adjust this.

Copy link
Copy Markdown

@claude claude Bot Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Removed class-based implementation: Deleted the BragiClient class and IBragiClient interface
  2. Kept the getBragiClient function: This function returns the client instance, just like getBrokkrClient
  3. Added helper function: Created a parseFeedback function that uses getBragiClient() with garmr wrapping, matching how Brokkr has extractMarkdownFromCV
  4. Cleaned up exports: Updated index.ts to only export getBragiClient and parseFeedback
  5. Removed unused file: Deleted types.ts since 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.

View commit |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude you don't need the wrapper function parseFeedback, remove it, just use getBragiClient directly, see parseOpportunityWithBrokkr for similar usage with getBrokkrClient

Copy link
Copy Markdown

@claude claude Bot Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 parseFeedback wrapper 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:

  1. Removed wrapper function: Deleted parseFeedback from src/integrations/bragi/clients.ts:35-40
  2. Cleaned up imports: Removed unused ParseFeedbackRequest and ParseFeedbackResponse imports
  3. Updated exports: Removed parseFeedback from src/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.

View commit |

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>
@rebelchris rebelchris requested a review from capJavert January 12, 2026 10:04
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>
@rebelchris rebelchris enabled auto-merge (squash) January 12, 2026 10:20
@rebelchris rebelchris disabled auto-merge January 12, 2026 10:22
@rebelchris rebelchris merged commit 847607b into main Jan 12, 2026
11 checks passed
@rebelchris rebelchris deleted the feat-bragi branch January 12, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants