Skip to content

Fix events transitions to ASSIGNMENTS_CLOSED during import#385

Open
frenzymadness wants to merge 1 commit into
mainfrom
issue_376
Open

Fix events transitions to ASSIGNMENTS_CLOSED during import#385
frenzymadness wants to merge 1 commit into
mainfrom
issue_376

Conversation

@frenzymadness

Copy link
Copy Markdown
Collaborator

Fixes: #376

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@frenzymadness, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 29 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 25e11309-2597-4fa4-bad1-5fd13aaa961e

📥 Commits

Reviewing files that changed from the base of the PR and between d432858 and 7fae8be.

📒 Files selected for processing (2)
  • app/routes/import_events.py
  • tests/test_import_events.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue_376

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.

@spidermila

Copy link
Copy Markdown
Owner

Changes Reviewed

  • app/routes/import_events.py - Added auto-close logic for fully occupied events
  • tests/test_import_events.py - Added 6 test cases covering various scenarios

Full review of all changes.

Code Review

🐛 Bugs & Correctness

The logic correctly checks if not time_missing and not cancelled and not is_past before applying the status change, ensuring the check only applies to valid future events. The db.session.flush() and db.session.refresh() ensure the event object has the latest state after signups are added, which is essential for correct spot counting. The event.version += 1 increment follows the existing pattern in the codebase. No issues found.

🔒 Security

The permission check is implicit through the import endpoint's authorization. The audit logging is properly implemented with a descriptive Czech message. No security issues found.

⚡ Performance

No performance issues found. The flush/refresh are localized to event processing and don't cause N+1 queries.

🏗️ Code Quality

The code follows existing patterns in the codebase. The Czech audit message is consistent with other audit entries. No issues found.

✅ Tests & Documentation

Excellent test coverage with 6 test cases covering:

  • Fully occupied future event → ASSIGNMENTS_CLOSED
  • Partially filled event → DRAFT
  • No assignments event → DRAFT
  • Past fully occupied event → COMPLETED (not affected)
  • Dynamic spots scenario
  • Unknown signup handling

All edge cases are properly tested. No documentation is needed for internal logic.

Actionable Suggestions

None — the changes are solid and ready to merge.

Overall Assessment

LGTM ✅ The implementation correctly auto-closes signups when all spots are filled during import, with comprehensive test coverage ensuring the feature works across various scenarios.


Reviewed by MedCover Reviewer AI · Full review

@spidermila

Copy link
Copy Markdown
Owner

Summary

Automatic assignment closure is triggered during event import when all mandatory spots are filled, with comprehensive test coverage for edge cases (future/past events, dynamic spot counts).

Changes Reviewed

Full diff: 2 files (app/routes/import_events.py, tests/test_import_events.py)

Code Review

🐛 Bugs & Correctness

No issues found.

🔒 Security

No issues found.

⚡ Performance

No issues found.

🏗️ Code Quality

No issues found.

✅ Tests & Documentation

No issues found.

Actionable Suggestions

No changes needed.

Overall Assessment

LGTM ✅
The feature is well-implemented with thorough test coverage for all relevant scenarios (past events, various spot configurations, edge cases).


Reviewed by MedCover Reviewer AI · Full review

@spidermila

Copy link
Copy Markdown
Owner

Changes Reviewed

2 files modified - full review

Code Review

🐛 Bugs & Correctness

No issues found.

🔒 Security

No issues found.

⚡ Performance

No issues found.

🏗️ Code Quality

No issues found.

✅ Tests & Documentation

No issues found.

Actionable Suggestions

None — this is a targeted bug fix for event transitions during import.

Overall Assessment

LGTM ✅
Bug fix addressing event state transitions to ASSIGNMENTS_CLOSED during the import process.


Reviewed by MedCover Reviewer AI · Full review

@spidermila

Copy link
Copy Markdown
Owner

Changes Reviewed

app/routes/import_events.py, tests/test_import_events.py — Adds auto-close logic for fully-booked events on import.

Code Review

🐛 Bugs & Correctness

No issues found. Logic correctly checks if not time_missing and not cancelled and not is_past before applying the auto-close, properly isolating it to future, non-cancelled events.

🔒 Security

No issues found. The change is scoped to event import logic with proper audit logging.

⚡ Performance

No issues found. Added flush/refresh is minimal and properly sequenced.

🏗️ Code Quality

No issues found. Code is clear and the condition message is appropriate (Czech).

✅ Tests & Documentation

Excellent test coverage. Six test cases cover: fully occupied (closes), partially filled (stays DRAFT), empty (stays DRAFT), past fully-occupied (stays COMPLETED), dynamic spots, and unknown signups.

Actionable Suggestions

None.

Overall Assessment

LGTM ✅ Well-implemented auto-close feature with comprehensive test coverage and proper edge-case handling.


Reviewed by MedCover Reviewer AI · Full review

@frenzymadness frenzymadness requested a review from spidermila June 17, 2026 07:45
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.

Bug: imported fully-occupied events are in "Přihlášky otevřeny" state

2 participants