Skip to content

Conversation

@Rainhunter13
Copy link
Contributor

@Rainhunter13 Rainhunter13 commented Dec 5, 2025

Note

Introduce hybrid data-plane routing that decrypts per-workspace config, signs requests, and adds workspace deployment management APIs/UI plus ClickHouse trace table updates.

  • Data plane (backend):
    • Add data_processor/{read,write,auth,crypto} with Ed25519-signed tokens and XChaCha20-Poly1305 decryption for per-workspace config.
    • Route sql::execute_sql_query via data_processor::read to ClickHouse or data plane based on DeploymentMode (cached by WORKSPACE_DEPLOYMENTS_CACHE_KEY).
    • Add db/workspaces.rs (WorkspaceDeployment, DeploymentMode) and cache key WORKSPACE_DEPLOYMENTS_CACHE_KEY.
    • Update handlers (v1/sql, datasets, tag, evaluators, routes/sql, traces consumer) to pass shared reqwest::Client/Cache/DB and use write_{spans,traces,tags}.
    • Make CHSpan, CHTag, SpanTag, evaluation structs serializable/clonable.
  • ClickHouse:
    • Add traces_replacing table + raw_traces_v0/traces_v0 views; include backfill script aggregate_traces_replacing.sql.
  • Frontend:
    • Add deployment management APIs: GET/PUT /api/workspaces/[id]/deployment, POST /deployment/generate-keys, POST /deployment/verify.
    • New UI: components/workspace/deployment-settings/* and "Deployment" tab (Enterprise only) in workspace sidebar.
    • Add workspace_deployments table and crypto helpers encodeValue/decodeValue/generateKeyPair; invalidate cache on updates.
  • Infra/Config:
    • Wire global reqwest::Client; .env.example adds DATA_PLANE_SIGNING_KEY.
  • Deps:
    • Add hex, serde_with, jsonwebtoken; lockfile updates.

Written by Cursor Bugbot for commit 53c9d65. This will update automatically on new commits. Configure here.


Important

Introduces hybrid data-plane routing for SQL operations, with backend, frontend, and database updates to support client-hosted deployments.

  • Backend (Rust)
    • Hybrid data-plane routing: Adds data_processor/{read,write,auth,crypto} modules for routing SQL operations based on DeploymentMode.
    • API updates: Modifies routes/sql.rs, api/v1/{sql,datasets,tag,evaluators}.rs to support new routing logic.
    • Database: Introduces WorkspaceDeployment and DeploymentMode in db/workspaces.rs.
    • Caching: Adds WORKSPACE_DEPLOYMENTS_CACHE_KEY to cache/keys.rs.
    • Models: Updates CHSpan, CHTag, SpanTag, and evaluation structs to be serializable/clonable.
    • Infrastructure: Initializes global reqwest::Client and adds DATA_PLANE_SIGNING_KEY to .env.example.
  • ClickHouse
    • Adds traces_replacing table and views raw_traces_v0/traces_v0.
    • Provides a migration script aggregate_traces_replacing.sql.
  • Frontend (Next.js)
    • Deployment management: Implements APIs for managing deployments in api/workspaces/[workspaceId]/deployment{,/generate-keys,/verify}.
    • UI: Adds deployment settings UI for generating keys and verifying URLs.
    • Schema/Cache: Adds workspace_deployments table and cache key WORKSPACE_DEPLOYMENTS_CACHE_KEY.
  • Dependencies
    • Adds hex, serde_with, jsonwebtoken to Cargo.toml and updates lockfile.

This description was created by Ellipsis for 53c9d65. You can customize this summary. It will automatically update as commits are pushed.

@Rainhunter13 Rainhunter13 marked this pull request as ready for review December 5, 2025 22:43
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 45baa37 in 1 minute and 25 seconds. Click for details.
  • Reviewed 826 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/sql/mod.rs:46
  • Draft comment:
    Consider precomputing the regex string for ERROR_END_REGEX instead of using format! inside the LazyLock closure. While it works, precomputing may improve clarity and avoid potential lifetime confusion.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. app-server/src/main.rs:1040
  • Draft comment:
    The main function spawns several threads and later joins them. Consider adding more robust error handling for thread panics and documenting the design intent to ensure that blocking operations via block_on in spawned threads are safe.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. app-server/src/traces/consumer.rs:191
  • Draft comment:
    Mixing Rayon’s parallel iterator for heavy CPU-bound work with async tasks is a good strategy, but ensure that this parallel processing does not starve your Tokio runtime. Consider verifying that the Rayon thread pool is appropriately tuned or use a dedicated CPU-bound thread pool if needed.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. app-server/src/utils/mod.rs:112
  • Draft comment:
    In the sanitize_string function, you filter out control characters including null and invalid UTF-8. Double–check that this filtering does not unintentionally remove characters that might be valid in your application context.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
5. frontend/lib/db/migrations/0062_deployment_mode.sql:1
  • Draft comment:
    The migration adds new columns for deployment mode and data plane URL. Ensure that these schema changes are backward–compatible and consider whether an index on deployment_mode might improve query performance if used frequently.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
6. app-server/src/traces/consumer.rs:82
  • Draft comment:
    Typo detected: "conneciton" should be corrected to "connection".
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_RY9jTcYS91uTy27t

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@Rainhunter13 Rainhunter13 marked this pull request as draft December 5, 2025 22:51
@Rainhunter13 Rainhunter13 self-assigned this Dec 5, 2025
@Rainhunter13 Rainhunter13 marked this pull request as ready for review December 9, 2025 00:22
@Rainhunter13 Rainhunter13 marked this pull request as draft December 9, 2025 00:23
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 291cd57 in 2 minutes and 32 seconds. Click for details.
  • Reviewed 1177 lines of code in 15 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/Cargo.toml:27
  • Draft comment:
    Ensure that added dependencies (e.g. 'hex' and 'jsonwebtoken') are reviewed for security and compatibility. Verify that jsonwebtoken is used correctly and that keys are securely managed.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to ensure that dependencies are reviewed for security and compatibility, which is against the rules. It also asks to verify the correct usage of a library, which is not specific enough to be useful.
2. app-server/src/data_processor/auth.rs:23
  • Draft comment:
    Token caching: verify that caching logic correctly refreshes tokens before expiration. A TTL of 720s for a token valid for 900s should be carefully validated.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify the caching logic and validate the TTL settings. This falls under asking the author to ensure behavior is intended and to double-check things, which violates the rules.
3. app-server/src/sql/mod.rs:116
  • Draft comment:
    The FIXME comment indicates error conversion from data_processor errors is a temporary solution. Consider a more robust error mapping to preserve error details.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is about a line that was added in this PR (the FIX comment at line 116). However, the comment is essentially asking the author to change their own comment from "FIX:" to "TODO:" and consider better error mapping. This falls into several problematic categories: 1) It's commenting on documentation/comments rather than code logic, 2) It's somewhat speculative ("consider a more robust error mapping"), 3) It's not clearly actionable - what specific error mapping should be done? The rules state "Do NOT make speculative comments" and comments should be "actionable and clear". This comment doesn't provide specific guidance on what error mapping to implement. The comment could be seen as actionable since it's suggesting to preserve error details better. The author themselves left a FIX comment indicating they know this is temporary, so perhaps the reviewer is just reinforcing that this needs attention. Maybe this is a valid code quality suggestion. While the author did leave a FIX comment, the reviewer's comment doesn't add much value beyond what the author already noted. The suggestion to change "FIX" to "TODO" is purely stylistic. The suggestion to "consider a more robust error mapping" is vague and doesn't provide specific actionable guidance on what that mapping should look like. The rules explicitly state not to make speculative comments and to only make comments that are actionable and clear. This comment should be deleted. It's primarily about changing comment style (FIX to TODO) and makes a vague suggestion about "more robust error mapping" without providing specific, actionable guidance. The author already acknowledged the issue with their FIX comment, so this doesn't add meaningful value.
4. app-server/src/traces/consumer.rs:184
  • Draft comment:
    Using Rayon’s parallel iterator (into_par_iter) for heavy span processing may block async executor threads. Ensure this CPU-bound work is offloaded to a dedicated thread pool if needed.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. app-server/src/db/projects.rs:62
  • Draft comment:
    Ensure that the new migration columns (deployment_mode and data_plane_url) are properly populated and that the migration 0062_deployment_mode.sql has been applied in all environments.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to ensure that the migration is applied in all environments, which violates the rule against asking the author to ensure something is done. It doesn't provide a specific code suggestion or point out a specific issue with the code.
6. app-server/src/traces/consumer.rs:74
  • Draft comment:
    Typo found: "conneciton" should be spelled "connection".
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_8umdeX8X2NRSG5ft

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@Rainhunter13 Rainhunter13 marked this pull request as ready for review December 9, 2025 16:20
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to b10891d in 2 minutes and 59 seconds. Click for details.
  • Reviewed 1233 lines of code in 16 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/data_processor/auth.rs:23
  • Draft comment:
    Review the token caching strategy: TOKEN_EXPIRATION_SECS is 900 seconds while the cache TTL is set to 720 seconds. Ensure this 80% ratio is intentional and documented to avoid using near-expired tokens.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. app-server/src/sql/mod.rs:116
  • Draft comment:
    The comment indicates that the error conversion from data_processor is not always a SqlQueryError. Consider implementing a proper conversion (e.g., using 'From' trait) rather than forcing conversion with e.to_string().
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is about code that was changed in this diff - specifically the new error handling for data_processor::read. However, there's already a FIX comment in the code itself that acknowledges this exact issue. The automated tool's comment is essentially restating what the author already documented. The author clearly knows about this issue and marked it for future work. The comment doesn't provide new information or a specific actionable change that the author wasn't already aware of. According to the rules, I should not make comments that are obvious or that the author is clearly already aware of. The comment does suggest a specific implementation approach (using the From trait), which could be considered actionable guidance. The author might appreciate the specific suggestion even if they're aware of the general issue. However, the FIX comment suggests this is intentionally left for later work. While the From trait suggestion is specific, the author has already marked this as a known issue with a FIX comment, indicating they're aware it needs improvement but chose to defer it. The comment doesn't add substantial value beyond what's already documented in the code. This appears to be intentional technical debt that the author is tracking. The comment should be deleted because the author has already documented this exact issue with a FIX comment in the code. The automated tool's suggestion doesn't provide new information beyond what the author already knows and has chosen to defer.
3. app-server/src/data_processor/mod.rs:205
  • Draft comment:
    Each query execution reads environment variables for SQL query options. Consider caching these values to reduce overhead on every query execution.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a performance optimization suggestion about caching environment variables. The comment is about new code that was added. However, I need to consider: 1) Is this a clear, actionable suggestion? Yes, it suggests caching env vars. 2) Is it speculative? The word "consider" makes it somewhat soft, but it's a concrete suggestion. 3) Is the overhead actually significant? env::var() is relatively cheap in Rust - it's just a hashmap lookup. 4) Would caching actually provide meaningful benefit? The overhead of reading env vars on each query is likely negligible compared to the actual query execution time. 5) Is this an obvious issue? Not really - many codebases read env vars on each use without problems. This feels like a premature optimization suggestion without evidence that it's actually a problem. While caching environment variables could theoretically reduce overhead, env::var() in Rust is already quite fast (just a hashmap lookup). Without profiling data showing this is a bottleneck, this suggestion might be premature optimization. The comment also uses "consider" which makes it sound optional/speculative rather than identifying a clear issue. The comment is technically correct that caching would reduce some overhead, and it's a reasonable code quality suggestion. However, given that this is likely a micro-optimization without demonstrated impact, and the comment uses soft language ("consider"), it falls into the category of speculative performance improvements rather than identifying a clear problem that needs fixing. This comment should be deleted. It's a speculative performance optimization without evidence of actual overhead. The cost of env::var() is negligible compared to query execution time, and the comment doesn't identify a clear, actionable problem that needs to be fixed.
4. app-server/src/api/v1/datasets.rs:73
  • Draft comment:
    The http_client is cloned multiple times. Since it is wrapped in an Arc, this is acceptable, but ensure that the cloning strategy is intentional and consider documenting why each clone is needed.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
5. app-server/src/data_processor/mod.rs:140
  • Draft comment:
    In read_from_data_plane, the data_plane_url is obtained via an ok_or_else and then matched. Consider simplifying this pattern for clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 35% vs. threshold = 50% This is a code quality/refactoring suggestion. The comment is pointing out that the code could be simplified. Looking at the pattern: the code does ok_or_else() then matches on the result to convert the error type. This could indeed be simplified to ok_or_else()?.map_err() or similar. However, the comment is quite vague - it says "consider simplifying" without being specific about what the simplified version should look like. The rules state that "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This comment is not very actionable because it doesn't specify what the simplified pattern should be. It's also somewhat subjective whether this is actually "clearer" - the current pattern is explicit about error handling. The comment does identify a legitimate pattern that could be refactored, and there is a better example in the same file (lines 133-138) showing a cleaner approach. The suggestion might be actionable enough if the developer looks at the similar code in the file. However, the comment doesn't provide the specific refactoring, making it somewhat vague. While the comment could be more specific, it does point to a real code quality issue where the same operation is done more verbosely than necessary. The fact that there's a better pattern used elsewhere in the same file (line 133-138) suggests this is a valid inconsistency worth addressing. However, the vagueness of "consider simplifying" without showing the actual improvement makes this borderline. This is a borderline case. The comment identifies a valid refactoring opportunity and there's inconsistency with how similar code is handled elsewhere in the file. However, it lacks specificity about what the simplified version should look like, making it less actionable. Given the rule to err on the side of deleting comments when unsure, and the vagueness of the suggestion, this should probably be deleted.
6. app-server/src/db/projects.rs:8
  • Draft comment:
    The new DeploymentMode enum is added as TEXT in the database. Ensure that the textual representation maps correctly with application logic and that any potential future migration (e.g., indexing) is planned.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to ensure that the textual representation of the new enum maps correctly with the application logic and to plan for future migrations. This falls under asking the author to ensure behavior and plan for future changes, which violates the rules.
7. frontend/lib/db/migrations/0062_deployment_mode.sql:1
  • Draft comment:
    The migration adds deployment_mode and data_plane_url columns. Double-check that these new columns are indexed or referenced appropriately if they are queried frequently.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to double-check something, which violates the rule against asking the author to confirm or double-check things. It does not provide a specific suggestion or point out a clear issue.
8. app-server/src/traces/consumer.rs:74
  • Draft comment:
    Typo: 'conneciton' should be spelled 'connection'.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_kDUfKnBH1Cs6leTr

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@Rainhunter13 Rainhunter13 changed the title clickhouse routing for client hosted data plane clickhouse routing for client hosted data plane v0 Dec 9, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 8fc620b in 1 minute and 31 seconds. Click for details.
  • Reviewed 51 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/data_processor/auth.rs:64
  • Draft comment:
    Doc comment updated to indicate base64 encoding, but the code still uses URL_SAFE_NO_PAD (URL-safe base64). Confirm if this is intentional or update the encoder (e.g. use STANDARD) to match the docs.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. app-server/src/data_processor/mod.rs:297
  • Draft comment:
    Removed debug print is good; consider using structured logging (e.g. log::debug!) if such diagnostics are needed in the future.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. app-server/src/sql/mod.rs:117
  • Draft comment:
    Directly propagating the error (return Err(e)) is cleaner; ensure that all errors from the data processor conform to SqlQueryError.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_jqScPMGXae38K5HF

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed f982682 in 2 minutes and 42 seconds. Click for details.
  • Reviewed 1443 lines of code in 11 files
  • Skipped 0 files when reviewing.
  • Skipped posting 11 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/ch/spans.rs:66
  • Draft comment:
    Good use of derivation (Row, Serialize, Deserialize, Debug, Clone) for CHSpan. Ensure that the order of fields remains in sync with the ClickHouse table schema if modified in the future.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
2. app-server/src/ch/tags.rs:24
  • Draft comment:
    CHTag is defined with private fields. If external modules require access, consider making the fields public or adding accessor methods.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
3. app-server/src/data_processor/mod.rs:15
  • Draft comment:
    Effective use of OnceLock with Moka Cache for caching workspace configs. Consider documenting the cache lifetime strategy in a code comment for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
4. app-server/src/data_processor/read.rs:97
  • Draft comment:
    Error handling in read_from_clickhouse is robust. Consider adding more context to the error when deserializing BadResponse errors (e.g., include the response snippet) for easier debugging.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
5. app-server/src/data_processor/write.rs:20
  • Draft comment:
    The design using a WriteData struct to support multiple tables is clean. Ensure that the generated auth token and the data plane URL are validated and logged adequately if problems occur.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
6. app-server/src/sql/mod.rs:156
  • Draft comment:
    The regex logic to strip query details from error messages is clever. Consider adding unit tests for 'remove_query_from_error_message' function to ensure stability if error formats change.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
7. app-server/src/traces/consumer.rs:183
  • Draft comment:
    Parallel processing via Rayon in process_spans_and_events_batch is effective. Ensure that shared state (if any) remains thread-safe. The error handling for ClickHouse writes and MQ acker is comprehensive.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
8. app-server/src/evaluations/utils.rs:104
  • Draft comment:
    Truncating JSON values using chars() is a good safeguard. Verify that this does not split Unicode grapheme clusters unexpectedly; consider using a Unicode-aware truncation if needed.
  • Reason this comment was not posted:
    Confidence changes required: 40% <= threshold 50% None
9. app-server/src/db/tags.rs:4
  • Draft comment:
    The TagSource enum and SpanTag struct are clearly defined with Serde support. The new() constructor provides a straightforward way to create span tags.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
10. app-server/src/sql/mod.rs:186
  • Draft comment:
    The execute_sql_query function integrates query validation, reading, and processing cleanly. The use of opentelemetry spans for both validation and response processing aids observability.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
11. app-server/Cargo.lock:4025
  • Draft comment:
    There appears to be an inconsistency in the dependency declaration on line 4025: the string "syn 2.0.106" includes a version number, whereas other dependencies ("proc-macro2" and "quote") do not. Please verify whether this is intended or if it should simply be "syn".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% This comment appears to be incorrect. In Cargo.lock files, when multiple versions of the same crate exist in the dependency tree, Cargo disambiguates them by including the version number in dependency references. Looking at the file, there are two versions of "syn" (syn 1.0.109 at lines 5139-5147 and syn 2.0.106 at lines 5150-5158), so "syn 2.0.106" is the correct way to reference the specific version. The dependencies "proc-macro2" and "quote" don't have version numbers because there's only one version of each in the dependency tree. This is completely normal and expected Cargo.lock behavior, not an inconsistency that needs fixing. Could there be a scenario where this is actually a problem? Maybe the tool is suggesting that all dependencies should be consistent in format regardless of whether multiple versions exist? No, Cargo.lock files are automatically generated by Cargo and follow a specific format. The version disambiguation is automatic and necessary when multiple versions exist. This is not something a developer should or can manually "fix" - it's the correct format. The comment fundamentally misunderstands how Cargo.lock works. This comment should be deleted. It incorrectly identifies normal Cargo.lock behavior as an inconsistency. The "syn 2.0.106" format is correct and necessary because multiple versions of syn exist in the dependency tree, while proc-macro2 and quote only have single versions.

Workflow ID: wflow_R0R0TeCLhaDIAP5l

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 251ca54 in 3 minutes and 1 seconds. Click for details.
  • Reviewed 67 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/cache.ts:165
  • Draft comment:
    New WORKSPACE_DEPLOYMENT_CONFIG_CACHE_KEY constant added. Ensure its usage and documentation remain consistent across the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. frontend/lib/crypto.ts:93
  • Draft comment:
    In encodeDataPlaneUrl, consider including the caught error’s details (e.g. error.message) when rethrowing to aid debugging, and optionally validate the key length from AEAD_SECRET_KEY.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment is suggesting a code quality improvement, but it's inconsistent with the existing codebase. All other similar functions in this file follow the exact same error handling pattern without including error details. If this were a valid concern, it would apply equally to all the existing functions, not just the new ones. The comment is essentially asking the author to deviate from the established pattern in the file. Additionally, the key validation suggestion is also not done anywhere else in the file. This seems like a "nice to have" suggestion that doesn't account for consistency with existing code. Perhaps the existing code is wrong and this is an opportunity to fix it? Maybe the comment is valid even if it's inconsistent with existing patterns, as it could improve debugging for the new code? While the suggestion might be technically beneficial, the rules state not to make comments that are obvious or unimportant, and to only suggest actionable refactors. Asking the author to deviate from the established pattern in the file for just one function is not actionable without also addressing the existing code. If this were a real issue, it should be addressed file-wide, not just for the new functions. This comment should be deleted because it suggests changes that are inconsistent with the existing codebase patterns. All other similar functions in the file follow the same error handling approach without including error details or validating key length. The comment is asking the author to deviate from established patterns without strong justification.
3. frontend/lib/crypto.ts:117
  • Draft comment:
    In decodeDataPlaneUrl, similarly include the underlying error details in the thrown error and consider validating the key length for robustness.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is suggesting improvements to error handling and validation. However, looking at the existing code, the new function follows the exact same pattern as decodeApiKey (lines 46-66) which also doesn't include underlying error details or validate key length. This means the comment is not really about something wrong with the new code specifically - it's a general code quality suggestion that would apply to all similar functions in the file. According to the rules, I should not comment on things that are not clearly wrong with the changes. The new code is consistent with the existing patterns in the file. If this were a real issue, it should have been addressed in the existing functions first, not singled out for the new function. The comment does suggest actionable improvements (adding error details and key validation), which could be valuable. The new code is being added now, so it might be a good opportunity to improve it even if existing code has the same issue. While the suggestions are actionable, the comment violates the principle of consistency - it's asking the new code to be different from the existing pattern without addressing the existing code. This is not a clear code change requirement for the PR, but rather a broader refactoring suggestion that should apply to the entire file. The rules state to only comment if there's clearly a code change required, and this is more of a "nice to have" improvement. This comment should be deleted because it's not about something specifically wrong with the changes - it's a general code quality suggestion that applies equally to existing code in the file. The new function follows the established pattern, and singling it out for improvements that aren't applied to similar existing functions is inconsistent.

Workflow ID: wflow_SUfXiPltoABPWK8P

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@Rainhunter13 Rainhunter13 force-pushed the clickhouse_reads_writes_with_hybrid_deployment branch from 251ca54 to 4800ac2 Compare December 11, 2025 17:44
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Skipped PR review on 957fe78 because no changed files had a supported extension. If you think this was in error, please contact us and we'll fix it right away.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed 4800ac2 in 2 minutes and 44 seconds. Click for details.
  • Reviewed 2518 lines of code in 29 files
  • Skipped 0 files when reviewing.
  • Skipped posting 12 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/data_processor/crypto.rs:13
  • Draft comment:
    Ensure AEAD_SECRET_KEY is exactly 32 bytes; consider including configuration guidance if the length check fails.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. app-server/src/data_processor/read.rs:103
  • Draft comment:
    Review the use of 'let Ok(...) = ... else' for parsing ClickHouse error responses to ensure it handles all possible error formats.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to review their use of a specific pattern for parsing error responses. It doesn't suggest a specific change or improvement, nor does it point out a specific issue with the current implementation. It seems to be asking the author to double-check their work, which violates the rules.
3. app-server/src/data_processor/write.rs:438
  • Draft comment:
    In write_to_data_plane, consider logging more details from the response when the status is non-successful to aid in debugging.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
4. app-server/src/sql/mod.rs:165
  • Draft comment:
    Regex-based sanitization of error messages is clever; ensure all edge cases are tested to avoid leaking sensitive query parts.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. app-server/src/traces/consumer.rs:100
  • Draft comment:
    Mixing Rayon parallel iterators with async processing is effective for CPU-bound tasks; ensure blocking operations here do not adversely affect async task scheduling.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. frontend/lib/cache.ts:94
  • Draft comment:
    The in-memory cache 'set' method does not honor expiration options; consider implementing expiration logic similar to the Redis branch.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. app-server/src/features/mod.rs:1
  • Draft comment:
    Feature flags are managed via environment variables; consider centralizing configuration to simplify management and testing.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. app-server/src/main.rs:114
  • Draft comment:
    The main initialization logic creates many shared resources; refactoring portions into helper functions could improve readability and maintainability.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
9. app-server/src/sql/queries.rs:37
  • Draft comment:
    Parsing top_span_id from the JSON response assumes a valid string; add error handling if the field is missing or malformed.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
10. app-server/src/traces/consumer.rs:154
  • Draft comment:
    The process_batch function is lengthy; refactor into smaller helper functions to improve modularity and ease testing.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
11. app-server/src/traces/consumer.rs:279
  • Draft comment:
    Typographical note: The comment refers to "clickhouse" in lowercase, but elsewhere in the file it is referred to as "ClickHouse". Consider using consistent capitalization for clarity.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
12. frontend/lib/clickhouse/scripts/aggregate_traces_replacing.sql:61
  • Draft comment:
    Typographical note: There is no space between "now64(9)" and the comment marker on this line. Consider adding a space for better readability, e.g., "now64(9) -- optional: set your end_time".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a very minor stylistic/formatting issue. While it's technically correct that there's missing whitespace, the rules state "Do NOT make comments that are obvious or unimportant." This is a trivial formatting issue that doesn't affect functionality. The comment is about a change (since this is a new file), but it's questioning whether such a minor formatting detail is worth keeping as a review comment. The inconsistency with line 60 makes it slightly more valid, but it's still very minor. The rules emphasize not commenting unless there's clearly a code change required - this is purely cosmetic. While this is technically a valid observation about formatting inconsistency, it could be argued that maintaining consistent spacing in comments improves readability and code quality. The file is meant to be manually edited and executed by users, so readability might be more important than usual. Even though this is a user-facing script that will be manually edited, the missing space is extremely minor and doesn't impact functionality or understanding. The rules explicitly state not to make obvious or unimportant comments, and a single missing space before a comment marker falls into that category. This is the type of thing that could be caught by a linter or formatter, not something that needs human review. This comment should be deleted. While technically correct, it's too minor and obvious to warrant a review comment. It's a trivial formatting issue that doesn't affect functionality or significantly impact readability.

Workflow ID: wflow_LwwvATmnPqRzHtw8

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed 0158576 in 3 minutes and 58 seconds. Click for details.
  • Reviewed 353 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/db/migrations/schema.ts:858
  • Draft comment:
    The index 'clusters_project_id_level_idx' in the schema uses swapped operator classes; 'projectId' (uuid) uses int8_ops and 'level' (bigint) uses uuid_ops.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. frontend/lib/db/migrations/schema.ts:255
  • Draft comment:
    Index 'agent_messages_session_id_created_at_idx' incorrectly applies timestamptz_ops to 'sessionId' (uuid).
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. frontend/lib/db/migrations/schema.ts:889
  • Draft comment:
    Index 'spans_root_project_id_start_time_trace_id_idx' uses uuid_ops for 'startTime' instead of timestamptz_ops.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. frontend/lib/db/migrations/schema.ts:705
  • Draft comment:
    The default for 'toolChoice' in the 'playgrounds' table may be invalid JSON; a JSONB column default should be a valid JSON literal (e.g., '"none"').
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. frontend/lib/db/migrations/0063_gigantic_black_panther.sql:155
  • Draft comment:
    Typographical error: "nonse_hex" appears to be a typo. It should likely be "nonce_hex".
  • Reason this comment was not posted:
    Marked as duplicate.
6. frontend/lib/db/migrations/schema.ts:189
  • Draft comment:
    Typographical error: It appears that 'nonseHex' might be a typo. Did you mean 'nonceHex'?
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_qlN7wLOfbMC761Pa

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed 0f18c28 in 2 minutes and 52 seconds. Click for details.
  • Reviewed 606 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/cache/keys.rs:15
  • Draft comment:
    Renamed constant to WORKSPACE_DEPLOYMENTS_CACHE_KEY. Ensure all references are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. app-server/src/data_processor/auth.rs:33
  • Draft comment:
    Consider caching the parsed signing key if keys are static to avoid repeated hex decoding on each call.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. app-server/src/db/workspaces.rs:37
  • Draft comment:
    There's an unnecessary trailing comma after workspace_deployments.nonce_hex in the SQL SELECT statement. This may cause a syntax error and should be removed.
  • Reason this comment was not posted:
    Marked as duplicate.
4. app-server/src/db/workspaces.rs:40
  • Draft comment:
    Typo in the JOIN clause: workspaces.id is referenced, but the correct table name might be workspace_deployments (or another expected table). Please verify and correct this reference.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_C00oCPtsBrUrYjlA

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed f723794 in 3 minutes and 7 seconds. Click for details.
  • Reviewed 1129 lines of code in 16 files
  • Skipped 0 files when reviewing.
  • Skipped posting 13 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/app/api/workspaces/[workspaceId]/deployment/generate-keys/route.ts:13
  • Draft comment:
    Consider using a consistent response helper (e.g. NextResponse.json) across API routes for uniformity. Currently this route uses Response.json while others use NextResponse.json.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This comment is about consistency across the codebase, which requires cross-file context to verify. The rules explicitly state "Ignore cross-file issues. Only think about the file you are reviewing." Additionally, both Response.json and NextResponse.json are valid approaches in Next.js, and without seeing other files, I cannot confirm whether the claim about inconsistency is even true. The comment is also a style/refactor suggestion rather than pointing out a bug or clear issue. While code quality refactors can be good, this one requires cross-file context to validate and is not clearly actionable without that context. The comment could be valid if there truly is an established pattern in the codebase to use NextResponse.json. Consistency in API responses could be important for maintainability. Perhaps this is a legitimate style guide enforcement. Even if consistency is important, I cannot verify the claim without seeing other files, which violates the "ignore cross-file issues" rule. The comment also doesn't point to a functional problem - both approaches work correctly. Without strong evidence that this is incorrect or problematic, I should delete it. This comment should be deleted because it requires cross-file context to verify (violates the "ignore cross-file issues" rule), and there's no strong evidence that using Response.json is incorrect or problematic in this context.
2. frontend/app/api/workspaces/[workspaceId]/deployment/route.ts:34
  • Draft comment:
    Consider adding explicit validation for the request body in the PUT handler before passing it to updateDeployment to guard against malformed or unexpected input.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment is suggesting a code quality improvement about adding validation. However, the presence of ZodError handling strongly suggests that validation is already happening inside updateDeployment. The comment doesn't provide strong evidence that validation is missing - it's more of a speculative suggestion. According to the rules, I should not keep speculative comments like "Consider adding..." unless there's clear evidence of a problem. The error handling pattern suggests the author has already thought about validation. This seems like a "nice to have" suggestion rather than identifying a clear issue. I might be wrong about where the validation occurs - perhaps updateDeployment doesn't validate and the ZodError catching is for other purposes. The comment could be valid if moving validation earlier in the chain would provide better error messages or security. Without seeing the updateDeployment implementation, I can't be 100% certain. While I can't see the updateDeployment implementation, the rule states I must see STRONG EVIDENCE that the comment is correct to keep it. The presence of ZodError handling suggests validation is already in place. The comment is speculative ("Consider adding...") rather than pointing to a definite issue. Per the rules, I should delete speculative comments and assume the author knows what they're doing unless there's clear evidence otherwise. This comment should be deleted. It's a speculative suggestion without strong evidence of a problem. The ZodError handling indicates validation is likely already present in updateDeployment, and the comment doesn't demonstrate that validation is actually missing or inadequate.
3. frontend/app/api/workspaces/[workspaceId]/deployment/verify/route.ts:10
  • Draft comment:
    The verifyDeployment function always returns true. Ensure that this stub is replaced with actual connectivity verification logic in the future.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is about the behavior of an imported function (verifyDeployment), not about the code in this file itself. The reviewer claims to know that this function "always returns true" based on looking at another file. This violates the rule about ignoring cross-file issues - I should only think about the file being reviewed. Additionally, the comment is asking the author to "ensure" something happens in the future, which is speculative and not actionable for this PR. The code in this file correctly calls the function and handles its return value - there's no issue with the code in this specific file. Perhaps the comment is valid if the verifyDeployment function is also being added in this same PR, and the reviewer has context showing it's a stub. The comment might be trying to prevent incomplete functionality from being merged. Even if verifyDeployment is a stub in another file in this PR, the comment should be on that file, not on this route handler which correctly uses the function. This comment is about cross-file context and the implementation of an imported function, which I should ignore per the rules. The route handler code itself is correctly implemented. This comment should be deleted because it's about the implementation of an imported function from another file, which is a cross-file issue. The code in this specific file correctly calls and handles the verifyDeployment function. If there's an issue with verifyDeployment being a stub, that comment belongs on the file where it's defined, not here.
4. frontend/components/workspace/deployment-settings/hybrid-setup.tsx:52
  • Draft comment:
    Before attempting verification, consider providing user feedback if the deployment URL is missing. Although the check exists, an explicit warning might improve UX.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is suggesting a UX improvement, but there's a fundamental issue: the button is already disabled when dataPlaneUrl is missing (line 129: disabled={isVerifying || !dataPlaneUrl}). This means users cannot trigger the verification when the URL is empty, so they would never see any warning message that might be added at line 54. The check at line 54 is just a defensive programming practice. Adding a toast notification there wouldn't improve UX because users can't reach that code path through the UI. The comment seems to miss this context about the disabled button state. Perhaps the comment is suggesting that instead of just disabling the button, we should show feedback when users try to interact with it while it's disabled? Or maybe there's a way to trigger this function programmatically that I'm not seeing? Even if there were programmatic ways to trigger this, the comment specifically says "Before attempting verification, consider providing user feedback if the deployment URL is missing" - but the button is already disabled when the URL is missing, which IS user feedback (a disabled state). The comment doesn't provide clear, actionable guidance that would improve the code, and it seems to miss the existing UX pattern. This comment should be deleted. The "Verify" button is already disabled when dataPlaneUrl is missing (line 129), which provides clear visual feedback to users. The check on line 54 is a defensive guard that users cannot reach through normal UI interaction, so adding a toast notification there wouldn't improve UX. The comment is not actionable and misses important context.
5. frontend/components/workspace/deployment-settings/workspace-deployment.tsx:47
  • Draft comment:
    The isDirty flag compares current form values to the initial data. Consider normalizing values (e.g. undefined vs empty string) to avoid false positives.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a speculative comment about a potential issue rather than identifying a definite problem. The comment says "Consider normalizing values... to avoid false positives" which is a hypothetical concern. Looking at the code, the form is initialized with reset() using the exact values from the API response, so the types should be consistent. The comment doesn't provide evidence that there IS a problem, just that there COULD be one. This violates the rule about not making speculative comments. Without seeing the actual API response types or evidence of a bug, this is just a "what if" suggestion. Could there be a legitimate case where the API returns undefined for dataPlaneUrl but the form field becomes an empty string, causing isDirty to incorrectly show true? This could happen with form inputs that convert undefined to empty strings. While that's theoretically possible, the comment is still speculative without evidence. The code uses react-hook-form which typically preserves undefined values. If this were a real issue, it would be caught during testing. The comment doesn't point to a definite bug, just a hypothetical concern. This comment is speculative and doesn't identify a definite issue. It suggests a potential problem without evidence that the problem actually exists. According to the rules, speculative comments should be removed.
6. frontend/components/workspace/sidebar/content.tsx:62
  • Draft comment:
    The sidebar menu filtering logic based on workspace tier is embedded inline. Consider extracting this logic into a helper function for better maintainability and testability.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a code quality/refactoring suggestion. The rules state that "Comments that suggest code quality refactors are good! But only if they are actionable and clear." The comment is actionable (extract to helper function) and clear. However, I need to consider: 1) The filtering logic is only 7 lines total and relatively simple, 2) It's already memoized, 3) The comment is about code that was changed in the PR (the tier filtering was added), 4) Whether this rises to the level of "clearly a code change required" - the current code is functional and not particularly complex. The rules also say "Do NOT comment unless there is clearly a code change required" and to not make comments that are "obvious or unimportant." This feels like a nice-to-have refactor rather than a clear code change requirement. The filtering logic is relatively simple (just 2 chained filters) and is already properly memoized. Extracting it might be over-engineering for such straightforward logic. The comment doesn't demonstrate that there's a clear problem with the current approach that necessitates a change. While the comment is technically actionable, the current implementation is simple enough that extraction may not provide significant value. The logic is only a few lines, already optimized with useMemo, and easy to understand inline. This feels more like a subjective preference than a clearly required code change. This comment should be deleted. While it's a reasonable refactoring suggestion, the filtering logic is simple and already well-structured within a useMemo. The comment doesn't meet the threshold of "clearly a code change required" - it's more of a subjective code style preference that doesn't add significant value.
7. frontend/lib/actions/workspace/deployment.ts:110
  • Draft comment:
    The verifyDeployment function currently returns true unconditionally. Consider implementing real connectivity checks (e.g., an HTTP request to the data plane) to verify deployment validity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment is suggesting that the function should do more than just return true. However, this violates several rules: 1) It's speculative - we don't know if this is intentional stub code that will be implemented later, or if returning true is the actual intended behavior for now. 2) It's asking the author to "consider" implementing something, which is not a clear code change requirement. 3) Without seeing how this function is used elsewhere in the codebase, we can't determine if this is actually a problem. The function might be a placeholder that's not yet called, or it might be intentionally simple for the initial implementation. This is more of a code quality suggestion than a definite bug. The function name "verifyDeployment" strongly suggests it should actually verify something, and returning true unconditionally is clearly not doing any verification. This could be a legitimate bug if the function is being used in production code to make security or operational decisions. While the function name does suggest it should verify something, this is a brand new file being added. It's very common to add stub functions in initial implementations that will be filled in later. Without seeing how this function is actually being used (if at all), we can't determine if this is a bug or intentional. The comment is speculative and uses soft language like "consider implementing" rather than pointing out a definite issue. This comment should be deleted. It's speculative about what the function should do without evidence that the current implementation is wrong. It's a "consider implementing" suggestion rather than identifying a clear bug. Per the rules, we should not make speculative comments and should only comment if something is definitely an issue.
8. frontend/lib/crypto.ts:117
  • Draft comment:
    In crypto functions (e.g., encodeValue/ decodeValue), ensure error messages do not leak sensitive details. Consider using a secure logger for debugging while avoiding exposing environment data in production errors.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment raises a valid security concern about potentially leaking sensitive information in error messages. However, I need to consider: 1) The comment is about code that WAS changed in the diff (the error message was modified), so it is about changes. 2) Looking at the rest of the file, other functions like encodeApiKey and encodeSlackToken also include similar contextual information in their error messages (name, teamId), so this isn't uniquely problematic. 3) The additionalData parameter is meant to be a generic identifier (like workspaceId was before), which may or may not be sensitive depending on usage. 4) The comment is somewhat speculative - it says "ensure" and "consider", which are red flags per the rules. 5) Without knowing what additionalData will contain in practice, it's hard to say definitively if this is a security issue. The comment is making a general security recommendation rather than pointing to a definite problem. The comment could be valid if additionalData contains sensitive information, but I don't have evidence that it does. The existing codebase already includes similar contextual information in error messages (like API key names and team IDs), suggesting this pattern is acceptable in this codebase. The comment uses cautionary language like "ensure" and "consider" which are typically signs of speculative or advisory comments that should be removed per the rules. While the existing pattern in the codebase includes contextual info in errors, that doesn't mean it's correct - this could be a legitimate security improvement. However, the comment is phrased as a general security advisory ("ensure", "consider") rather than pointing to a specific, definite issue. Without evidence that additionalData will contain sensitive information, this is speculative. This comment should be deleted. It uses advisory language ("ensure", "consider") which violates the rules against speculative or cautionary comments. The existing codebase already follows the pattern of including contextual information in error messages, and there's no strong evidence that additionalData will contain sensitive information that would make this a definite security issue.
9. frontend/lib/db/migrations/schema.ts:452
  • Draft comment:
    The workspaceDeployments table sets default empty strings for key fields (e.g., privateKey, publicKey). Consider if these should be nullable to differentiate between an unset value and an intentionally empty string.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% Looking at the diff, the workspaceDeployments table was moved and modified. The old version had fields like privateKey, publicKey, dataPlaneUrl, and nonseHex (note the typo). The new version has privateKey, privateKeyNonce, publicKey, dataPlaneUrl, and dataPlaneUrlNonce. The .default('').notNull() pattern was already present in the old code for these fields. The comment is suggesting a design change (nullable vs empty string defaults), but this pattern was already in the codebase before this PR. The actual changes in the PR are: (1) moving the table definition, (2) fixing the typo "nonse" to "nonce", (3) adding separate nonce fields for privateKey and dataPlaneUrl. The comment is not about these specific changes but rather about the pre-existing design pattern of using empty string defaults. The comment might be valid from a database design perspective, but it's commenting on code that largely existed before this PR. The empty string defaults for privateKey, publicKey, and dataPlaneUrl were already present in the old code. While the table was moved and modified in this PR, the specific pattern being criticized (empty string defaults) was already present. The comment is not about the actual changes made (adding nonce fields, fixing typo, moving location) but about pre-existing design decisions. This violates the rule about commenting on unchanged code patterns. This comment should be deleted because it's primarily about a design pattern that existed before this PR, not about the specific changes made in the diff. The actual changes were adding nonce fields and fixing a typo, not establishing the empty string default pattern.
10. frontend/lib/workspaces/types.ts:22
  • Draft comment:
    The WorkspaceDeploymentSettings interface does not include nonce fields present in the database schema. Confirm that this omission is intentional to keep such fields internal, or update the types if they are needed on the client.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This comment has several issues: 1) It asks the PR author to "confirm" something, which violates the rule about not asking authors to confirm intentions. 2) It's speculative - it says "or update the types if they are needed" which is conditional. 3) It references a database schema that isn't visible in the diff, requiring cross-file or external context to validate. 4) The comment doesn't provide strong evidence that there's actually a problem - it's just raising a question about whether fields should be included. This is exactly the type of "verify that..." or "ensure that..." comment that should be removed. The comment might be catching a legitimate issue where important fields are missing from the type definition. If nonce fields are actually required for proper functionality, this could be a real bug that needs to be addressed. While it's possible there's a legitimate issue, the comment violates multiple rules: it explicitly asks the author to "confirm" something, it's speculative ("or update the types if they are needed"), and it requires knowledge of a database schema not visible in the diff. Without strong evidence in the visible code that these fields are actually needed, this comment should be removed. This comment should be deleted because it asks the PR author to confirm their intention, is speculative, and references external context (database schema) not visible in the diff. There's no strong evidence in the visible code that the omission is actually a problem.
11. frontend/lib/db/migrations/schema.ts:2
  • Draft comment:
    There appears to be a missing space between pgEnum and pgPolicy in the import statement. A single space after the comma between pgEnum and pgPolicy would improve readability.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 15% vs. threshold = 50% This is a legitimate formatting issue that was introduced in the diff. The comment is about a change that was made (removing a space). However, I need to consider the rules: 1) This is a very minor formatting issue, 2) The rules say "Do NOT comment unless there is clearly a code change required" and "Do NOT make comments that are obvious or unimportant", 3) The rules also say "Do NOT comment on anything that would be obviously caught by the build" - though this might not break the build, a linter would likely catch this, 4) This is purely a formatting/style issue, not a logic issue. The missing space doesn't affect functionality at all - JavaScript/TypeScript will parse this correctly. This seems like the type of "obvious or unimportant" comment that should be filtered out. While this is technically a valid observation about formatting, it's an extremely minor style issue that doesn't affect functionality. Most projects use automated formatters (like Prettier) that would catch and fix this automatically. The comment might be considered too trivial to warrant manual review attention. Even though formatters exist, this is a real formatting inconsistency that was introduced in the PR. However, given the rules explicitly state not to comment on obvious or unimportant issues, and this is purely cosmetic with no functional impact, it falls into that category. The rule about not commenting on things "obviously caught by the build" could extend to linters/formatters. This comment should be deleted. While it correctly identifies a missing space, it's an unimportant formatting issue that doesn't affect code functionality and would typically be caught by automated tooling. The rules explicitly discourage comments on obvious or unimportant issues.
12. frontend/lib/db/migrations/schema.ts:279
  • Draft comment:
    There appears to be extra whitespace at the end of the object literal in the pgPolicy call. Consider removing the extra space after sqltrue`` to keep code clean.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a whitespace-only change. The diff shows that extra whitespace was ADDED (going from one space to two spaces). The comment is asking to remove this extra whitespace. However, this is an extremely minor formatting issue. The rules state "Do NOT make comments that are obvious or unimportant." Whitespace formatting is typically caught by linters/formatters and is generally considered unimportant. This would likely be automatically fixed by any code formatter. The comment doesn't point to a functional issue, just a stylistic one about trailing whitespace. While the comment is technically correct that there's extra whitespace, this is such a minor formatting issue that it falls under "obvious or unimportant" comments. Additionally, if this codebase uses any automated formatting tools, this would be caught automatically. The comment is about a trivial whitespace issue that doesn't affect functionality. Even though it's technically correct, it's not important enough to warrant a review comment. This type of issue should be handled by automated tooling like prettier or eslint, not manual code review. This comment should be deleted because it's about an unimportant whitespace formatting issue that doesn't affect code functionality and would typically be handled by automated formatting tools.
13. frontend/lib/db/migrations/schema.ts:380
  • Draft comment:
    There's an extra trailing whitespace in the SQL template literal after true. Please remove the additional spaces to ensure consistent formatting.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This comment is about a very minor formatting issue - extra trailing whitespace. Looking at the rules, I should not comment on things that are obvious or unimportant. Trailing whitespace is typically caught by linters/formatters and is a very minor issue. The comment doesn't point to any functional problem. However, the diff shows the author actually ADDED this whitespace (changed from 1 space to 2 spaces), which is odd. But still, this is purely cosmetic and would likely be caught by automated tools. The rules say "Do NOT make comments that are obvious or unimportant" - this falls into that category. The author intentionally added this extra space in the diff, so maybe there's a reason for it (though unlikely). Also, if the codebase has inconsistent spacing, pointing it out could help maintain consistency. However, this is still a very minor formatting issue that automated tools should handle. Even if the author added it intentionally, it's more likely an accidental keystroke than a deliberate choice. And even if there's inconsistency in the codebase, this is such a minor formatting issue that it falls squarely into "obvious or unimportant" territory. Linters and formatters exist for exactly this kind of issue. This comment should be deleted. It's about trivial whitespace formatting that is both obvious and unimportant. Such issues are typically handled by automated formatting tools and don't warrant a code review comment.

Workflow ID: wflow_4kHXT52NQfdZB2EZ

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed ad02461 in 58 seconds. Click for details.
  • Reviewed 456 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. app-server/src/data_processor/crypto.rs:24
  • Draft comment:
    The doc comment for encrypt_data_plane_url still describes the return value as a colon-separated string, but the function now returns a tuple (nonce, ciphertext). Please update the documentation to reflect the new tuple return type.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. app-server/src/data_processor/read.rs:156
  • Draft comment:
    The call to decrypt_data_plane_url now correctly uses separate nonce and encrypted string parameters (using config.data_plane_url_nonce and config.data_plane_url). This update improves clarity and security.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. app-server/src/data_processor/write.rs:165
  • Draft comment:
    The decryption in write_to_data_plane now correctly passes the separate data_plane_url_nonce with data_plane_url. Additionally, removal of obsolete write_* functions for events and datapoints improves maintainability.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, as it praises the changes made without providing any actionable feedback or suggestions. It does not align with the rules for useful comments, which should focus on specific code suggestions, potential issues, or requests for clarification on specific changes.
4. app-server/src/db/workspaces.rs:33
  • Draft comment:
    The SQL join condition in get_workspace_deployment_by_project_id has been corrected to use workspace_deployments.workspace_id, and the nonce field has been renamed to data_plane_url_nonce for consistency. This change ensures accurate data retrieval.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_im42DBCQWzGrxGy9

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 7c7e0b9 in 1 minute and 14 seconds. Click for details.
  • Reviewed 12 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/cache.ts:167
  • Draft comment:
    Removed duplicate constant WORKSPACE_DEPLOYMENT_CONFIG_CACHE_KEY. Please ensure that all references now use WORKSPACE_DEPLOYMENTS_CACHE_KEY for consistency.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_ySbx388JCAviXRWl

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.


if (!result) {
throw new Error("No workspace deployment found.");
}
Copy link

Choose a reason for hiding this comment

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

Bug: Frontend deployment API fails for unconfigured workspaces

The getDeployment function throws an error when no workspace_deployments record exists for a workspace. This prevents Enterprise users from accessing the deployment settings page at all - they see an error message instead of the UI with the "Generate API Keys" button. Since deployment records are only created when keys are generated, and users can't access the page to generate keys, there's a catch-22 that makes the feature unusable for new Enterprise workspaces.

Fix in Cursor Fix in Web

Ok(workspace_deployment)
}
}
}
Copy link

Choose a reason for hiding this comment

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

Bug: Missing workspace deployment causes all data operations to fail

The get_workspace_deployment function uses fetch_one which returns an error if no workspace_deployments record exists. Since workspace creation doesn't automatically create a deployment record, all existing workspaces and new workspaces will fail to write spans/traces/tags and fail all SQL queries. The consumer treats this as a transient error and requeues messages indefinitely, causing data loss and queue buildup.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed bcf57b1 in 2 minutes and 30 seconds. Click for details.
  • Reviewed 120 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/actions/workspace/deployment.ts:16
  • Draft comment:
    Consider validating dataPlaneUrl as a URL (e.g. using z.string().url()) rather than a generic string.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% The comment is suggesting a code quality improvement - adding URL validation. While this seems like reasonable advice on the surface, I need to consider: (1) Is this clearly correct? The field is used as a URL, so validation seems reasonable. (2) However, there might be valid reasons not to use strict URL validation - perhaps the data plane URL could be a relative path, or localhost, or some other format that might not pass Zod's URL validation. (3) The existing UpdateDeploymentSchema also uses z.string() without .url(), suggesting this might be intentional. (4) This is a code quality suggestion, not a bug fix. The rules say "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This is actionable and clear, but I need strong evidence it's correct. I might be missing context about whether strict URL validation would break valid use cases. For example, if users need to provide URLs like "localhost:8080" or "http://internal-service" without a protocol, Zod's .url() validator might reject them. The fact that UpdateDeploymentSchema doesn't use .url() validation suggests this might be intentional, and adding it only to VerifyDeploymentSchema could create inconsistency. While the critique raises valid concerns about potential edge cases, the comment is suggesting a reasonable validation improvement. However, without strong evidence that the current implementation is wrong or that strict URL validation won't break legitimate use cases, and given the inconsistency with UpdateDeploymentSchema, this falls into the category of speculative improvement rather than clearly necessary change. This comment suggests a code quality improvement but lacks strong evidence that it's necessary or correct. The inconsistency with UpdateDeploymentSchema (which also doesn't use .url()) suggests the current approach might be intentional. Without clear evidence of a problem, this should be deleted.
2. frontend/lib/actions/workspace/deployment.ts:166
  • Draft comment:
    Consider using a shared HTTP client with configurable timeout instead of raw fetch for consistency and better error handling.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_rb0nxtwlLnyjJWnf

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.


// Make HTTP POST request to data plane
try {
const response = await fetch(`${dataPlaneUrl}/api/v1/read`, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential SSRF risk: dataPlaneUrl is taken from the request and used directly in a fetch call. Validate or whitelist allowed URLs.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 4920de7 in 38 seconds. Click for details.
  • Reviewed 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/actions/workspace/deployment.ts:105
  • Draft comment:
    The rename from 'ids' to 'projs' improves clarity. Consider renaming to 'projects' for even more self-documenting code.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. frontend/lib/actions/workspace/deployment.ts:112
  • Draft comment:
    Cache removals are performed sequentially. Consider using Promise.all to run them concurrently if order isn’t important.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_NUlEKQxxCwIPMHBw

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 3b3bbd2 in 45 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/actions/workspace/deployment.ts:1
  • Draft comment:
    Minor stylistic change: the import for { z } from 'zod/v4' has been reordered to follow the _sodium import. Ensure this grouping aligns with the project's import organization guidelines.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_qY3Ku5L0gfkVIELB

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@@ -0,0 +1,2 @@
ALTER TABLE workspaces ADD COLUMN deployment_mode TEXT NOT NULL DEFAULT 'CLOUD';
ALTER TABLE workspaces ADD COLUMN data_plane_url TEXT;
Copy link

Choose a reason for hiding this comment

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

Bug: Missing database table breaks all workspace operations

The migration 0062_deployment_mode.sql adds columns to the workspaces table, but the Rust backend and TypeScript schema expect a separate workspace_deployments table. The backend queries workspace_deployments.workspace_id, workspace_deployments.mode, etc. via a JOIN, but this table is never created by any migration. This schema mismatch will cause SQL errors at runtime for all trace ingestion and SQL queries.

Additional Locations (2)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to delete migration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to delete migration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to delete migration

projects.id = $1",
)
.bind(project_id)
.fetch_one(pool)
Copy link

Choose a reason for hiding this comment

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

Bug: Query fails for workspaces without deployment configuration

The get_workspace_deployment_by_project_id function uses fetch_one, which returns an error if no row exists. Rows in workspace_deployments are only created when a user explicitly generates deployment keys via the UI. All existing workspaces and any workspace not using hybrid deployment will lack this row, causing write_spans, write_traces, write_tags, and read operations to fail with errors. This breaks trace ingestion and SQL queries for all users who haven't configured hybrid deployment.

Additional Locations (1)

Fix in Cursor Fix in Web

}

return { publicKey };
};
Copy link

Choose a reason for hiding this comment

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

Bug: Cache not invalidated when deployment keys regenerated

The generateDeploymentKeys function updates the private key in the database but does not invalidate the WORKSPACE_DEPLOYMENTS_CACHE_KEY cache. The updateDeployment function correctly invalidates this cache for all projects, but generateDeploymentKeys does not. When keys are regenerated, the backend continues to use the cached workspace deployment with the old private key, causing token generation to use the wrong key and authentication with the data plane to fail.

Fix in Cursor Fix in Web


if (!result) {
throw new Error("No workspace deployment found.");
}
Copy link

Choose a reason for hiding this comment

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

Bug: Deployment settings inaccessible for new workspaces

The getDeployment function throws an error when no workspace_deployments record exists. The UI catches this error and renders an error message with no way to proceed. Since deployment records are only created via generateDeploymentKeys (which requires the HybridSetup component to be rendered), and that component only renders when mode === HYBRID (which requires successful data loading), Enterprise users visiting the Deployment page for the first time are stuck with an error and cannot configure deployment.

Additional Locations (1)

Fix in Cursor Fix in Web

// Return cached token if available
if let Some(token) = cache.get(&config.workspace_id) {
return Ok(token);
}
Copy link

Choose a reason for hiding this comment

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

Bug: Stale tokens served after key regeneration

The token cache in generate_auth_token is keyed solely by workspace_id and uses an in-memory moka::sync::Cache with a 12-minute TTL. When deployment keys are regenerated, there is no mechanism to invalidate this cache. Cached tokens signed with the old private key continue to be served until TTL expiration, causing authentication failures with the data plane that now expects signatures verified with the new public key.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

⁉️

Copy link
Contributor Author

@Rainhunter13 Rainhunter13 Dec 12, 2025

Choose a reason for hiding this comment

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

Generating keys should be a one time operation

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 5ef65fb in 41 seconds. Click for details.
  • Reviewed 6 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/db/migrations/0062_deployment_mode.sql:1
  • Draft comment:
    This migration file’s ALTER TABLE commands have been removed. If these columns were already added in a deployed environment, modifying an applied migration can cause inconsistencies. Consider creating a new migration to drop these columns, rather than altering an existing migration file.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_FNIA4jNev00utxkl

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

projects.id = $1",
)
.bind(project_id)
.fetch_one(pool)
Copy link

Choose a reason for hiding this comment

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

Bug: Missing deployment row breaks all SQL queries

The get_workspace_deployment_by_project_id function uses fetch_one which returns an error if no row exists in workspace_deployments for the given project's workspace. All SQL read/write operations now flow through get_workspace_deployment, meaning existing workspaces without entries in the workspace_deployments table will fail all queries. The table has no foreign key from workspaces, no migration populates it for existing workspaces, and rows are only created via the frontend deployment settings UI. This breaks trace ingestion, SQL queries, and span recording for all existing projects.

Additional Locations (2)

Fix in Cursor Fix in Web

const UpdateDeploymentSchema = z.object({
workspaceId: z.string(),
dataPlaneUrl: z.string().optional(),
mode: z.enum(DeploymentType),
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect Zod enum usage causes runtime error

The UpdateDeploymentSchema uses z.enum(DeploymentType) but z.enum() expects a tuple of string literals like ["CLOUD", "HYBRID"], not a TypeScript enum object. Passing a TypeScript enum to z.enum() will cause a runtime error during schema construction. For TypeScript enums, z.nativeEnum(DeploymentType) is the correct approach in Zod.

Fix in Cursor Fix in Web

WHEN top_span_type = 7 THEN 'HUMAN_EVALUATOR'
WHEN top_span_type = 8 THEN 'EVENT'
ELSE 'UNKNOWN'
END AS top_span_type,
Copy link

Choose a reason for hiding this comment

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

Bug: ClickHouse view missing PIPELINE span type mapping

The raw_traces_v0 view's CASE statement for top_span_type is missing the mapping for value 2 (PIPELINE). According to the Rust SpanType enum, value 2 maps to PIPELINE, but the SQL jumps from top_span_type = 1 (LLM) directly to top_span_type = 3 (EXECUTOR). Any spans with PIPELINE type will incorrectly display as 'UNKNOWN' instead of 'PIPELINE'.

Fix in Cursor Fix in Web

WHEN trace_type = 1 THEN 'EVALUATION'
WHEN trace_type = 0 THEN 'DEFAULT'
ELSE 'DEFAULT'
END AS trace_type,
Copy link

Choose a reason for hiding this comment

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

Bug: ClickHouse view missing EVENT trace type mapping

The raw_traces_v0 view's CASE statement for trace_type is missing the mapping for value 2 (EVENT). According to the Rust TraceType enum, value 2 maps to EVENT, but the SQL only handles values 0 (DEFAULT), 1 (EVALUATION), and 3 (PLAYGROUND). Any traces with EVENT type will incorrectly fall through to 'DEFAULT' instead of displaying as 'EVENT'.

Fix in Cursor Fix in Web

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed 53c9d65 in 2 minutes and 3 seconds. Click for details.
  • Reviewed 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/actions/workspaces/index.ts:8
  • Draft comment:
    Suggest using an enum or constant for the deployment mode instead of the hardcoded string 'CLOUD', to improve maintainability and reduce typos.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_Kgj1AXItLXexc89k

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

throw new Error("Failed to create workspace");
}

await db.insert(workspaceDeployments).values({ mode: "CLOUD", workspaceId: workspace.id });
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider wrapping related DB insertions (workspace creation, workspaceDeployments, and membersOfWorkspaces) in a transaction to ensure atomicity and prevent partial data creation in case one operation fails.

.await?;

Ok(result)
}
Copy link

Choose a reason for hiding this comment

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

Bug: Missing workspace deployment records breaks existing workspaces

The get_workspace_deployment_by_project_id function uses fetch_one which fails when no row exists. The new workspace_deployments table is only populated for newly created workspaces (in createWorkspace) or when users explicitly generate deployment keys. Existing workspaces have no deployment record, so all SQL queries and span/trace writes (via write_spans, write_traces, write_tags, and execute_sql_query) will fail with a database error. A migration script is needed to insert default CLOUD mode records for all existing workspaces, or the query needs to handle missing rows by defaulting to CLOUD mode.

Additional Locations (1)

Fix in Cursor Fix in Web

@Rainhunter13 Rainhunter13 changed the title clickhouse routing for client hosted data plane v0 clickhouse routing Dec 12, 2025
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.

3 participants