Skip to content

Make sure to return groups if loaded but empty#354

Merged
PGijsbers merged 1 commit into
mainfrom
user-group-bugfix
Jul 2, 2026
Merged

Make sure to return groups if loaded but empty#354
PGijsbers merged 1 commit into
mainfrom
user-group-bugfix

Conversation

@PGijsbers

@PGijsbers PGijsbers commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

meant to be merged with the previous PR but forgot to commit

There currently isn't really a way for a user to have no group, but it's also not specifically prohibited. User groups need to be re-examined anyway because they are effectively not used (other than regular user vs admin).

@PGijsbers PGijsbers added the bug Something isn't working label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@PGijsbers, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b295fe22-2c89-47dc-8df2-d17f33be26f7

📥 Commits

Reviewing files that changed from the base of the PR and between 4a7791a and 766d07e.

📒 Files selected for processing (1)
  • src/database/users.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch user-group-bugfix

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider documenting the intended semantics of self._groups (e.g., None = not loaded, [] = loaded but empty) so future changes don’t inadvertently break this distinction.
  • If other lazy-loaded attributes follow a similar pattern, it may be worth extracting a small helper or convention to clearly differentiate between “not loaded” and “loaded empty” states for consistency.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider documenting the intended semantics of `self._groups` (e.g., `None` = not loaded, `[]` = loaded but empty) so future changes don’t inadvertently break this distinction.
- If other lazy-loaded attributes follow a similar pattern, it may be worth extracting a small helper or convention to clearly differentiate between “not loaded” and “loaded empty” states for consistency.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@4a7791a). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #354   +/-   ##
=======================================
  Coverage        ?   94.54%           
=======================================
  Files           ?       76           
  Lines           ?     3775           
  Branches        ?      248           
=======================================
  Hits            ?     3569           
  Misses          ?      139           
  Partials        ?       67           

☔ View full report in Codecov by Harness.
📢 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.

@PGijsbers PGijsbers merged commit d498e6c into main Jul 2, 2026
9 checks passed
@PGijsbers PGijsbers deleted the user-group-bugfix branch July 2, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant