Skip to content

version 2 of user/organization tenant account module - UN-1424#432

Merged
hari-kuriakose merged 7 commits into
mainfrom
feat/MultiTenancyV2-tenant-account
Jul 18, 2024
Merged

version 2 of user/organization tenant account module - UN-1424#432
hari-kuriakose merged 7 commits into
mainfrom
feat/MultiTenancyV2-tenant-account

Conversation

@muhammad-ali-e

@muhammad-ali-e muhammad-ali-e commented Jul 1, 2024

Copy link
Copy Markdown
Contributor

What

Created a new application with the same V1 methods, with some changes in the models.

Major Changes in this PR:

  • apps.py: Updated configuration and initialization logic.
  • Imports from V2 Applications: Adjusted imports to utilize the new V2 applications.
  • models.py: Revised models to include new fields and relationships.
  • OrganizationMemberService in organization_member_service.py:
    • New get_members and get_members_by_user_email methods for improved performance and accuracy.
  • user_view.py: Refactored to use OrganizationMemberService.get_user_by_id instead of direct calls to OrganizationMember.objects.get.

The remaining changes involve duplicating or copying existing methods from other parts of the application to ensure consistency and reduce redundancy.

Why

  • Mandatory changes as part of the multi-tenancy design update.
  • To streamline the handling of organization contexts without relying on django_tenants.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • The new methods are self-contained ensuring no impact on current functionality.

Database Migrations

Env Config

Relevant Docs

Related Issues or PRs

  1. unstract-multi-tenantV2 feature-flag changes #422
  2. Feat/multi tenancy v2 context and organization #430
  3. Version 2 of User/Organization Account Module #431

Dependencies Versions

Notes on Testing

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

Comment thread backend/tenant_account_v2/organization_member_service.py

@hari-kuriakose hari-kuriakose 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.

@muhammad-ali-e Model looks ok.

Assuming that DefaultOrganizationMixin will provide organization field for OrganizationMember.

Ignoring duplication, as v1 will be deleted later. Also as mentioned, we can generate migrations once all v2 apps are ready.

Comment thread backend/tenant_account_v2/templates/land.html
Comment thread backend/tenant_account_v2/enums.py
@github-actions

Copy link
Copy Markdown
Contributor
filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{9}}$$ $$\textcolor{#23d18b}{\tt{9}}$$

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
72.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@hari-kuriakose hari-kuriakose merged commit 9781e5c into main Jul 18, 2024
@hari-kuriakose hari-kuriakose deleted the feat/MultiTenancyV2-tenant-account branch July 18, 2024 14:18
pk-zipstack pushed a commit that referenced this pull request Aug 20, 2025
* version 2 of user/organization tenant account module - UN-1424

* removed migrations, Will be created once after merge

* removed unwanted templates

---------

Co-authored-by: Rahul Johny <116638720+johnyrahul@users.noreply.github.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>
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.

5 participants