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

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

Open
edgarrmondragon opened this issue Jul 23, 2024 · 6 comments · May be fixed by #43
Labels
enhancement New feature or request

Comments

@edgarrmondragon
Copy link

Currently only two schemes are supported by this action:

if (RTD_SINGLE_VERSION === "true") {
RTD_URL = RTD_PROJECT_DOMAIN;
} else {
RTD_URL = RTD_PROJECT_DOMAIN + `${RTD_PROJECT_LANGUAGE}/${PR_NUMBER}/`;
}

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 edgarrmondragon changed the title Support "Multiple versions without translations (/<version>/<filename>)" versioning scheme Support the "Multiple versions without translations (/<version>/<filename>)" versioning scheme Jul 23, 2024
@humitos humitos added the enhancement New feature or request label Jul 23, 2024
@edgarrmondragon
Copy link
Author

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

@humitos
Copy link
Member

humitos commented Aug 12, 2024

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
Copy link
Member

humitos commented Aug 12, 2024

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
Copy link
Author

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

  • single-version -> versioning_scheme
  • project-language -> language.code

edgarrmondragon added a commit to edgarrmondragon/actions that referenced this issue Aug 14, 2024
@stsewd
Copy link
Member

stsewd commented Aug 14, 2024

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.

@edgarrmondragon
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants