Skip to content

Commit 9281e1b

Browse files
committed
Build: fail builds if there is no index.html in the output dir
We announced we deprecated this in readthedocs/blog#230 and we already contacted the users to warn about this. This PR has to be merged after July 25th, 2023 and it has to be deployed on August 1st. Closes #1800
1 parent b99cd41 commit 9281e1b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

readthedocs/projects/tasks/builds.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -574,24 +574,13 @@ def get_valid_artifact_types(self):
574574

575575
if artifact_type == "html":
576576
index_html_filepath = os.path.join(artifact_directory, "index.html")
577-
readme_html_filepath = os.path.join(artifact_directory, "README.html")
578-
if not os.path.exists(index_html_filepath) and not os.path.exists(
579-
readme_html_filepath
580-
):
581-
log.warning(
577+
if not os.path.exists(index_html_filepath):
578+
log.info(
582579
"Failing the build. "
583580
"HTML output does not contain an 'index.html' at its root directory.",
584581
index_html=index_html_filepath,
585-
readme_html=readme_html_filepath,
586582
)
587-
# TODO: uncomment this line to fail the build once we have
588-
# communicated with projects without an index.html or
589-
# README.html
590-
#
591-
# NOTE: we want to deprecate serving README.html as an
592-
# index.html file as well.
593-
#
594-
# raise BuildUserError(BuildUserError.BUILD_OUTPUT_HTML_NO_INDEX_FILE)
583+
raise BuildUserError(BuildUserError.BUILD_OUTPUT_HTML_NO_INDEX_FILE)
595584

596585
if not os.path.exists(artifact_directory):
597586
# There is no output directory.

0 commit comments

Comments
 (0)