-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Design doc for organizations #5958
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
Design doc for organizations #5958
Conversation
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.
This is a good initial step. We should update it so it reflects our decisions on the questions it asks, and start actually doing the work.
So, we should only support admin permissions for teams. | ||
|
||
Subscriptions, this is only valid for the corporate site, | ||
since we don't charge for use in the community site. |
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.
We could have our Gold users map onto this, but I don't think it should be part of this migration.
|
||
We could keep the current behavior for the community site and use `organization.slug` + `project.slug` for the corporate site, | ||
since in the corporate site we don't care so much about a unique namespace between all users, but a unique namespace per organization. | ||
We can refactor the way we get the namespace to be more easy to manage in both sites. |
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.
Yea, I think we will need to keep both namespaces, since we don't want to break existing URL's. It should be simple enough to support by just changing the logic around slug creation.
7a22bb3
to
92821db
Compare
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.
I made a few small notes for clarity but I'm on board with this change. I think organizations will be great on the community site.
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.
The document looks good to me. I left some comments to clarify some sentences, but I'm mostly 👍 with it.
- Subscription | ||
|
||
This app can be named *subscriptions*. | ||
We can get around the table names and migrations by setting the explicitly the table name to `organizations_<model>`, |
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.
I think it's not terrible to rename a table, and will be cleaner. If it's trivial, I'd say that we should do it.
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.
That would generate some downtime.
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.
I think we can clean it up later. It doesn't need to be done now.
In the community site we run an initial migration, | ||
for the corporate site we run a fake migration. |
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.
How are we going to have different migrations files for the same organizations
app if it will be same code base?
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.
The models are already created on the commercial site, we can't run the migrations there again. We can remove the old migration files on the commercial site after the migration.
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.
Why not just run the migrations on the community site without removing any migration file? When all these migrations are ran in the corporate site as well, they will do nothing.
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.
The app is different and the migration files from .com depend on other models and migrations that aren't on .org.
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.
I think the plan is to just squash the migrations and start with the current state as initial. This makes sense to me, as nobody will be needing to catch up to the current state, and it's effectively a new app in the .org.
Co-Authored-By: David Fischer <[email protected]>
Another thing that I want to mention here is that in Corporate we have a Do we plan to support that? In that case, will it add any value from a user perspective? In case we don't, we should make it a |
I'm +1 on that, can be done before moving the code. |
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.
I think this is mostly ready to merge and start on. It's definitely not solving some of the problems that we'll hit along the way, but I think this plan makes sense.
- Subscription | ||
|
||
This app can be named *subscriptions*. | ||
We can get around the table names and migrations by setting the explicitly the table name to `organizations_<model>`, |
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.
I think we can clean it up later. It doesn't need to be done now.
In the community site we run an initial migration, | ||
for the corporate site we run a fake migration. |
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.
I think the plan is to just squash the migrations and start with the current state as initial. This makes sense to me, as nobody will be needing to catch up to the current state, and it's effectively a new app in the .org.
For managers and querysets that depend on subscriptions, | ||
we can use our pattern to make overridable classes (inheriting from ``SettingsOverrideObject``). | ||
|
||
Templates, urls, views, forms, notifications, signals, tasks can be moved later |
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.
I think it would be useful to have a bit more of this fleshed out. I think that moving the models is definitely the best first step, but it won't do us much good without migrating the queryset permission logic as well.
|
||
For the community site probably this approach isn't the best, | ||
since we always serve docs publicly from ``slug.readthedocs.io``. | ||
And most of the users don't have a custom domain. |
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.
What is our plan for slugs for organization projects in community then? Are we not using the organization slug at all? I have concerns about supporting both patterns at once. A collision is introduced if you slug a project with slug foo-something
and an organization project for organization slug foo
and project name something
-- ie both produce the same slug.
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.
I'm suggesting to use the project slug for users and orgs for .org. So we have foo-something
and something
.
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.
Like if a user from the pallets org creates a project named flask, the slug would be flask
, no pallets-flask
.
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.
👍 I'd agree, that seems like a good pattern for the community side.
Changes that aren't needed immediately after the migration, | ||
but that should be done: | ||
|
||
Edit the current querysets, modify/add UI elements, and add new endpoints to the API (v3 only). |
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.
Modifying the UI is not going to be a future change, it will be tied directly to this work. We should probably have an idea of at least what UI components are likely to require changes. We won't be able to just copy the UI bits into community as we've discussed structural changes -- supporting user projects and organization projects for instance.
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.
I just put some pieces not sure if we want to copy most of the UI from .com or make something different (especially for listing and detail of orgs)?
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.
If we're not going to enable this on the community site yet, and we're going to do a two step process -- move the code over, and then sometime later actually enable organizations on the community codebase -- then we can worry about UI later.
Do we want to source templates for organizations from the commercial repo or move to the community repo?
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.
Yes, it's a two step migration.
Do we want to source templates for organizations from the commercial repo or move to the community repo?
Good question, I think we can move the urls/views later, that way the templates can live in .com in the meantime and is easy to not enable organization in the community site.
The plan seems pretty close. We should codify and resolve all of the conversations we had here into the design document so we don't lose some of these decisions. The one thing I would like to have more of a plan around is the operations changes that we'll need to have considered. If we are going to skip a downtime event due to database/migration changes on the initial deploy, we should outline the next phase of this work in a separate issue and define what we're pushing off. |
Done
I did an overview of what is needed if we don't want to rename tables by ourselves https://github.com/readthedocs/readthedocs-corporate/pull/686 Nothing complex there, we just need to run a fake migration. Tested it locally. And when the app is moved to .org, the commercial site won't need a migration. |
No one else has raised any more issues on this and the work has already been started before merge here. Not much reason to keep this PR open. |
These are some considerations to make before having organizations. Most of the problems are because we already have organizations in the corporate site.
There are some decisions to make. I think the biggest ones are how to support organizations and namespacing.
For how to support organizations, I think number 2 (support users and organizations to own projects) is the way to go.