Skip to content

Commit b1c7e38

Browse files
Ensure PR description follows a template when potential breaking changes are made (#912)
1 parent 5fb72da commit b1c7e38

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
**Detailed Description**
2+
[In-depth description of the changes made to the interfaces, specifying new fields, removed fields, or modified data structures]
3+
4+
**Impact Analysis**
5+
- **Backward Compatibility**: [Analysis of backward compatibility]
6+
- **Forward Compatibility**: [Analysis of forward compatibility]
7+
8+
**Testing Plan**
9+
- **Unit Tests**: [Do we have unit test covering the change?]
10+
- **Persistence Tests**: [If the change is related to a data type which is persisted, do we have persistence tests covering the change?]
11+
- **Integration Tests**: [Do we have integration test covering the change?]
12+
- **Compatibility Tests**: [Have we done tests to test the backward and forward compatibility?]
13+
14+
**Rollout Plan**
15+
- What is the rollout plan?
16+
- Does the order of deployment matter?
17+
- Is it safe to rollback? Does the order of rollback matter?
18+
- Is there a kill switch to mitigate the impact immediately?
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Workflow for Breaking Change Reminder
2+
on:
3+
pull_request:
4+
paths:
5+
# below file(s) do not cover all the exposed types/funcs, but it's a good start to detect potentially breaking changes
6+
- src/main/java/com/uber/cadence/client/WorkflowStub.java
7+
8+
jobs:
9+
breaking-change-pr-template-reminder:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Fail if PR description is missing breaking change template
19+
if: steps.pr-changes.outputs.changes != '[]'
20+
run: |
21+
PR_NUMBER=${{ github.event.pull_request.number }}
22+
PR_URL="https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}"
23+
BODY=$(curl $PR_URL | jq '.body')
24+
CHECKLIST=(
25+
"Detailed Description"
26+
"Impact Analysis"
27+
"Testing Plan"
28+
"Rollout Plan"
29+
)
30+
TEMPLATE=$(cat .github/workflows/breaking_change_pr_template.md)
31+
32+
for i in "${CHECKLIST[@]}"; do
33+
if [[ "$BODY" == *"$i"* ]]; then
34+
continue
35+
else
36+
echo "Potential breaking changes detected! Please update the PR description to include following template:"
37+
echo "---"
38+
echo "$TEMPLATE"
39+
echo "---"
40+
exit 1
41+
fi
42+
done

0 commit comments

Comments
 (0)