Skip to content

Feat/multi tenancy v2 context and organization#430

Merged
muhammad-ali-e merged 15 commits into
mainfrom
feat/MultiTenancyV2-context-and-Organization
Jul 1, 2024
Merged

Feat/multi tenancy v2 context and organization#430
muhammad-ali-e merged 15 commits into
mainfrom
feat/MultiTenancyV2-context-and-Organization

Conversation

@muhammad-ali-e

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

Copy link
Copy Markdown
Contributor

What

  • Multi-tenanct -V2 Changes
  • User context helper methods to retrieve the current user and their organizations.
  • Oganization model mixin for adding organization fields to various models.

Why

  • These additions are part of the Multi-tenant v2 enhancements.

How

  • New helper methods for user context to get the current user and their organizations.
  • Created a model mixin to add organization fields to different models.

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)

  • All new methods are self-contained and not called from anywhere within the existing applications. The changes in user_session.py are controlled by a feature flag, ensuring they do not affect current functionality.

Database Migrations

  • No

Env Config

Relevant Docs

Related Issues or PRs

  1. unstract-multi-tenantV2 feature-flag changes #422

Dependencies Versions

Notes on Testing

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2024

Copy link
Copy Markdown

@muhammad-ali-e muhammad-ali-e requested review from a team, athul-rs, hari-kuriakose, jaseemjaskp, johnyrahul and kirtimanmishrazipstack and removed request for a team July 1, 2024 04:21
@muhammad-ali-e muhammad-ali-e marked this pull request as ready for review July 1, 2024 04:22
@github-actions

github-actions Bot commented Jul 1, 2024

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

@athul-rs athul-rs 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.

LGTM

@muhammad-ali-e muhammad-ali-e merged commit c3f2d94 into main Jul 1, 2024
@muhammad-ali-e muhammad-ali-e deleted the feat/MultiTenancyV2-context-and-Organization branch July 1, 2024 06:27
pk-zipstack pushed a commit that referenced this pull request Aug 20, 2025
* unstract-multi-tenantV2 feature-flag changes

* featureflag function bring to under flags package to avoid dplication

* resolved merge conflicts with main

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* precommit lints

* remove feature flags utiliy function from backend

* cleanup prints statement from unstract flipt packages and added warning instead

* sonar issue resolved from logger

* User context and Organization mixins to use for v2

---------

Signed-off-by: ali <117142933+muhammad-ali-e@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

3 participants