Skip to content

[maintenance] Fix add_user_to_proj script error#4101

Merged
imnasnainaec merged 1 commit intomasterfrom
bugfix/maintenance-add-user-role
Jan 16, 2026
Merged

[maintenance] Fix add_user_to_proj script error#4101
imnasnainaec merged 1 commit intomasterfrom
bugfix/maintenance-add-user-role

Conversation

@imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Jan 16, 2026

This change is Reviewable

Summary by CodeRabbit

  • Bug Fixes
    • Improved role data handling to ensure consistent and reliable storage.

✏️ Tip: You can customize this high-level summary in your review settings.

@imnasnainaec imnasnainaec self-assigned this Jan 16, 2026
@imnasnainaec imnasnainaec added the bug Something isn't working label Jan 16, 2026
@imnasnainaec imnasnainaec requested a review from Copilot January 16, 2026 15:22
@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The add_user_to_proj.py script now explicitly quotes role values as string literals in MongoDB update and insert operations, ensuring consistent string storage without treating the role as a variable reference.

Changes

Cohort / File(s) Summary
MongoDB Operation String Literals
maintenance/scripts/add_user_to_proj.py
Role values in update and insert operations are now quoted as string literals (+2/-2 lines)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A role once free, now bound in quotes so tight,
MongoDB strings shine with crystalline light,
Two little marks, a fix so clean and small,
But oh, what clarity they bring to all! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly indicates a bug fix for the add_user_to_proj script, which directly relates to the changes in maintenance/scripts/add_user_to_proj.py where role handling was corrected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c058e5 and 3022e46.

📒 Files selected for processing (1)
  • maintenance/scripts/add_user_to_proj.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CodeQL analysis (python)
  • GitHub Check: docker_build
  • GitHub Check: test_build (8.0.x)
  • GitHub Check: test_coverage (22)
  • GitHub Check: tox (3.12)
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (2)
maintenance/scripts/add_user_to_proj.py (2)

86-86: Role update now stored as string literal — nice fix.


99-99: Role insert now stored as string literal — good.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the add_user_to_proj.py script where role values were not properly quoted as strings in MongoDB JSON documents, causing database operation failures.

Changes:

  • Added missing quotes around args.role in the MongoDB update operation
  • Added missing quotes around args.role in the MongoDB insert operation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.79%. Comparing base (1c058e5) to head (3022e46).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4101   +/-   ##
=======================================
  Coverage   74.79%   74.79%           
=======================================
  Files         295      295           
  Lines       10946    10946           
  Branches     1372     1372           
=======================================
  Hits         8187     8187           
  Misses       2363     2363           
  Partials      396      396           
Flag Coverage Δ
backend 86.08% <ø> (ø)
frontend 66.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

:lgtm:

@jasonleenaylor reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec).

@imnasnainaec imnasnainaec merged commit 9633166 into master Jan 16, 2026
29 of 30 checks passed
@imnasnainaec imnasnainaec deleted the bugfix/maintenance-add-user-role branch January 16, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working deployment 🟨Medium Medium-priority PR python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants