-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Build: log usage of old output directory _build/html
#10038
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
Conversation
We have changed the output directory from `_build/html` to `$READTHEDOCS_OUTPUT/html` in the last few weeks. However, there are some projects that may have `_build/html` directory hardcoded in different places (e.g. `conf.py`). We want to log these projects and contact them to communicate this situation. Ideally, we should show a warning in the build detail's page, but I don't think we currently have a way to display a warning message. We only support error messages in this page. Related #10036
) | ||
if code == 0: | ||
log.warning( | ||
"Directory '_build/html' exists. This may lead to unexpected behavior." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should raise something user facing as well. I'm still a huge +1 on better error/warning patterns, but would it make sense to set the Build.error
here? If there is something in this path, that almost certainly mean the build will be missing content if we don't fail the build explicitly.
# and log these projects so we can communicate with their maintainers | ||
# | ||
# This temporal and should be removed in the future once we have | ||
# decided what to do with this collected data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably aren't as concerned about collecting this data as we are about saving user builds from having bad content. Anyone using doxygen and friends could have _build/html
hardcoded, and will have silently broken docs.
It seems easier on us to just emit a build error. Is there a strong reason not to raise a build error instead? |
@agjohnson the only reason was that I thought we didn't want to fail the build. I will update this PR (or close it and open a new one) to raise an error and clearly communicate this to the users. |
Also, I'm not against logging this for our purposes either, that seems wise too. If we're really unsure how many builds might fail from this, that's perhaps a reason to add logging first. But it seems there probably aren't a lot of projects hitting this scenario, so I'm 👍 on jumping right to failing, and probably as soon as we can. If you think there are a lot of builds that will hit this, let's start with logging, but follow up very soon with build failures. |
…mitos/log-usage-old-output-directory
@agjohnson OK. I updated this PR so it goes out next week and we start collecting this data. I will open a new PR that fails the build completely in those cases, but we may not get in time to deploy it next week tho. |
* Build: check for `_build/html` directory and fail if exists Continuation of #10038 Closes #10036 * Update exception message Co-authored-by: Anthony <[email protected]> --------- Co-authored-by: Anthony <[email protected]>
We have changed the output directory from
_build/html
to$READTHEDOCS_OUTPUT/html
in the last few weeks.However, there are some projects that may have
_build/html
directory hardcoded in different places (e.g.conf.py
). We want to log these projects and contact them to communicate this situation.Ideally, we should show a warning in the build detail's page, but I don't think we currently have a way to display a warning message. We only support error messages in this page.
Related #10036