Skip to content

chore: remove eventrouter and tinybird references#2705

Merged
chronark merged 1 commit intomainfrom
tinybird-removel-in-agent
Dec 5, 2024
Merged

chore: remove eventrouter and tinybird references#2705
chronark merged 1 commit intomainfrom
tinybird-removel-in-agent

Conversation

@chronark
Copy link
Collaborator

@chronark chronark commented Dec 5, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Removed event routing functionality, simplifying event processing within the application.
  • Configuration Changes

    • Eliminated eventRouter configurations across various environment files, streamlining setup options.
  • API Enhancements

    • Updated the listKeys API to include a new optional externalId parameter, improving key filtering capabilities.
  • Documentation Updates

    • Revised configuration documentation to reflect the removal of eventRouter settings.
  • Logging Improvements

    • Changed logging method from console.log to console.info for better log categorization.
  • Deployment Adjustments

    • Updated Docker Compose configurations to remove TINYBIRD_TOKEN and enhance service command parameters.

@vercel
Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 8:22am
engineering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 8:22am
play ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 8:22am
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 8:22am

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2024

⚠️ No Changeset found

Latest commit: d143611

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2024

📝 Walkthrough

Walkthrough

This pull request introduces significant changes to the agent's event routing capabilities by removing the event router service and its associated configurations across multiple files. Key components such as the eventrouter.Service, its configuration in JSON files, and related metrics have been eliminated, resulting in a streamlined codebase. Additionally, the tinybird integration has been fully removed, affecting how events are processed and logged within the application.

Changes

File Change Summary
apps/agent/cmd/agent/agent.go Removed imports for time and tinybird, eliminated event router initialization and error handling.
apps/agent/config.docker.json Removed eventRouter configuration section from services.
apps/agent/config.production.json Removed eventRouter configuration section from services.
apps/agent/config.staging.json Removed eventRouter configuration section from services.
apps/agent/pkg/api/server.go Removed WithEventRouter method from Server struct.
apps/agent/pkg/config/agent.go Removed EventRouter and Tinybird structs from Agent struct.
apps/agent/pkg/prometheus/metrics.go Removed EventRouterFlushedRows metric.
apps/agent/pkg/testutils/containers/agent.go Removed TINYBIRD_TOKEN from Env map in ContainerRequest.
apps/agent/pkg/tinybird/tinybird.go Deleted the entire file containing Client struct and its methods.
apps/agent/schema.json Removed eventRouter property from services object.
apps/agent/services/eventrouter/service.go Deleted the entire file containing the event router service implementation.
apps/api/src/routes/v1_apis_listKeys.ts Updated request parameters, added externalId, enhanced limit, and refined error handling.
apps/docs/contributing/services/agent/configuration.mdx Removed eventRouter configuration section from documentation.
apps/workflows/src/index.ts Changed logging from console.log to console.info.
deployment/docker-compose.yaml Removed TINYBIRD_TOKEN from agent service; updated planetscale and api service configurations.

Possibly related PRs

Suggested labels

🕹️ oss.gg

Suggested reviewers

  • mcstepp
  • perkinsjr
  • MichaelUnkey

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
apps/api/src/routes/v1_apis_listKeys.ts (2)

Line range hint 40-43: Consider removing the deprecated ownerId parameter

The ownerId query parameter is marked as deprecated in favor of externalId. Since the ownerId field is planned to be removed in the future, consider removing it now to simplify the codebase and reduce maintenance overhead.

I recall from previous learnings that handling externalId and ownerId separately was intentional for clarity, but the plan was to remove ownerId eventually. This might be an appropriate time to proceed with that change.


Line range hint 214-218: Optimize the count query for performance on large datasets

Using count(*) on large tables can be inefficient due to full table scans, which may impact performance. Consider optimizing the count operation by leveraging indexed columns or using approximate counting methods if exact precision is not critical.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between cf5955e and d143611.

📒 Files selected for processing (15)
  • apps/agent/cmd/agent/agent.go (0 hunks)
  • apps/agent/config.docker.json (0 hunks)
  • apps/agent/config.production.json (0 hunks)
  • apps/agent/config.staging.json (0 hunks)
  • apps/agent/pkg/api/server.go (0 hunks)
  • apps/agent/pkg/config/agent.go (0 hunks)
  • apps/agent/pkg/prometheus/metrics.go (0 hunks)
  • apps/agent/pkg/testutils/containers/agent.go (0 hunks)
  • apps/agent/pkg/tinybird/tinybird.go (0 hunks)
  • apps/agent/schema.json (0 hunks)
  • apps/agent/services/eventrouter/service.go (0 hunks)
  • apps/api/src/routes/v1_apis_listKeys.ts (1 hunks)
  • apps/docs/contributing/services/agent/configuration.mdx (2 hunks)
  • apps/workflows/src/index.ts (1 hunks)
  • deployment/docker-compose.yaml (0 hunks)
💤 Files with no reviewable changes (12)
  • apps/agent/config.production.json
  • apps/agent/config.staging.json
  • apps/agent/pkg/prometheus/metrics.go
  • apps/agent/pkg/testutils/containers/agent.go
  • apps/agent/config.docker.json
  • apps/agent/schema.json
  • apps/agent/pkg/config/agent.go
  • apps/agent/pkg/tinybird/tinybird.go
  • apps/agent/cmd/agent/agent.go
  • deployment/docker-compose.yaml
  • apps/agent/pkg/api/server.go
  • apps/agent/services/eventrouter/service.go
✅ Files skipped from review due to trivial changes (1)
  • apps/workflows/src/index.ts
🧰 Additional context used
📓 Learnings (1)
apps/api/src/routes/v1_apis_listKeys.ts (1)
Learnt from: chronark
PR: unkeyed/unkey#2693
File: apps/api/src/routes/v1_keys_updateKey.ts:350-368
Timestamp: 2024-11-29T15:15:47.308Z
Learning: In `apps/api/src/routes/v1_keys_updateKey.ts`, the code intentionally handles `externalId` and `ownerId` separately for clarity. The `ownerId` field will be removed in the future, simplifying the code.
🔇 Additional comments (2)
apps/docs/contributing/services/agent/configuration.mdx (2)

12-12: LGTM: Clear documentation notice about schema changes

The notice about potential configuration spec changes is clear and appropriately directs users to the GitHub repository for the most up-to-date schema.


Line range hint 1-200: LGTM: Documentation accurately reflects removal of eventRouter

The documentation has been properly updated to remove all references to the eventRouter and tinybird integration. The configuration structure and example JSON are consistent with these changes.

@vercel vercel bot temporarily deployed to Preview – dashboard December 5, 2024 08:22 Inactive
@vercel vercel bot temporarily deployed to Preview – www December 5, 2024 08:22 Inactive
@chronark chronark merged commit 9ffce49 into main Dec 5, 2024
@chronark chronark deleted the tinybird-removel-in-agent branch December 5, 2024 08:23
@coderabbitai coderabbitai bot mentioned this pull request Dec 17, 2024
18 tasks
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.

1 participant