Skip to content

Proxito: Next steps on Improve URL Handling #9911

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

Closed
ericholscher opened this issue Jan 17, 2023 · 15 comments · Fixed by #10044, #10067, #10069, #10074 or #10037
Closed

Proxito: Next steps on Improve URL Handling #9911

ericholscher opened this issue Jan 17, 2023 · 15 comments · Fixed by #10044, #10067, #10069, #10074 or #10037
Assignees

Comments

@ericholscher
Copy link
Member

ericholscher commented Jan 17, 2023

Design doc: https://dev.readthedocs.io/en/latest/design/better-doc-urls-handling.html

First work: #9534 #9500 #9462

What are the next steps here?

@ericholscher ericholscher converted this from a draft issue Jan 17, 2023
@ericholscher
Copy link
Member Author

@stsewd Thoughts on next steps for this work? Wanting to make sure we don't lose it.

@ericholscher ericholscher changed the title Next steps on https://dev.readthedocs.io/en/latest/design/better-doc-urls-handling.html Next steps on Improve URL Handling Jan 17, 2023
@stsewd
Copy link
Member

stsewd commented Jan 23, 2023

So, the last thing I did related to this is #9726. There I'm refactoring the code so introducing the new resolver is easier.

I was also playing with how the new implementation will look like at #9710 (DO NOT REVIEW, I'm only playing around with the new implementation).

Next steps could be checking what we can remove/refactor from the middleware, so it is easy to integrate with the new implementation. I was thinking of introducing the new implementation incrementally, this is, serving some of our docs with the old implementation and other with the new one, this could be archived by splitting the traffic to each view, like serving all subprojects with the new implementation or projects that start with x or similar.

Oh, we also need to migrate projects using the custom URLs feature to the new implementation

@ericholscher
Copy link
Member Author

ericholscher commented Jan 24, 2023

Next steps could be checking what we can remove/refactor from the middleware, so it is easy to integrate with the new implementation. I was thinking of introducing the new implementation incrementally, this is, serving some of our docs with the old implementation and other with the new one, this could be archived by splitting the traffic to each view, like serving all subprojects with the new implementation or projects that start with x or similar.

This sounds good. We could also just feature flag it?

Oh, we also need to migrate projects using the custom URLs feature to the new implementation

Yea, that should be a very small number though at least. But a couple big ones on .com we want to be careful with.

@stsewd stsewd moved this from Planned to In progress in 📍Roadmap Jan 25, 2023
@ericholscher
Copy link
Member Author

#10044

@stsewd
Copy link
Member

stsewd commented Mar 1, 2023

Hmm, looks like the linked PRs will close this issue when merged.

@stsewd stsewd reopened this Mar 1, 2023
@github-project-automation github-project-automation bot moved this from Needs review to In progress in 📍Roadmap Mar 1, 2023
@ericholscher
Copy link
Member Author

Yea... silly.

@github-project-automation github-project-automation bot moved this from In progress to Done in 📍Roadmap Mar 1, 2023
@ericholscher ericholscher reopened this Mar 1, 2023
@github-project-automation github-project-automation bot moved this from Done to In progress in 📍Roadmap Mar 1, 2023
@github-project-automation github-project-automation bot moved this from In progress to Done in 📍Roadmap Mar 2, 2023
@stsewd stsewd reopened this Mar 2, 2023
@github-project-automation github-project-automation bot moved this from Done to In progress in 📍Roadmap Mar 2, 2023
@ericholscher
Copy link
Member Author

Fighting the bots :D

@github-project-automation github-project-automation bot moved this from In progress to Done in 📍Roadmap Mar 2, 2023
@stsewd stsewd reopened this Mar 2, 2023
@github-project-automation github-project-automation bot moved this from Done to In progress in 📍Roadmap Mar 2, 2023
@github-project-automation github-project-automation bot moved this from In progress to Done in 📍Roadmap Mar 7, 2023
@stsewd
Copy link
Member

stsewd commented Mar 8, 2023

Forgot to re-open this :D

@stsewd stsewd reopened this Mar 8, 2023
@github-project-automation github-project-automation bot moved this from Done to In progress in 📍Roadmap Mar 8, 2023
@humitos
Copy link
Member

humitos commented Mar 8, 2023

@stsewd can you expand here with an update for this issue? What's missing? What's blocked? What was done already?

@stsewd
Copy link
Member

stsewd commented Mar 9, 2023

  • We are using the new implementation to serve 200 and redirects on some projects
  • Next week after deploy, we will be able to serve 404s with the new implementation
  • We are still missing implementing support for custom URLs
  • We won't see all benefits of the new implementation till we put all serving into a single view, this is migrating
    # (Sub)project w/ translation and versions
    re_path(
    (
    r'^(?:projects/(?P<subproject_slug>{project_slug})/)?'
    r'(?P<lang_slug>{lang_slug})/'
    r'(?P<version_slug>{version_slug})/'
    r'(?P<filename>{filename_slug})$'.format(**pattern_opts)
    ),
    ServeDocs.as_view(),
    name='docs_detail',
    ),
    # Hack /en/latest so it redirects properly
    # We don't want to serve the docs here,
    # because it's at a different level of serving so relative links break.
    re_path(
    (
    r'^(?:projects/(?P<subproject_slug>{project_slug})/)?'
    r'(?P<lang_slug>{lang_slug})/'
    r'(?P<version_slug>{version_slug})$'.format(**pattern_opts)
    ),
    fast_404,
    name='docs_detail_directory_indexing',
    ),
    # # TODO: Support this?
    # # (Sub)project translation and single version
    # re_path(
    # (
    # r'^(?:|projects/(?P<subproject_slug>{project_slug})/)'
    # r'(?P<lang_slug>{lang_slug})/'
    # r'(?P<filename>{filename_slug})$'.format(**pattern_opts)
    # ),
    # serve_docs,
    # name='docs_detail',
    # ),
    # (Sub)project single version
    re_path(
    (
    # subproject_slash variable at the end of this regex is for ``/projects/subproject``
    # so that it will get captured here and redirect properly.
    r'^(?:projects/(?P<subproject_slug>{project_slug})(?P<subproject_slash>/?))?'
    r'(?P<filename>{filename_slug})$'.format(**pattern_opts)
    ),
    ServeDocs.as_view(),
    name='docs_detail_singleversion_subproject',
    ),

into a single entry point

@ericholscher
Copy link
Member Author

We are still missing implementing support for custom URLs

Excited for this!

@ericholscher
Copy link
Member Author

  • We are still missing implementing support for custom URLs
  • We won't see all benefits of the new implementation till we put all serving into a single view, this is migrating
    # (Sub)project w/ translation and versions
    re_path(
    (
    r'^(?:projects/(?P<subproject_slug>{project_slug})/)?'
    r'(?P<lang_slug>{lang_slug})/'
    r'(?P<version_slug>{version_slug})/'
    r'(?P<filename>{filename_slug})$'.format(**pattern_opts)
    ),
    ServeDocs.as_view(),
    name='docs_detail',
    ),
    # Hack /en/latest so it redirects properly
    # We don't want to serve the docs here,
    # because it's at a different level of serving so relative links break.
    re_path(
    (
    r'^(?:projects/(?P<subproject_slug>{project_slug})/)?'
    r'(?P<lang_slug>{lang_slug})/'
    r'(?P<version_slug>{version_slug})$'.format(**pattern_opts)
    ),
    fast_404,
    name='docs_detail_directory_indexing',
    ),
    # # TODO: Support this?
    # # (Sub)project translation and single version
    # re_path(
    # (
    # r'^(?:|projects/(?P<subproject_slug>{project_slug})/)'
    # r'(?P<lang_slug>{lang_slug})/'
    # r'(?P<filename>{filename_slug})$'.format(**pattern_opts)
    # ),
    # serve_docs,
    # name='docs_detail',
    # ),
    # (Sub)project single version
    re_path(
    (
    # subproject_slash variable at the end of this regex is for ``/projects/subproject``
    # so that it will get captured here and redirect properly.
    r'^(?:projects/(?P<subproject_slug>{project_slug})(?P<subproject_slash>/?))?'
    r'(?P<filename>{filename_slug})$'.format(**pattern_opts)
    ),
    ServeDocs.as_view(),
    name='docs_detail_singleversion_subproject',
    ),

into a single entry point

@stsewd are either of these good to plan on for next sprint? We need to roll out the proxito serving via feature flag more widely. Seems like the single view refactor will be easier, I'm guessing?

@stsewd
Copy link
Member

stsewd commented Mar 14, 2023

Seems like the single view refactor will be easier, I'm guessing?

That would be the final step, since it would be difficult to do that with a feature flag.

@stsewd stsewd changed the title Next steps on Improve URL Handling Proxito: Next steps on Improve URL Handling Mar 15, 2023
@stsewd stsewd linked a pull request Apr 20, 2023 that will close this issue
@stsewd
Copy link
Member

stsewd commented Jun 7, 2023

Next steps after #10156 is merged:

@github-project-automation github-project-automation bot moved this from In progress to Done in 📍Roadmap Jun 7, 2023
@ericholscher ericholscher reopened this Jun 7, 2023
@github-project-automation github-project-automation bot moved this from Done to In progress in 📍Roadmap Jun 7, 2023
@github-project-automation github-project-automation bot moved this from In progress to Done in 📍Roadmap Jun 7, 2023
@ericholscher
Copy link
Member Author

ericholscher commented Jun 7, 2023

I'm going to migrate the above comment into a new issue, since we're now done with the initial work here!

The finishing work now lives in #10408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment