Skip to content

Commit 9388658

Browse files
committed
Build: log usage of old output directory _build/html
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
1 parent 38fca65 commit 9388658

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

readthedocs/telemetry/collectors.py

+19
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,27 @@ def collect(self):
9292
},
9393
}
9494
data["doctool"] = self._get_doctool()
95+
96+
# NOTE: Check if there are files at `_build/html` (the old output directory)
97+
# and log these projects so we can communicate with their maintainers
98+
#
99+
# This temporal and should be removed in the future once we have
100+
# decided what to do with this collected data.
101+
self._check_using_old_output_directory()
102+
95103
return data
96104

105+
def _check_using_old_output_directory(self):
106+
code, stdout, stderr = self.run(
107+
"ls",
108+
"_build/html",
109+
cwd=self.project.checkout_path(self.version.slug),
110+
)
111+
if code == 0:
112+
log.warning(
113+
"Directory '_build/html' exists. This may lead to unexpected behavior."
114+
)
115+
97116
def _get_doctool_name(self):
98117
if self.version.is_sphinx_type:
99118
return "sphinx"

0 commit comments

Comments
 (0)