Skip to content

Build: fail builds if there is no index.html in the output dir #10550

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

Merged
merged 4 commits into from
Jul 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions readthedocs/projects/tasks/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,24 +574,13 @@ def get_valid_artifact_types(self):

if artifact_type == "html":
index_html_filepath = os.path.join(artifact_directory, "index.html")
readme_html_filepath = os.path.join(artifact_directory, "README.html")
if not os.path.exists(index_html_filepath) and not os.path.exists(
readme_html_filepath
):
log.warning(
if not os.path.exists(index_html_filepath):
log.info(
"Failing the build. "
"HTML output does not contain an 'index.html' at its root directory.",
index_html=index_html_filepath,
readme_html=readme_html_filepath,
)
# TODO: uncomment this line to fail the build once we have
# communicated with projects without an index.html or
# README.html
#
# NOTE: we want to deprecate serving README.html as an
# index.html file as well.
#
# raise BuildUserError(BuildUserError.BUILD_OUTPUT_HTML_NO_INDEX_FILE)
raise BuildUserError(BuildUserError.BUILD_OUTPUT_HTML_NO_INDEX_FILE)

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