Skip to content

[feature] - Add feature of promoting suborg to parent org#371

Open
LalitDeore wants to merge 2 commits intoShuffle:mainfrom
LalitDeore:suborg
Open

[feature] - Add feature of promoting suborg to parent org#371
LalitDeore wants to merge 2 commits intoShuffle:mainfrom
LalitDeore:suborg

Conversation

@LalitDeore
Copy link
Copy Markdown
Collaborator

When a sub-organization is promoted to a parent organization:

  1. Auth, datastore, files, and environment data that were shared from the original parent organization are no longer available.
  2. Distributed workflows are detached from the original parent organization. A copy of each distributed workflow is stored in the sub-organization and remains accessible after the promotion.
  3. All caches related to workflows, users, organization data, files, auth, and datastore are cleared in both the organization region and the main region.

Note: This feature is available only to support users initially.

Copy link
Copy Markdown
Member

@frikky frikky left a comment

Choose a reason for hiding this comment

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

I'm sure it works fine for support users only, but I'm worried about opening it up.

It is a cool feature tho, if it works.

Comment thread shared.go
return
}

if !user.SupportAccess {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm primarily worried what would happen here if we give this to users, which is.. kind of the point. They should control this themselves.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should we make this available to normal users? I am afraid that if someone promotes a sub-organization to a parent organization without understanding the impact, they could lose access to distributed auth, files, datastore, and environment data due to how things are currently set up and this can impact workflows. I would prefer to keep this limited to support users. Let me know in case you want me to make it public for normal users.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

They can just move it back then? References aren't lost..

Comment thread shared.go Outdated
Comment thread shared.go Outdated
Comment thread shared.go
}

for _, workflow := range workflowItems {
if workflow.ParentWorkflowId == "" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't this be the same as "stealing" a workflow?

Not sure.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We skip workflows where workflow.ParentWorkflowId == "".

If a workflow has a parent org ID, it means the workflow is distributed, so we reset it to empty but we are making copy of workflow when distributed. That's why it is still accessible after promoting to parent org.

Comment thread shared.go
}
}

func HandlePromoteSubOrg(resp http.ResponseWriter, request *http.Request) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please document the API right away on the "API" docs. Otherwise we will forget it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(this is why I try to not make new APIs if we don't NEED to) :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Okay, will write doc for it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have added doc for it in below PR.

Shuffle/shuffle-docs#227

Copy link
Copy Markdown
Member

@frikky frikky left a comment

Choose a reason for hiding this comment

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

And again, I want to emphasise: The usage of distributed systems is lower than 0.1% of our userbase. Literally one in 1k max. And they are power-users. Power-users need power-tools.

Publishing the system is the whole point. Otherwhise, why have an API at all? That's just code that won't be used..?

Which I tried to make it clear:

  1. MANUALLY DO THIS THIS TIME. Why do we need to waste time building an endpoint that won't be used?

... or

  1. Build a proper system that can be used by our users at scale to change parent/child relations at will if they are admins. That way it could actually be useful for management

Comment thread shared.go
return
}

if !user.SupportAccess {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

They can just move it back then? References aren't lost..

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.

2 participants