Skip to content

Custom domains: don't allow adding a custom domain on subprojects #8953

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

Merged
merged 14 commits into from
May 12, 2022

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 21, 2022

Needs #8945.

@stsewd stsewd requested a review from a team as a code owner February 21, 2022 19:17
Comment on lines +25 to +28
<p class="help_text">
{% blocktrans trimmed with docs_url='https://docs.readthedocs.io/page/custom_domains.html' %}
Configuring a custom domain allows you to serve your documentation from a domain other than "{{ default_domain }}". <a href="{{ docs_url }}">Learn more</a>.
{% endblocktrans %}
Copy link
Member Author

Choose a reason for hiding this comment

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

so, not sure if we should show both messages when this is a subproject.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to just show one block. We have discussed on another issue that a better UX would be to show the form as disabled, but we can come back to this as well. There are maybe a few patterns to figure out there.

</p>
{% if superproject %}
{% url "projects_detail" superproject.slug as superproject_url %}
<p class="help_text">
Copy link
Member Author

Choose a reason for hiding this comment

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

don't think we have something like a class for a "warning" banner.

Copy link
Contributor

Choose a reason for hiding this comment

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

We do not, not yet at least!

@agjohnson
Copy link
Contributor

I haven't had a chance to pull this down locally to test, what does the UI look like with this addition? I'm assuming looking at the code that this doesn't alter the actually domain form UX, it just adds a warning block to the page.

I feel this is a good compromise, even though good UX here would probably be to block this scenario entirely and only allowing subprojects to remove existing domains. I assume if we dug into the data here, we'd only have a handful of projects in the particular state.

@agjohnson
Copy link
Contributor

Actually, on second thought, is there a reason we don't want to do something like block the creation of new project custom domains if the project is a subproject?

@stsewd
Copy link
Member Author

stsewd commented Mar 1, 2022

Actually, on second thought, is there a reason we don't want to do something like block the creation of new project custom domains if the project is a subproject?

I think they are still useful as a "short link", subproject.domain.com/en/latest/foo.html -> main.domain.com/projects/subproject/en/latest/foo.html.

Maybe even to not break existing links if a project is being converted into a subproject (but the domain would be already there in most cases).

@stsewd
Copy link
Member Author

stsewd commented Mar 2, 2022

It looks like this, a little opaque, but that's how it looks like right now.

Screenshot 2022-03-02 at 17-30-23 Edit Domains Read the Docs
Screenshot 2022-03-02 at 17-30-03 Edit Domains Read the Docs

Also, just saw that we are completely overriding this template on .com, so I'd need to port the changes or see if we can just use the same from .org (I think we should be able to do this now).

@stsewd
Copy link
Member Author

stsewd commented Mar 2, 2022

Also, just saw that we are completely overriding this template on .com, so I'd need to port the changes or see if we can just use the same from .org (I think we should be able to do this now).

Hmm, looks like the listing is better on .com, but it has specific classes that only exists on .com, so when porting those to .org it doesn't look right.

Screenshot 2022-03-02 at 18-07-13 Custom Domains - Read the Docs for Business

Screenshot 2022-03-02 at 18-07-45 Edit Domains Read the Docs

@humitos
Copy link
Member

humitos commented Mar 3, 2022

I think they are still useful as a "short link", subproject.domain.com/en/latest/foo.html -> main.domain.com/projects/subproject/en/latest/foo.html.

Maybe even to not break existing links if a project is being converted into a subproject (but the domain would be already there in most cases).

If these are the only use cases we have in mind at the moment, I'd say to not allow creating a domain on a subproject as Anthony mentioned already, and explain that in the UI and documentation. I think allowing this just adds more confusion to our users and more complexity to our codebase with little winning.

@agjohnson
Copy link
Contributor

Yeah, that's a good niche use case. But might be a bit confusing for most users, who would probably expect the subproject domain to take precedence or at least show in the request.

@stsewd
Copy link
Member Author

stsewd commented Mar 7, 2022

Opened #8985 to discuss about removing that "feature". But if you all agree, then I can just change this PR to do that.

@agjohnson
Copy link
Contributor

If you'd rather get this merged, that sounds fair. I will say I think the better user interaction will just be blocking domain creation. I've never been convinced that adding words to a UI makes any difference with what users do with the UI, so I'm skeptical that users will read this new block. But, no reason we can't split this into two chunks of work. I'm impartial on the order, whether we disable now and try to rework your use case back in, or we leave it enabled and eventually disable creation altogether.

@stsewd stsewd requested a review from a team as a code owner March 31, 2022 15:30
@stsewd stsewd marked this pull request as draft March 31, 2022 15:30
stsewd added 3 commits March 31, 2022 13:13
Wait for a proper solution to make tests pass on .com
@stsewd stsewd marked this pull request as ready for review March 31, 2022 20:21
@stsewd
Copy link
Member Author

stsewd commented Mar 31, 2022

I have changed this PR, so users aren't allowed to create/edit domains on subprojects, they can delete existing ones only.

@stsewd stsewd changed the title Custom domains: warn users about adding a custom domain to a subproject Custom domains: don't allow adding a custom domain on subprojects Mar 31, 2022
@stsewd stsewd self-assigned this Mar 31, 2022
@humitos humitos requested a review from agjohnson April 4, 2022 10:48
@ericholscher
Copy link
Member

Looks like this is waiting on @agjohnson to review to move forward?

@ericholscher ericholscher linked an issue May 3, 2022 that may be closed by this pull request
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

This looks good 👍 I don't have any specific feedback with the approach in this PR now.

@stsewd stsewd enabled auto-merge (squash) May 12, 2022 00:17
@stsewd stsewd merged commit 134f5ca into main May 12, 2022
@stsewd stsewd deleted the warn-users-domains-on-subprojects branch May 12, 2022 22:43
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.

Custom domain: remove support of custom domains on subprojects?
4 participants