Skip to content

Commit c3ceee9

Browse files
committed
[MINOR] Add PR description validation on documentation updates
1 parent eeccdf9 commit c3ceee9

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

scripts/pr_compliance.py

+26-6
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,18 @@ def make_default_validator(body, debug=False):
398398
risklevel = RiskLevelData("RISKLEVEL",
399399
"### Risk level",
400400
{"_If medium or high, explain what verification was done to mitigate the risks._"})
401+
docsUpdate = ParseSectionData("DOCUMENTATIONUPDATE",
402+
"### Documentation Update",
403+
{"_Describe any necessary documentation update if there is any new feature, config, or user-facing change_",
404+
"",
405+
"- _The config description must be updated if new configs are added or the default value of the configs are changed_",
406+
"- _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the",
407+
" ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make",
408+
" changes to the website._"})
401409
checklist = ParseSectionData("CHECKLIST",
402410
"### Contributor's checklist",
403411
{})
404-
parseSections = ParseSections([changelogs, impact, risklevel, checklist])
412+
parseSections = ParseSections([changelogs, impact, risklevel, docsUpdate, checklist])
405413

406414
return ValidateBody(body, "CHANGELOGS", parseSections, debug)
407415

@@ -466,6 +474,21 @@ def test_body():
466474
good_risklevel = template_risklevel.copy()
467475
good_risklevel[1] = "none"
468476

477+
template_docs_update = [
478+
"### Documentation Update",
479+
"",
480+
"_Describe any necessary documentation update if there is any new feature, config, or user-facing change_",
481+
"",
482+
"- _The config description must be updated if new configs are added or the default value of the configs are changed_",
483+
"- _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the",
484+
" ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make",
485+
" changes to the website._",
486+
""
487+
]
488+
489+
good_docs_update = template_docs_update.copy()
490+
good_docs_update[1] = "update docs"
491+
469492
template_checklist = [
470493
"### Contributor's checklist",
471494
"",
@@ -476,10 +499,10 @@ def test_body():
476499
]
477500

478501
#list of sections that when combined form a valid body
479-
good_sections = [good_changelogs, good_impact, good_risklevel, template_checklist]
502+
good_sections = [good_changelogs, good_impact, good_risklevel, good_docs_update, template_checklist]
480503

481504
#list of sections that when combined form the template
482-
template_sections = [template_changelogs, template_impact, template_risklevel, template_checklist]
505+
template_sections = [template_changelogs, template_impact, template_risklevel, template_docs_update, template_checklist]
483506

484507
tests_passed = True
485508
#Test section not filled out
@@ -532,9 +555,6 @@ def test_body():
532555
return tests_passed
533556

534557

535-
536-
537-
538558
if __name__ == '__main__':
539559
if len(sys.argv) > 1:
540560
title_tests = test_title()

0 commit comments

Comments
 (0)