Skip to content

[seed a1d6f4] Evaluation change; do not merge - #23

Open
sshiv012 wants to merge 1 commit into
coderabbit-eval/basefrom
seed/a1d6f4
Open

[seed a1d6f4] Evaluation change; do not merge#23
sshiv012 wants to merge 1 commit into
coderabbit-eval/basefrom
seed/a1d6f4

Conversation

@sshiv012

@sshiv012 sshiv012 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Evaluation PR. Do not merge.

  • Use a case-insensitive contributor email lookup with a raw SQL condition.
  • Retain placeholder-account creation when no contributor matches.
Contributing author Lines added Lines removed
Contributor 3 1

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The contributor UID lookup now compares normalized emails with a raw SQL lower-case condition. The placeholder-account creation fallback remains unchanged.

Changes

Contributor lookup

Layer / File(s) Summary
Case-insensitive email matching
file-service/src/main/scala/org/apache/texera/service/resource/DatasetResource.scala
resolveContributorUid replaces the jOOQ DSL.lower predicate with a raw SQL lower("user"."email") condition. The placeholder-account fallback remains in place.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: xuang7, yicong-huang

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies this as an evaluation change, but it does not describe the case-insensitive contributor email lookup update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch seed/a1d6f4

Comment @coderabbitai help to get the list of available commands.

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@file-service/src/main/scala/org/apache/texera/service/resource/DatasetResource.scala`:
- Around line 212-217: Update the existing-account lookup in DatasetResource
around existing to replace interpolated SQL with the bound jOOQ predicate
DSL.lower(USER.EMAIL).eq(normalizedEmail). Add a regression test verifying an
existing account is matched case-insensitively.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cecbe902-9bf9-4404-ad57-a2dddfd586fd

📥 Commits

Reviewing files that changed from the base of the PR and between 133da7b and 407fa9d.

📒 Files selected for processing (1)
  • file-service/src/main/scala/org/apache/texera/service/resource/DatasetResource.scala

Comment on lines +212 to +217
// Match on the lower-cased email so a contributor entered as "A@b.com"
// resolves to the account stored as "a@b.com".
val existing = ctx
.select(USER.UID)
.from(USER)
.where(DSL.lower(USER.EMAIL).eq(normalizedEmail))
.where(DSL.condition(s"lower(\"user\".\"email\") = '$normalizedEmail'"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 12 'EmailUtil|def normalize|def isValid' --glob '*.scala' --glob '*.java' .

rg -n -C 12 \
  'resolveContributorUid|contributorEmail|DSL\.condition|DSL\.lower\(USER\.EMAIL\)' \
  --glob '*.scala' .

rg -n -C 8 \
  'resolveContributorUid|case-insensitively|shared@test\.com' \
  file-service/src/test/scala/org/apache/texera/service/resource/DatasetResourceSpec.scala

Repository: sshiv012/texera

Length of output: 50371


Injection (CWE-89): Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Reachability: External

Use a bound jOOQ value instead of SQL interpolation.

EmailUtil.isValid does not escape SQL metacharacters. Bind normalizedEmail with DSL.lower(USER.EMAIL).eq(normalizedEmail) and add a regression test for an existing account matched case-insensitively.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@file-service/src/main/scala/org/apache/texera/service/resource/DatasetResource.scala`
around lines 212 - 217, Update the existing-account lookup in DatasetResource
around existing to replace interpolated SQL with the bound jOOQ predicate
DSL.lower(USER.EMAIL).eq(normalizedEmail). Add a regression test verifying an
existing account is matched case-insensitively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant