mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Merge pull request #53413 from ClickHouse/quick-fail-undocumented-features
Quick fail undocumented features
This commit is contained in:
commit
9680de07e9
@ -279,7 +279,7 @@ class PRInfo:
|
||||
"user_orgs": self.user_orgs,
|
||||
}
|
||||
|
||||
def has_changes_in_documentation(self):
|
||||
def has_changes_in_documentation(self) -> bool:
|
||||
# If the list wasn't built yet the best we can do is to
|
||||
# assume that there were changes.
|
||||
if self.changed_files is None or not self.changed_files:
|
||||
@ -287,10 +287,9 @@ class PRInfo:
|
||||
|
||||
for f in self.changed_files:
|
||||
_, ext = os.path.splitext(f)
|
||||
path_in_docs = "docs" in f
|
||||
path_in_website = "website" in f
|
||||
path_in_docs = f.startswith("docs/")
|
||||
if (
|
||||
ext in DIFF_IN_DOCUMENTATION_EXT and (path_in_docs or path_in_website)
|
||||
ext in DIFF_IN_DOCUMENTATION_EXT and path_in_docs
|
||||
) or "docker/docs" in f:
|
||||
return True
|
||||
return False
|
||||
|
@ -137,17 +137,20 @@ def main():
|
||||
if pr_labels_to_remove:
|
||||
remove_labels(gh, pr_info, pr_labels_to_remove)
|
||||
|
||||
if FEATURE_LABEL in pr_info.labels:
|
||||
print(f"The '{FEATURE_LABEL}' in the labels, expect the 'Docs Check' status")
|
||||
if FEATURE_LABEL in pr_info.labels and not pr_info.has_changes_in_documentation():
|
||||
print(
|
||||
f"The '{FEATURE_LABEL}' in the labels, "
|
||||
"but there's no changed documentation"
|
||||
)
|
||||
post_commit_status( # do not pass pr_info here intentionally
|
||||
commit,
|
||||
"pending",
|
||||
"failure",
|
||||
NotSet,
|
||||
f"expect adding docs for {FEATURE_LABEL}",
|
||||
DOCS_NAME,
|
||||
pr_info,
|
||||
)
|
||||
elif not description_error:
|
||||
set_mergeable_check(commit, "skipped")
|
||||
sys.exit(1)
|
||||
|
||||
if description_error:
|
||||
print(
|
||||
@ -173,6 +176,7 @@ def main():
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
set_mergeable_check(commit, "skipped")
|
||||
ci_report_url = create_ci_report(pr_info, [])
|
||||
if not can_run:
|
||||
print("::notice ::Cannot run")
|
||||
|
Loading…
Reference in New Issue
Block a user