readthedocs / actions

GitHub Actions for Read the Docs
MIT License
33 stars 10 forks source link

Support the "Multiple versions without translations (`/<version>/<filename>`)" versioning scheme #42

Open edgarrmondragon opened 1 month ago

edgarrmondragon commented 1 month ago

Currently only two schemes are supported by this action:

https://github.com/readthedocs/actions/blob/43ac444506db41f07391f7c9e82c0e71943f0ea5/preview/scripts/edit-description.js#L20-L24

Which correspond to "Single version without translations (/<filename>)" and "Multiple versions with translations (/<language>/<version>/<filename>)" respectively.

Fix might be adding a new option (e.g. no-translations) or a special value none for project-language, and use that in a condition to build the right URL.

edgarrmondragon commented 1 month ago

I can probably take some time to submit a PR in the coming days, would that be of interest to you @humitos?

humitos commented 1 month ago

I think we should add a new attribute called "versioning-scheme" (which is what the APIv3 uses https://docs.readthedocs.io/en/stable/api/v3.html#project-details) and base the URL on that.

humitos commented 1 month ago

Also, now that APIv3 is open and un-authed, we could propbably only ask the user for the slug and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.

edgarrmondragon commented 1 month ago

Also, now that APIv3 is open and un-authed, we could propbably only ask the user for the slug and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.

I see, that makes sense. Seems like with the response from https://readthedocs.org/api/v3/projects/<slug>/ we could get rid of 2 settings

stsewd commented 4 weeks ago

Also, now that https://github.com/readthedocs/readthedocs.org/pull/11485, we could propbably only ask the user for the slug and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.

We shouldn't rely on this API for all projects, on .com projects are private, and we can't hit the API directly for those without auth.

edgarrmondragon commented 4 weeks ago

Also, now that readthedocs/readthedocs.org#11485, we could propbably only ask the user for the slug and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.

We shouldn't rely on this API for all projects, on .com projects are private, and we can't hit the API directly for those without auth.

Gotcha. It's probably better then to deprecate single-version in favor of versioning-scheme, for example.