Add core entities - #2
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds JPA entities and repositories for codebases, repository files, and code chunks; introduces codebase statuses and vector embedding persistence; adds PostgreSQL migrations, Hibernate Vector support, JGit, and string persistence for user roles. ChangesCodebase indexing persistence
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@server/src/main/java/com/meet/server/feature/codebase/Codebase.java`:
- Line 41: Store Git commit IDs as text across the codebase: change
Codebase.lastCommitSha from UUID to String, and update
server/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sql
at lines 11-11 to define last_commit_sha as VARCHAR(255).
In
`@server/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sql`:
- Around line 19-31: Update the users role/provider migration to preserve V1
values: add nullable replacement columns, populate them using explicit ordinal
mappings (role 1/2 to USER/ADMIN and provider 1/2/3 to GOOGLE/GITHUB/EMAIL),
then remove the original SMALLINT columns and retain the mapped columns under
the existing names.
In
`@server/src/main/resources/db/migration/V3__create_repository_files_and_code_chunks.sql`:
- Around line 25-38: Enforce consistent file/codebase ownership across both
affected sites: in
server/src/main/resources/db/migration/V3__create_repository_files_and_code_chunks.sql
lines 25-38, replace the independent ownership foreign keys with a composite
foreign key on (file_id, codebase_id) referencing the corresponding
file/codebase pair; in
server/src/main/java/com/meet/server/feature/codechunk/CodeChunk.java lines
37-43, update the entity mapping so file and codebase associations cannot be set
inconsistently.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f666c902-2c0a-4861-9f14-cc9d1ffad7e4
📒 Files selected for processing (10)
server/build.gradleserver/src/main/java/com/meet/server/feature/codebase/Codebase.javaserver/src/main/java/com/meet/server/feature/codebase/CodebaseStatus.javaserver/src/main/java/com/meet/server/feature/codechunk/CodeChunk.javaserver/src/main/java/com/meet/server/feature/codechunk/CodeChunkRepository.javaserver/src/main/java/com/meet/server/feature/repositoryfile/RepositoryFile.javaserver/src/main/java/com/meet/server/feature/repositoryfile/RepositoryFileRepository.javaserver/src/main/java/com/meet/server/feature/user/User.javaserver/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sqlserver/src/main/resources/db/migration/V3__create_repository_files_and_code_chunks.sql
| ALTER TABLE users | ||
| DROP | ||
| COLUMN provider; | ||
|
|
||
| ALTER TABLE users | ||
| DROP | ||
| COLUMN role; | ||
|
|
||
| ALTER TABLE users | ||
| ADD provider VARCHAR(255); | ||
|
|
||
| ALTER TABLE users | ||
| ADD role VARCHAR(255); No newline at end of file |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
fd -a '^(UserRole|Provider)\.java$' server/src/main/java
rg -n -C2 'enum\s+(UserRole|Provider)\b' server/src/main/javaRepository: Meet-08/CodeCompass
Length of output: 1154
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== migration files =="
git ls-files 'server/src/main/resources/db/migration/*'
echo
echo "== target migration =="
cat -n server/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sql
echo
echo "== related user/provider entity snippets =="
for f in server/src/main/java/com/meet/server/feature/user/UserRole.java server/src/main/java/com/meet/server/feature/auth/Provider.java server/src/main/java/com/meet/server/feature/user/User.java server/src/main/java/com/meet/server/feature/auth/Provider.java; do
if [ -f "$f" ]; then
echo "--- $f"
sed -n '1,180p' "$f" | cat -n
fi
done
echo
echo "== V1 migration if present =="
fd -a '^V1__.*\.sql$' server/src/main/resources/db/migration || trueRepository: Meet-08/CodeCompass
Length of output: 3681
🏁 Script executed:
#!/bin/bash
set -euo pipefail
cat -n server/src/main/resources/db/migration/V1__initial_schema.sql
echo
echo "== JPA/Hibernate enum mapping config/search =="
rg -n -C2 "`@Enumerated`|EnumType|hibernate|jdbcType|JDBC|Provider|UserRole|role|provider" server/src/main/java server/src/main/resources application*.properties application*.yml application*.yaml server/src/main/resources/db/migration || trueRepository: Meet-08/CodeCompass
Length of output: 16450
Preserve existing role and provider values during conversion.
users.role and users.provider are stored as SMALLINT in V1, but V2 drops and re-adds them as enum string columns, deleting existing values. Add the new columns as nullable, update the existing ordinal rows with the explicit mappings (1 -> USER, 2 -> ADMIN, 1 -> GOOGLE, 2 -> GITHUB, 3 -> EMAIL), then drop the old columns.
🧰 Tools
🪛 Squawk (2.61.0)
[warning] 20-21: Dropping a column may break existing clients.
(ban-drop-column)
[warning] 24-25: Dropping a column may break existing clients.
(ban-drop-column)
🤖 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
`@server/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sql`
around lines 19 - 31, Update the users role/provider migration to preserve V1
values: add nullable replacement columns, populate them using explicit ordinal
mappings (role 1/2 to USER/ADMIN and provider 1/2/3 to GOOGLE/GITHUB/EMAIL),
then remove the original SMALLINT columns and retain the mapped columns under
the existing names.
Source: Linters/SAST tools
This pull request introduces a new schema and supporting entities for managing codebases, repository files, and code chunks, including support for vector embeddings. It also updates dependencies to support these features and makes minor adjustments to the user schema.
Database Schema and Entity Additions
Codebase,RepositoryFile, andCodeChunk, including their repositories, to model codebases, files, and code chunks with vector embeddings. (server/src/main/java/com/meet/server/feature/codebase/Codebase.java[1]server/src/main/java/com/meet/server/feature/repositoryfile/RepositoryFile.java[2]server/src/main/java/com/meet/server/feature/codechunk/CodeChunk.java[3]server/src/main/java/com/meet/server/feature/codebase/CodebaseStatus.java[4]server/src/main/java/com/meet/server/feature/repositoryfile/RepositoryFileRepository.java[5]server/src/main/java/com/meet/server/feature/codechunk/CodeChunkRepository.java[6]codebases,repository_files,code_chunks), add vector extension, and update theuserstable schema. (server/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sql[1]server/src/main/resources/db/migration/V3__create_repository_files_and_code_chunks.sql[2]Dependency Updates
build.gradleto enable vector embeddings and Git operations. (server/build.gradle[1] [2]User Schema Fix
Userentity to storeroleandprovideras enums and updated the database schema accordingly. (server/src/main/java/com/meet/server/feature/user/User.java[1]server/src/main/resources/db/migration/V2__add_schema_for_codebase_and_user_schema_fix.sql[2]Summary by CodeRabbit
New Features
Bug Fixes