-
Notifications
You must be signed in to change notification settings - Fork 4
134 lines (112 loc) · 4.85 KB
/
pr-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Pull Request Config 🤖
permissions:
issues: write
pull-requests: write
on:
workflow_dispatch:
issues:
types: [opened, reopened]
pull_request:
types: [opened, reopened, synchronize]
jobs:
review_checklist:
name: Comment PR with the Review Checklist
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Comment PR 📝
uses: thollander/actions-comment-pull-request@v3
with:
message: |
### Review Checklist
Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.
#### General
- [ ] Ensure that the Pull Request has a descriptive title.
- [ ] If this is a change that users need to know about, please apply the `release notes (needs details)` label so that merging is blocked unless the summary release notes document is included.
- [ ] If a new flag is being introduced, review whether it is really needed. The flag names should be clear and intuitive (as far as possible), and the flag's help should be descriptive.
- [ ] If a workflow is added or modified, each items in `Jobs` should be named in order to mark it as `required`. If the workflow should be required, the GitHub Admin should be notified.
#### Bug fixes
- [ ] There should be at least one unit or end-to-end test.
- [ ] The Pull Request description should either include a link to an issue that describes the bug OR an actual description of the bug and how to reproduce, along with a description of the fix.
#### Non-trivial changes
- [ ] There should be some code comments as to why things are implemented the way they are.
#### New/Existing features
- [ ] Should be documented, either by modifying the existing documentation or creating new documentation.
- [ ] New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.
#### Backward compatibility
- [ ] Protobuf changes should be wire-compatible.
- [ ] Changes to `_vt` tables and RPCs need to be backward compatible.
- [ ] `vtctl` command output order should be stable and `awk`-able.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
auto-assign:
name: Auto Assign PR 🏷️
uses: devxp-tech/.github/.github/workflows/auto-assign.yaml@main
secrets: inherit
with:
assignees: diegoluisi
numOfAssignee: 1
triage:
name: Pull Request Triage 🏷️
runs-on: ubuntu-latest
steps:
- name: Label PRs
uses: ffittschen/pr-branch-labeler@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Label Chart 🏷️
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
helm-diff:
name: Comment PR with Differences 📝
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout main branch 🛎️
uses: actions/checkout@v4
with:
ref: main
path: main_branch
- name: Generate Results from Main 📄
run: |
mkdir -p results
for dir in main_branch/charts/*/; do
chart_name=$(basename "$dir")
helm template "$dir" -f "$dir/values-ci.yaml" > "results/result_${chart_name}.yaml"
done
- name: Checkout PR branch 🛎️
uses: actions/checkout@v4
with:
path: pr_branch
- name: Generate Results from PR branch 📄
run: |
mkdir -p results_new
for dir in pr_branch/charts/*/; do
chart_name=$(basename "$dir")
helm template "$dir" -f "$dir/values-ci.yaml" > "results_new/result_new_${chart_name}.yaml"
done
- name: Generate Helm Diff 📄
continue-on-error: true
run: |
echo "# Charts Differences:" > diff.yaml
for new_result in results_new/result_new_*.yaml; do
base_name=$(basename "$new_result" .yaml)
main_result="results/result_${base_name#result_new_}.yaml"
echo "## Changes in ${base_name#result_new_}:" >> diff.yaml
echo '```diff' >> diff.yaml
diff --side-by-side --suppress-common-lines --ignore-space-change "$main_result" "$new_result" >> diff.yaml || echo "Differences found in $new_result"
echo '```' >> diff.yaml
echo -e "\n\n" >> diff.yaml
done
cat diff.yaml # Debugging: Output the diff file to confirm its creation
- name: PR comment with file 📝
if: always()
uses: thollander/actions-comment-pull-request@v3
with:
comment_tag: show_diff
filePath: diff.yaml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}