Update repository.py#26
Conversation
Adds the pending columns when a TDEI user is provisioned. This is taken directly from the existing code of CGIMap
|
Warning Review limit reached
Next review available in: 53 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: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe auto-provisioning insert for TDEI-sourced user accounts in TaskingProjectRepository._provision_users_from_tdei now sets additional columns (auth_provider, status, pass_crypt, data_public, email_valid, terms_seen, terms_agreed, tou_agreed, timestamps) beyond auth_uid, email, and display_name. An unused alternate SQL block was also added. ChangesUser Provisioning Insert Update
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
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.
🧹 Nitpick comments (1)
api/src/tasking/projects/repository.py (1)
273-302: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the dead SQL string block.
Lines 273‑302 are a bare triple-quoted string expression that is never assigned or executed. It duplicates the real INSERT below with
$1/$2/$3placeholders and even contains a stray closing paren afterRETURNING id(line 301). It adds no behavior and will mislead future readers into thinkingRETURNING idis in play. Please drop it.♻️ Proposed removal
- ''' - INSERT INTO users ( - email, - display_name, - auth_uid, - auth_provider, - status, - pass_crypt, - data_public, - email_valid, - terms_seen, - creation_time, - terms_agreed, - tou_agreed) - VALUES ( - $1, - $2, - $3, - 'TDEI', - 'active', - 'none', - true, - true, - true, - (now() at time zone 'utc'), - (now() at time zone 'utc'), - (now() at time zone 'utc')) - RETURNING id - ) - ''' - resolved: set[str] = set()🤖 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 `@api/src/tasking/projects/repository.py` around lines 273 - 302, Remove the dead triple-quoted SQL string block in repository.py; it is a standalone string literal that is never used and duplicates the actual INSERT logic. Delete the unused block near the users insert code so the remaining implementation is the real SQL path in the relevant repository method and avoids confusion with the stray RETURNING id text.
🤖 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.
Nitpick comments:
In `@api/src/tasking/projects/repository.py`:
- Around line 273-302: Remove the dead triple-quoted SQL string block in
repository.py; it is a standalone string literal that is never used and
duplicates the actual INSERT logic. Delete the unused block near the users
insert code so the remaining implementation is the real SQL path in the relevant
repository method and avoids confusion with the stray RETURNING id text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c95dae31-cb97-453c-8fda-3e0a4643094d
📒 Files selected for processing (1)
api/src/tasking/projects/repository.py
linting fixes
Adds the pending columns when a TDEI user is provisioned. This is taken directly from the existing code of CGIMap
Task reference : Task 3953: Figure out a way to add users from TDEI system
This pull request updates the user provisioning logic in the
_provision_users_from_tdeifunction to ensure that all required fields are set when inserting new users into theuserstable. The SQL statement for user creation has been expanded to include additional columns and default values, improving data consistency and aligning with the expected schema.User provisioning improvements:
INSERT INTO usersSQL statement inrepository.pyto include additional fields such asauth_provider,status,pass_crypt,data_public,email_valid,terms_seen,creation_time,terms_agreed, andtou_agreed, all set to appropriate default values for users provisioned from TDEI.Updated
_provision_users_from_tdeiso newly provisioned TDEI users are inserted intouserswith the full required schema fields, not justauth_uid,email, anddisplay_name. The insert now includes defaults for fields likeauth_provider,status,pass_crypt,data_public,email_valid,terms_seen,terms_agreed,tou_agreed, and timestamps, improving consistency with the table schema.