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

Missing redirects for specs after changes in documentation. #1486

Closed
abravalheri opened this issue Jan 22, 2024 · 9 comments
Closed

Missing redirects for specs after changes in documentation. #1486

abravalheri opened this issue Jan 22, 2024 · 9 comments

Comments

@abravalheri
Copy link
Contributor

abravalheri commented Jan 22, 2024

Recently there have been a lot of improvements in the documentation, but I feel like we are living behind some broken URLs, specially when it comes to the specs.

I think that all the improvements are welcome, however we should strive to make the link to the specs stable, by at least adding redirects to them.

This is important because in the case of live specs we don't have IDs to refer to them (as in PEPs), so the best we can do is to use the URL as identifier. If the URLs are not stable, then we run out of options.

One example of this is:

Probably there are other ones too (this is not meant to be an exhaustive list)...

@abravalheri abravalheri changed the title Missing redirects for specs Missing redirects for specs after changes in documentation. Jan 22, 2024
@jeanas
Copy link
Contributor

jeanas commented Jan 22, 2024

I don't understand what's happening. We did add that redirect, in #1437, and it used to work.

@jeanas
Copy link
Contributor

jeanas commented Jan 22, 2024

ReadTheDocs deployed an overhaul of their redirects system recently, readthedocs/readthedocs.org#10881, maybe something broke with that?

@jeanas
Copy link
Contributor

jeanas commented Jan 22, 2024

Let me try to debug this. @ewdurbin Could you please send the list of redirects output by the ReadTheDocs post their refactoring, like you did in comment #1408 (comment)? For your convenience, the command should be

curl -H "Authorization: Token YOUR_RTD_TOKEN" https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/ | jq

@ewdurbin
Copy link
Member

pancack:~ ee$ curl -s -H"Authorization: Token $RTD_TOKEN" https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/?limit=100 | jq
{
  "count": 55,
  "next": null,
  "previous": null,
  "results": [
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/1988/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2018-08-28T05:44:16.094298Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.563242Z",
      "pk": 1988,
      "position": 0,
      "project": "python-packaging-user-guide",
      "to_url": "/",
      "type": "html_to_clean_url"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/6097/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2019-04-23T17:24:23.469262Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/guides/installing-using-pip-and-virtualenv",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.557366Z",
      "pk": 6097,
      "position": 1,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-using-pip-and-virtual-environments/",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15891/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-06T16:51:22.589201Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/*",
      "http_status": 302,
      "modified": "2024-01-03T19:15:19.087328Z",
      "pk": 15891,
      "position": 2,
      "project": "python-packaging-user-guide",
      "to_url": "/en/latest/:splat",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15922/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-07T14:02:52.697363Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/tutorials/distributing-packages",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.546311Z",
      "pk": 15922,
      "position": 3,
      "project": "python-packaging-user-guide",
      "to_url": "/en/latest/tutorials/packaging-projects",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15963/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:22:44.130455Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/distributing",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.540554Z",
      "pk": 15963,
      "position": 4,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/packaging-projects/",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15964/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:23:28.549642Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/distributing",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.535076Z",
      "pk": 15964,
      "position": 5,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/packaging-projects",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15965/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:37.655080Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/guides/installing-using-pip-and-virtualenv",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.529647Z",
      "pk": 15965,
      "position": 6,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-using-pip-and-virtual-environments/",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15966/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:37.799867Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/additional",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.524094Z",
      "pk": 15966,
      "position": 7,
      "project": "python-packaging-user-guide",
      "to_url": "/guides",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15967/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:37.953545Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/quickstart",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.518594Z",
      "pk": 15967,
      "position": 8,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15968/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.104899Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/platforms",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.513223Z",
      "pk": 15968,
      "position": 9,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-scientific-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15969/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.250574Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/tutorial",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.507750Z",
      "pk": 15969,
      "position": 10,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15970/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.391418Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/installing",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.502257Z",
      "pk": 15970,
      "position": 11,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/installing-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15971/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.526501Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/deployment",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.489897Z",
      "pk": 15971,
      "position": 12,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/deploying-python-applications",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15972/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.674693Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/requirements",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.484466Z",
      "pk": 15972,
      "position": 13,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/install-requires-vs-requirements",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15973/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.811564Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/pip_easy_install",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.478840Z",
      "pk": 15973,
      "position": 14,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/pip-vs-easy-install",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15974/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:38.940918Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/wheel_egg",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.473070Z",
      "pk": 15974,
      "position": 15,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/wheel-vs-egg",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15975/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.073554Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/plugin_discovery",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.467586Z",
      "pk": 15975,
      "position": 16,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/creating-and-discovering-plugins",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15976/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.214184Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/self_hosted_repository",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.462029Z",
      "pk": 15976,
      "position": 17,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/hosting-your-own-index",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15977/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.350923Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/mirrors",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.456653Z",
      "pk": 15977,
      "position": 18,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/index-mirrors-and-caches",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15978/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.497045Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/science",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.451081Z",
      "pk": 15978,
      "position": 19,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-scientific-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15979/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.633554Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/install_requirements_linux",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.445590Z",
      "pk": 15979,
      "position": 20,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-using-linux-tools",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15980/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.775094Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/multi_version_install",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.439295Z",
      "pk": 15980,
      "position": 21,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/multi-version-installs",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15981/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:39.920751Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/extensions",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.433891Z",
      "pk": 15981,
      "position": 22,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/packaging-binary-extensions",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15982/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:40.071016Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/namespace_packages",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.428206Z",
      "pk": 15982,
      "position": 23,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/packaging-namespace-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15983/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:40.214306Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/single_source_version",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.422284Z",
      "pk": 15983,
      "position": 24,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/single-sourcing-package-version",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15984/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:40.361674Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/multiple_python_versions",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.416828Z",
      "pk": 15984,
      "position": 25,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/supporting-multiple-python-versions",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15985/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:40.515722Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/appveyor",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.411456Z",
      "pk": 15985,
      "position": 26,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/supporting-windows-using-appveyor",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15986/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:40.680519Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/current",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.404927Z",
      "pk": 15986,
      "position": 27,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/tool-recommendations",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15987/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:40.825754Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/installing",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.399077Z",
      "pk": 15987,
      "position": 28,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/installing-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15988/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.003168Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/installing",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.392694Z",
      "pk": 15988,
      "position": 29,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/installing-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15989/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.162358Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/additional",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.387015Z",
      "pk": 15989,
      "position": 30,
      "project": "python-packaging-user-guide",
      "to_url": "/guides",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15990/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.312802Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/quickstart",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.381478Z",
      "pk": 15990,
      "position": 31,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15991/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.408904Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/platforms",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.375683Z",
      "pk": 15991,
      "position": 32,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-scientific-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15992/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.546589Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/tutorial",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.370275Z",
      "pk": 15992,
      "position": 33,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15993/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.815877Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/installing",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.364736Z",
      "pk": 15993,
      "position": 34,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/installing-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15994/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:41.949133Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/deployment",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.359021Z",
      "pk": 15994,
      "position": 35,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/deploying-python-applications",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15995/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.082369Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/requirements",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.353665Z",
      "pk": 15995,
      "position": 36,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/install-requires-vs-requirements",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15996/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.229119Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/pip_easy_install",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.348131Z",
      "pk": 15996,
      "position": 37,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/pip-vs-easy-install",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15997/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.336146Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/wheel_egg",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.342287Z",
      "pk": 15997,
      "position": 38,
      "project": "python-packaging-user-guide",
      "to_url": "/discussions/wheel-vs-egg",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15998/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.469316Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/plugin_discovery",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.336908Z",
      "pk": 15998,
      "position": 39,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/creating-and-discovering-plugins",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15999/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.576390Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/self_hosted_repository",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.330335Z",
      "pk": 15999,
      "position": 40,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/creating-and-discovering-plugins",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16000/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.673861Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/mirrors",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.324564Z",
      "pk": 16000,
      "position": 41,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/index-mirrors-and-caches",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16001/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.818005Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/science",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.318742Z",
      "pk": 16001,
      "position": 42,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-scientific-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16002/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:42.954186Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/install_requirements_linux",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.313082Z",
      "pk": 16002,
      "position": 43,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/installing-using-linux-tools",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16003/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:43.087530Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/multi_version_install",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.307622Z",
      "pk": 16003,
      "position": 44,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/multi-version-installs",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16004/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:43.319275Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/extensions",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.301672Z",
      "pk": 16004,
      "position": 45,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/packaging-binary-extensions",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16005/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:43.436730Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/namespace_packages",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.295278Z",
      "pk": 16005,
      "position": 46,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/packaging-namespace-packages",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16006/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:43.580865Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/single_source_version",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.288626Z",
      "pk": 16006,
      "position": 47,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/single-sourcing-package-version",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16007/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:43.751788Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/multiple_python_versions",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.282276Z",
      "pk": 16007,
      "position": 48,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/supporting-multiple-python-versions",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16008/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:43.888092Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/appveyor",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.275947Z",
      "pk": 16008,
      "position": 49,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/supporting-windows-using-appveyor",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16009/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:44.032108Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/current",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.269578Z",
      "pk": 16009,
      "position": 50,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/tool-recommendations",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16010/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:44.134924Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/current.html",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.261828Z",
      "pk": 16010,
      "position": 51,
      "project": "python-packaging-user-guide",
      "to_url": "/guides/tool-recommendations",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/16011/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2021-12-13T14:27:44.286551Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/tutorials/distributing-packages",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.248631Z",
      "pk": 16011,
      "position": 52,
      "project": "python-packaging-user-guide",
      "to_url": "/tutorials/packaging-projects",
      "type": "exact"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/21920/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2023-12-06T20:18:14.370974Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/specifications/declaring-project-metadata",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.238671Z",
      "pk": 21920,
      "position": 53,
      "project": "python-packaging-user-guide",
      "to_url": "/specifications/pyproject-toml/",
      "type": "page"
    },
    {
      "_links": {
        "_self": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/21919/",
        "project": "https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"
      },
      "created": "2023-12-06T20:17:57.062443Z",
      "description": "",
      "enabled": true,
      "force": false,
      "from_url": "/specifications/declaring-build-dependencies",
      "http_status": 302,
      "modified": "2024-01-03T18:43:01.230776Z",
      "pk": 21919,
      "position": 54,
      "project": "python-packaging-user-guide",
      "to_url": "/specifications/pyproject-toml/",
      "type": "page"
    }
  ]
}

@jeanas
Copy link
Contributor

jeanas commented Jan 22, 2024

Oh, I see. That's readthedocs/readthedocs.org#10963.

Basically, we have a redirect /<foo>/en/latest/<foo> in 3rd position, and this pattern /<foo> matches everything, although of course the target URL is only defined if foo doesn't start with /en/latest/. The issue is that ReadTheDocs applies redirects in order, and takes only the first that matches. If the target URL doesn't exist then the redirect won't get applied but it's still considered a match. So the presence of this always-matching redirect effectively nullifies all later redirects.

I'm not sure why it used to work. The ordering of redirects was not well-defined before their refactoring, maybe it got changed in the process.

@ewdurbin Please do the following (I've tested it on a playground project, https://rtd-redirects-test.readthedocs.io):

curl -X DELETE -H "Authorization: Token $RTD_TOKEN" https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15891/
curl -X POST -H "Authorization: Token $RTD_TOKEN" -H "Content-Type: application/json" https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/ -d '{"type": "exact", "from_url": "/*", "to_url": "/en/latest/:splat", "position": 1000}'

This should delete that redirect, and then recreate it but this time at the end of the list.

@jeanas
Copy link
Contributor

jeanas commented Jan 25, 2024

(@webknjaz: Since I see you assigned the issue to @ewdurbin, remember that actually you have the access rights to do this too 😉)

@ewdurbin
Copy link
Member

Done:

pancack:~ ee$ curl -X DELETE -H "Authorization: Token $RTD_TOKEN" https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/15891/
pancack:~ ee$ curl -X POST -H "Authorization: Token $RTD_TOKEN" -H "Content-Type: application/json" https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/ -d '{"type": "exact", "from_url": "/*", "to_url": "/en/latest/:splat", "position": 1000}'
{"_links":{"_self":"https://readthedocs.org/api/v3/projects/python-packaging-user-guide/redirects/22512/","project":"https://readthedocs.org/api/v3/projects/python-packaging-user-guide/"},"created":"2024-01-29T11:21:35.207594Z","description":"","enabled":true,"force":false,"from_url":"/*","http_status":302,"modified":"2024-01-29T11:21:35.207631Z","pk":22512,"position":54,"project":"python-packaging-user-guide","to_url":"/en/latest/:splat","type":"exact"}

@ewdurbin ewdurbin removed their assignment Jan 29, 2024
@jeanas
Copy link
Contributor

jeanas commented Jan 30, 2024

Thanks! The redirects are working again, closing.

@chrysle
Copy link
Contributor

chrysle commented Jan 30, 2024

Thanks for resolving @jeanas, great work!

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

No branches or pull requests

4 participants