docs check: Check only the file and directory GitHub urls of zulip/zulip.

f82cc4ed06 started checking all
zulip/zulip GitHub links in CI. Instead, it should have checked only
zulip/zulip file and directory links since checking other
links require making requests to GitHub servers.
This commit is contained in:
Vishnu KS
2020-12-16 20:11:48 +05:30
committed by Tim Abbott
parent 0d7a290893
commit 9b6d92d322

View File

@@ -74,12 +74,15 @@ class BaseDocumentationSpider(scrapy.Spider):
# homepage, there's no need to check those (which can
# cause errors when chat.zulip.org is being updated).
return True
if "zulip.readthedocs" in url or "zulip.com" in url or "zulip.org" in url or "github.com/zulip/zulip/" in url:
if "zulip.readthedocs" in url or "zulip.com" in url or "zulip.org" in url:
# We want CI to check any links to Zulip sites.
return False
if (len(url) > 4 and url[:4] == "file") or ("localhost" in url):
# We also want CI to check any links to built documentation.
return False
if url.startswith(ZULIP_SERVER_GITHUB_FILE_URL_PREFIX) or url.startswith(ZULIP_SERVER_GITHUB_DIRECTORY_URL_PREFIX):
# We can verify these links directly in the local git repo without making any requests to GitHub servers.
return False
if 'github.com/zulip' in url:
# We want to check these links but due to rate limiting from GitHub, these checks often
# fail in the CI. Thus, we should treat these as external links for now.