readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Build: run `cat readthedocs.yaml` even when there is a config error

Open humitos opened this issue 1 year ago • 1 comments
trafficstars

I just realized that we first validate the readthedocs.yaml file and then run cat readthedocs.yaml to show its content. What happens? If there is a syntax error or a missing required value or anything, we don't run the cat command. This makes hard to debug and understand what's going on.

We should first run the cat command and after that validate the file. This will help a lot with UX.

Example: https://beta.readthedocs.org/projects/test-builds/builds/23364407/

humitos avatar Feb 06 '24 17:02 humitos

Related to

  • https://github.com/readthedocs/readthedocs.org/issues/7005
  • https://github.com/readthedocs/readthedocs.org/issues/4288

humitos avatar Feb 28 '24 16:02 humitos

This issue would have been being helpful on this case https://github.com/readthedocs/readthedocs.org/issues/11173 where the user had two YAML file in the repository and Read the Docs was picking the incorrect one.

humitos avatar Feb 29 '24 17:02 humitos

I took a look at this and it seems we need to split the readthedocs.config.config.load() function into two:

  1. find the YAML file to load
  2. load the YAML file and validate it

Moving out 1) will allow us to know what's the file we will be loading and show it to the user before loading and validating.

humitos avatar Feb 29 '24 17:02 humitos

I think this an okay first step to take, but discussed next steps on this particular command more in #7005.

agjohnson avatar Feb 29 '24 19:02 agjohnson