Skip to content

Commit 8e63349

Browse files
authored
[MINOR] Add PR description validation on documentation updates (#10799)
1 parent a987574 commit 8e63349

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _If medium or high, explain what verification was done to mitigate the risks._
1212

1313
### Documentation Update
1414

15-
_Describe any necessary documentation update if there is any new feature, config, or user-facing change_
15+
_Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none"._
1616

1717
- _The config description must be updated if new configs are added or the default value of the configs are changed_
1818
- _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the

scripts/pr_compliance.py

+29-9
Original file line numberDiff line numberDiff line change
@@ -389,21 +389,29 @@ def validate(self):
389389
#Generate the validator for the current template.
390390
#needs to be manually updated
391391
def make_default_validator(body, debug=False):
392-
changelogs = ParseSectionData("CHANGELOGS",
392+
changelogs = ParseSectionData("CHANGE_LOGS",
393393
"### Change Logs",
394394
{"_Describe context and summary for this change. Highlight if any code was copied._"})
395395
impact = ParseSectionData("IMPACT",
396396
"### Impact",
397397
{"_Describe any public API or user-facing feature change or any performance impact._"})
398-
risklevel = RiskLevelData("RISKLEVEL",
398+
risklevel = RiskLevelData("RISK_LEVEL",
399399
"### Risk level",
400400
{"_If medium or high, explain what verification was done to mitigate the risks._"})
401+
docsUpdate = ParseSectionData("DOCUMENTATION_UPDATE",
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. If not, put \"none\"._",
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

406-
return ValidateBody(body, "CHANGELOGS", parseSections, debug)
414+
return ValidateBody(body, "CHANGE_LOGS", parseSections, debug)
407415

408416

409417
#takes a list of strings and returns a string of those lines separated by \n
@@ -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. If not, put \"none\"._",
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)