Skip to content
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

v2 changes of platform settings #447

Merged
merged 10 commits into from
Jul 15, 2024

Conversation

muhammad-ali-e
Copy link
Contributor

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

What

  • v2 changes of platform settings
    • Updated the application name.
    • Imported packages from v2 applications instead of v1.
    • Retrieved organization information from UserContext or Session instead of connection.tenant.

Why

  • The changes are necessary to align with the updated architecture and to ensure compatibility with the v2 applications.
  • To streamline the handling of organization contexts without relying on django_tenants.

How

  • Modified platform_auth_helper.py to update the import statements from v2.
  • Adjusted platform_auth_service.py to import from v2 applications and updated the methods of get_organization by using user context.
  • Updated serializers.py to reflect import changes.
  • Changed the application name in apps.py.
  • Updated views.py for consistency with the new application structure.

Changed files:

  • platform_auth_helper.py (package import changes only)
  • platform_auth_service.py
  • serializers.py (import changes only)
  • apps.py (app name change only)
  • views.py

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.
  • Also under feature flag multi_tenancy_v2.

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
  4. version 2 of user/organization tenant account module - UN-1424 #432

Dependencies Versions

Notes on Testing

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

Copy link
Contributor

@ritwik-g ritwik-g left a comment

Choose a reason for hiding this comment

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

Overall looks okay. Would be better if we enrich error logs.

@muhammad-ali-e
Copy link
Contributor Author

Overall looks okay. Would be better if we enrich error logs.

Addressed All comments

Copy link
Contributor

@vishnuszipstack vishnuszipstack left a comment

Choose a reason for hiding this comment

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

Left a NIT comment, others looks good.

backend/platform_settings_v2/platform_auth_service.py Outdated Show resolved Hide resolved
muhammad-ali-e and others added 2 commits July 5, 2024 11:32
Co-authored-by: Chandrasekharan M <[email protected]>
Signed-off-by: ali <[email protected]>
Co-authored-by: Chandrasekharan M <[email protected]>
Signed-off-by: ali <[email protected]>
Copy link

sonarqubecloud bot commented Jul 5, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link
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}}$$

Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

@hari-kuriakose hari-kuriakose merged commit c805c80 into main Jul 15, 2024
4 of 5 checks passed
@hari-kuriakose hari-kuriakose deleted the feat/MultiTenancyV2-Platform-settings branch July 15, 2024 11:28
@hari-kuriakose
Copy link
Contributor

We can take care of duplication when we delete v1 eventually. Bypassing.

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