-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Unresolver: strict validation for external versions and other fixes #9534
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
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e34fe11
Move code
stsewd 6ac26b0
Remove request
stsewd a732260
Return tuple
stsewd 0672724
Replace
stsewd 185771d
Refactor
stsewd 3d30d6b
Updates from review
stsewd fce39ac
Merge branch 'main' into refactor-middleware
stsewd f583d2c
Move get_domain_from_host to unresolver
stsewd 789f74c
Move unresolve_domain
stsewd 067367d
Implement unresolve_path
stsewd 1cf32b4
Use new implementation for unresolver
stsewd 53fa8aa
Tests
stsewd a62c149
Refactor and cleanup
stsewd 63d72c3
Merge branch 'main' into move-to-unresolver
stsewd aba6fc4
Rename canonical_project -> parent_project
stsewd cfe16b7
Lint
stsewd 6900724
Fix
stsewd 1e3548e
Unresolver: strict validation for external versions and other fixes
stsewd c30087f
Merge branch 'main' into strict-validation-for-external-versions
stsewd 8563286
Updates from review
stsewd 90e63cf
Merge branch 'main' into strict-validation-for-external-versions
stsewd 8fad146
Updates from review
stsewd 4d41069
Updates from review from https://github.com/readthedocs/readthedocs.o…
stsewd 5e2cade
Merge branch 'main' into strict-validation-for-external-versions
stsewd f2d3fdf
Rename
stsewd 80574f3
Black
stsewd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
Should we do something more than set these to
None
here? Is raising an exception better, rather than having the caller need to know whatNone
means on these fields?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.
Setting version to
None
will be interpreted as like the version wasn't found, but we could return None, or raise an exception, since those URLs will be generated by manually changing the URL.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 thought about this as well, and I'm not sure what's my position here.
I'd like to raise exceptions for all these cases were we return
None
for not found things. However, I'm not sure it's possible for all the cases because IIRC there are other places wereproject, None, None
is useful to continue moving forward.If that's not the case and I'm confused here, I'm 👍🏼 on standardizing this and always raise a detailed exception for each case that we can clearly handle from outside.
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.
Actually, I think the case that I'm referring to is the 404 pages (see https://github.com/readthedocs/readthedocs.org/pull/9534/files#diff-3f2b884fdd4752fe36587aee4530694e7a4ff10a8f4523a7b0bc25e9d2f11e11R162)
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.
yeah, basically this would be interpreted as a 404, like if the version wouldn't exist.