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

Unresolver: allow a full URL when un-resolving a domain #11632

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Sep 30, 2024

This also checks that the URL has a valid protocol. This is needed for https://github.com/readthedocs/readthedocs-corporate/pull/1887.

@stsewd stsewd requested a review from a team as a code owner September 30, 2024 22:07
@stsewd stsewd requested a review from humitos September 30, 2024 22:07
This also checks that the URL has a valid protocol.
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

I left some questions about this PR.

I'm a little confused with the names here. We call this method unresolve_domain, but it could also receive a URL now. However, we have another method called unresolve_url. Shouldn't we standardize this and call unresolve_domain or unresolve_url depending on what the input we have?

With this changes, what is the difference between unresolve_url and unresolve_domain now?

Comment on lines +384 to +385
with pytest.raises(InvalidSubdomainError):
unresolve("https:///pip.readthedocs.io/en/latest/")
Copy link
Member

Choose a reason for hiding this comment

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

Why this raises InvalidSubdomainError?

Copy link
Member Author

Choose a reason for hiding this comment

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

A tripe /// is interpreted as a URL without a domain.

readthedocs/core/unresolver.py Show resolved Hide resolved
@stsewd
Copy link
Member Author

stsewd commented Oct 1, 2024

With this changes, what is the difference between unresolve_url and unresolve_domain now?

unresolve_domain will resolve the domain only, everything else is ignored (it's in the docstring).

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