5971: added organizations to invitation model#6008
Conversation
|
👋 Hi @ArthurMousatov, thanks for contributing! For the review process to begin, please verify that the following is satisfied:
Also check that issue requirements are satisfied & you ran Pull requests that don't follow the guidelines will be closed. Reviewer assignment can take up to 2 weeks. |
|
📢✨ Before we assign a reviewer, we'll turn on |
rtibblesbot
left a comment
There was a problem hiding this comment.
Three blocking issues must be resolved before merge: broken method dispatch in accept(), a two-write invalid-state pattern in _accept_organization_invitation, and missing acceptance-criteria tests. One migration safety concern is flagged as a suggestion. CI was pending at review time.
- blocking
accept()calls non-existent method names — every invitation acceptance raisesAttributeError(see inline models.py:3754) - blocking
_accept_organization_invitationwrites an empty-stringroleon firstcreate(), then overwrites it; unknownshare_modesilently persists invalid data; re-acceptance raisesIntegrityError(see inline models.py:3767) - blocking Acceptance criteria require unit tests for the invitation–organization relationship, the mutual-exclusivity constraint violation case, and the
share_mode→ org-role mapping — none are present in this PR - suggestion
AddConstraintin the migration may fail at deployment if any existing rows havechannel=NULL(see inline migration:19) - praise Splitting
accept()into named per-type helpers is a clean refactor — the dispatch logic is now symmetrical and the original comment about the nullable channel field is correctly removed
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Ran a phased review pipeline over the pull request diff:
- Classified the diff to select review passes (core, frontend, backend) and whether manual QA was required
- Core review pass checked correctness, design, architecture, testing, completeness, and DRY/SRP/Rule-of-Three principles
- Specialized frontend/backend review passes applied framework-specific lenses where those files changed
- For UI changes: manual QA and an accessibility audit against a live dev server, when available
- Checked CI status and linked issue acceptance criteria
- Synthesized one review from those passes and chose the verdict from the findings, CI status, and QA evidence
…exception for invalid share_mode
…thurMousatov/studio into add-organizations-to-invitation-model
Summary
As detailed in Issue #5971, this PR adds organizations to the invitation model. The saving behavior for organizations is slightly different to channels, as there is a separate model for org roles.
I have also omitted tests in this PR, as this is just a model change and does not affect current code (organizations are fully optional in the invitation). I suggest moving testing to the next implementation step (Organization/Invitation viewsets).
References
Direct PR for Issue #5971.
Reviewer guidance
As part of these changes, migrations were run successfully. I tried running
make test, but it ran into 905 failures, mostly related to S3Storage errors. No linting was performed, since no frontend work was done.AI usage
Only basic VS code autocomplete was used.