-
Notifications
You must be signed in to change notification settings - Fork 715
fix: cloud orgs (bracnh v30) #9549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit dd70a36 Author: omkark06 <[email protected]> Date: Tue Dec 9 11:50:42 2025 +0530 fix: signout if verifyuser api fails commit 93caae0 Author: omkark06 <[email protected]> Date: Tue Dec 9 11:26:43 2025 +0530 fix: logout user when organizations api fails with 403 commit 86e67c3 Author: omkark06 <[email protected]> Date: Mon Dec 8 18:12:22 2025 +0530 fix: fetch pending invites on login to check if invites exists commit c81a1e7 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 8 13:24:31 2025 +0530 fix: ui unit test cases commit 0903865 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 8 12:02:50 2025 +0530 fix: invitationList as per updated UI theme commit 6e45401 Merge: 4bdc0b4 5045e3a Author: Yashodhan Joshi <[email protected]> Date: Mon Dec 8 10:04:25 2025 +0530 Merge branch 'main' into fix/cloud_orgs commit 4bdc0b4 Merge: 40a21e1 6e857ea Author: Yashodhan Joshi <[email protected]> Date: Tue Dec 2 11:13:53 2025 +0530 Merge branch 'main' into fix/cloud_orgs commit 40a21e1 Author: Yashodhan Joshi <[email protected]> Date: Tue Dec 2 10:55:55 2025 +0530 fix: geenrate token in invite addition Signed-off-by: Yashodhan Joshi <[email protected]> commit 73a9236 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 18:14:34 2025 +0530 fix: refresh the list after succesfull invite commit 37d0e78 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Mon Dec 1 12:41:28 2025 +0000 chore: update translations from en.json Auto-generated translation updates from English source file. 🤖 Generated with automated translation workflow commit 07d27a0 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 18:11:02 2025 +0530 fix: revoke method added for invites commit 3200478 Author: Yashodhan Joshi <[email protected]> Date: Mon Dec 1 17:33:05 2025 +0530 fix: sent token in the invites api Signed-off-by: Yashodhan Joshi <[email protected]> commit d7ac784 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 16:46:35 2025 +0530 fix: trail period message change commit 4cce5cd Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 16:27:14 2025 +0530 fix: should show the role in capital letter commit 99ec65e Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 16:22:25 2025 +0530 fix: show error if same email id sent for invite commit 237bac4 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 16:18:39 2025 +0530 fix: shows search input , dedup emails ids commit 85ac4bd Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 15:13:25 2025 +0530 fix: merge conflicts in user.vue commit bc31ad7 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Mon Dec 1 09:42:15 2025 +0000 chore: update translations from en.json Auto-generated translation updates from English source file. 🤖 Generated with automated translation workflow commit 2b8a82a Merge: 0d7b2a2 4ecc550 Author: sai nikhil kethe <[email protected]> Date: Mon Dec 1 15:11:45 2025 +0530 Merge branch 'main' into fix/cloud_orgs commit 0d7b2a2 Author: Yashodhan Joshi <[email protected]> Date: Fri Oct 3 10:19:57 2025 +0530 fix: check domain on invite also Signed-off-by: Yashodhan Joshi <[email protected]> commit f8c47eb Merge: 193fd67 9d357d0 Author: Yashodhan Joshi <[email protected]> Date: Fri Oct 3 10:24:30 2025 +0530 Merge branch 'main' into fix/cloud_orgs Signed-off-by: Yashodhan Joshi <[email protected]> commit 193fd67 Author: omkark06 <[email protected]> Date: Mon Sep 22 11:14:51 2025 +0530 fix: removed empty tag commit b8299f7 Merge: d42f30a 83663f6 Author: Yashodhan Joshi <[email protected]> Date: Mon Sep 22 10:45:48 2025 +0530 Merge branch 'main' into fix/cloud_orgs commit d42f30a Merge: b65e868 d40b6af Author: Yashodhan Joshi <[email protected]> Date: Thu Sep 18 14:31:40 2025 +0530 Merge branch 'main' into fix/cloud_orgs commit b65e868 Author: omkark06 <[email protected]> Date: Fri Sep 5 16:25:14 2025 +0530 fix: Invitations in IAM commit f560b06 Author: Yashodhan Joshi <[email protected]> Date: Thu Sep 4 11:50:01 2025 +0530 fix: allow user to only be part of one free org via invitation Signed-off-by: Yashodhan Joshi <[email protected]> commit 7233af3 Author: Yashodhan Joshi <[email protected]> Date: Wed Sep 3 16:50:00 2025 +0530 feat: create new org for new user after all invitation decline Signed-off-by: Yashodhan Joshi <[email protected]> Signed-off-by: Yashodhan Joshi <[email protected]>
|
Failed to generate code suggestions for PR |
Greptile OverviewGreptile SummaryAdds comprehensive organization invitation management for cloud deployments, including UI for viewing/accepting/declining invitations, admin ability to revoke invites, and backend validation to prevent users from joining multiple free organizations. Key Changes
Issues Found
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Login
participant InvitationList
participant Backend
participant BillingService
participant Database
User->>Login: Login to system
Login->>Backend: getPendingInvites()
Backend->>Database: Query pending invites
Database-->>Backend: Return invites
Backend-->>Login: Return invites list
alt Has pending invites
Login->>InvitationList: Show invitations page
InvitationList->>User: Display pending invites
else No pending invites
Login->>User: Redirect to org
end
User->>InvitationList: Accept invitation
InvitationList->>Backend: acceptInvitation(token)
Backend->>BillingService: Check if org is free
alt Org is free
Backend->>Database: Check user's existing orgs
Database-->>Backend: Return user orgs
Backend->>BillingService: Validate no other free orgs
BillingService-->>Backend: Validation result
end
alt Validation passes
Backend->>Database: Add user to org
Backend->>Database: Update invite status
Database-->>Backend: Success
Backend-->>InvitationList: Success
InvitationList->>User: Redirect to org
else Validation fails
Backend-->>InvitationList: Error (multiple free orgs)
InvitationList->>User: Show error
end
User->>InvitationList: Decline invitation
InvitationList->>Backend: declineInvitation(token)
Backend->>Database: Update invite to rejected
Backend->>Database: Get remaining invites
Database-->>Backend: Return remaining invites
alt No remaining invites
Backend->>Backend: Create new org for user
Backend->>Database: Add user to new org
end
Backend-->>InvitationList: Return remaining count
InvitationList->>User: Update UI
User->>User: Admin revokes invite
User->>Backend: revokeInvite(token)
Backend->>Database: Delete invitation
Database-->>Backend: Success
Backend-->>User: Confirmation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
27 files reviewed, 2 comments
| } | ||
| } | ||
|
|
||
| if let Err(_) = o2_enterprise::enterprise::cloud::email::check_email(invitee).await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: discarded error from check_email
| if let Err(_) = o2_enterprise::enterprise::cloud::email::check_email(invitee).await { | |
| if let Err(e) = o2_enterprise::enterprise::cloud::email::check_email(invitee).await { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/service/organization.rs
Line: 550:550
Comment:
**style:** discarded error from `check_email`
```suggestion
if let Err(e) = o2_enterprise::enterprise::cloud::email::check_email(invitee).await {
```
How can I resolve this? If you propose a fix, please make it concise.| if remaining.is_empty() { | ||
| // if there are no remaining invitations, create a new org for the user | ||
| let db_user = match db::user::get_db_user(user_id).await { | ||
| Ok(v) => v, | ||
| Err(e) => { | ||
| log::error!("error getting db user for {user_id} : {e}"); | ||
| return Ok(HttpResponse::Ok().json(serde_json::json!({ | ||
| "message":"Invitation declined successfully", | ||
| "remaining": remaining.len() | ||
| } | ||
| ))); | ||
| } | ||
| }; | ||
| let _ = jwt::check_and_add_to_org( | ||
| user_id, | ||
| &format!("{} {}", db_user.first_name, db_user.last_name), | ||
| ) | ||
| .await; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: check user exists before auto-creating org; if get_db_user fails, function returns without logging out user who declined all invitations, leaving them in inconsistent state
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/handler/http/request/users/mod.rs
Line: 870:888
Comment:
**logic:** check user exists before auto-creating org; if `get_db_user` fails, function returns without logging out user who declined all invitations, leaving them in inconsistent state
How can I resolve this? If you propose a fix, please make it concise.
This squashes the commits from the main PR (#9416) for the release branch.