Skip to content

Commit 51fe0e6

Browse files
authored
Merge pull request #294 from tekktrik/dev/unique-rtd-errors
Specify errors for docs validation
2 parents 7ce195f + 8e80e02 commit 51fe0e6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

adabot/lib/circuitpython_library_validators.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,18 @@
9797
ERROR_ONLY_ALLOW_MERGES = "Only allow merges, disallow rebase and squash"
9898
ERROR_RTD_SUBPROJECT_MISSING = "ReadTheDocs missing as a subproject on CircuitPython"
9999
ERROR_RTD_ADABOT_MISSING = "ReadTheDocs project missing adabot as owner"
100-
ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS = "Failed to load RTD build status"
100+
ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS = (
101+
"Failed to load RTD build status (General error)"
102+
)
103+
ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS_GH_NONLIMITED = (
104+
"Failed to load RTD build status (GitHub error)"
105+
)
106+
ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS_RTD_NONLIMITED = (
107+
"Failed to load RTD build status (RTD error)"
108+
)
109+
ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS_RTD_UNEXPECTED_RETURN = (
110+
"Failed to load RTD build status (Unknown error)"
111+
)
101112
ERROR_RTD_SUBPROJECT_FAILED = "Failed to list CircuitPython subprojects on ReadTheDocs"
102113
ERROR_RTD_OUTPUT_HAS_WARNINGS = "ReadTheDocs latest build has warnings and/or errors"
103114
ERROR_GITHUB_NO_RELEASE = "Library repository has no releases"
@@ -865,7 +876,7 @@ def validate_readthedocs(self, repo):
865876
time.sleep(sleep_time.seconds)
866877
continue
867878
except pygithub.GithubException:
868-
errors.append(ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS)
879+
errors.append(ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS_GH_NONLIMITED)
869880
return errors
870881

871882
readme_text = content_file.decoded_content.decode("utf-8")
@@ -890,7 +901,7 @@ def validate_readthedocs(self, repo):
890901
if error_message == "Not found." or not error_message.startswith(
891902
"Request was throttled."
892903
):
893-
errors.append(ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS)
904+
errors.append(ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS_RTD_NONLIMITED)
894905
return errors
895906
time_result = parse.search(
896907
"Request was throttled. Expected available in {throttled:d} seconds.",
@@ -903,7 +914,7 @@ def validate_readthedocs(self, repo):
903914
# Return the results of the latest run
904915
doc_build_results = json_response.get("results")
905916
if doc_build_results is None:
906-
errors.append(ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS)
917+
errors.append(ERROR_RTD_FAILED_TO_LOAD_BUILD_STATUS_RTD_UNEXPECTED_RETURN)
907918
return errors
908919
result = doc_build_results[0].get("success")
909920
time.sleep(3)

0 commit comments

Comments
 (0)