mergify.yml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. misc:
  2. - &source_code_files files~=^(?=.*((\.(go|h|cpp)|go.sum|go.mod|CMakeLists.txt|conanfile\.*))).*$
  3. - &no_source_code_files -files~=^(?=.*((\.(go|h|cpp)|go.sum|go.mod|CMakeLists.txt|conanfile\.*))).*$
  4. - when_build_and_test_status_successs: &Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  5. - 'status-success=Build and test AMD64 Ubuntu 20.04'
  6. - 'status-success=Build and test AMD64 Ubuntu 22.04'
  7. - when_build_and_test_status_failed: &Build_AND_TEST_STATUS_FAILED_ON_UBUNTU_20_OR_UBUNTU_22
  8. - &failed_on_ubuntu_20 'check-failure=Build and test AMD64 Ubuntu 20.04'
  9. - &failed_on_ubuntu_22 'check-failure=Build and test AMD64 Ubuntu 22.04'
  10. - when_go_sdk_status_success: &WHEN_GO_SDK_STATUS_SUCCESS
  11. - 'status-success=go-sdk'
  12. - 'status-success=milvus-sdk-go '
  13. - branch: &BRANCHES
  14. # In this pull request, the changes are based on the master branch
  15. - &MASTER_BRANCH base=master
  16. # In this pull request, the changes are based on the 2.x(or 2.x.x) branch
  17. - &2X_BRANCH base~=^2(\.\d+){1,2}$
  18. pull_request_rules:
  19. - name: Add needs-dco label when DCO check failed
  20. conditions:
  21. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  22. - or: *BRANCHES
  23. - -status-success=DCO
  24. actions:
  25. label:
  26. remove:
  27. - dco-passed
  28. add:
  29. - needs-dco
  30. comment:
  31. message: |
  32. @{{author}} Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco.
  33. - name: Add dco-passed label when DCO check passed
  34. conditions:
  35. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  36. - or: *BRANCHES
  37. - status-success=DCO
  38. actions:
  39. label:
  40. remove:
  41. - needs-dco
  42. add:
  43. - dco-passed
  44. - name: Test passed for code changed on master
  45. conditions:
  46. - *MASTER_BRANCH
  47. - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  48. - or: *WHEN_GO_SDK_STATUS_SUCCESS
  49. - 'status-success=UT for Cpp'
  50. - 'status-success=UT for Go'
  51. - 'status-success=Integration Test'
  52. - 'status-success=Code Checker AMD64 Ubuntu 22.04'
  53. - 'status-success=Code Checker MacOS 12'
  54. # - 'status-success=Code Checker Amazonlinux 2023'
  55. - 'status-success=cpu-e2e'
  56. # - 'status-success=codecov/patch'
  57. # - 'status-success=codecov/project'
  58. actions:
  59. label:
  60. add:
  61. - ci-passed
  62. - name: Test passed for code changed on 2.* branch
  63. conditions:
  64. - *2X_BRANCH
  65. - 'status-success=Code Checker AMD64 Ubuntu 22.04'
  66. - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  67. - 'status-success=UT for Cpp'
  68. - 'status-success=UT for Go'
  69. - 'status-success=Integration Test'
  70. - 'status-success=Code Checker MacOS 12'
  71. # - 'status-success=Code Checker CentOS 7'
  72. - 'status-success=cpu-e2e'
  73. # - 'status-success=codecov/patch'
  74. # - 'status-success=codecov/project'
  75. actions:
  76. label:
  77. add:
  78. - ci-passed
  79. - name: Test passed for tests changed
  80. conditions:
  81. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  82. - or: *BRANCHES
  83. - -files~=^(?!tests\/python_client).+
  84. - 'status-success=cpu-e2e'
  85. actions:
  86. label:
  87. add:
  88. - ci-passed
  89. - name: Test passed for docs changed only
  90. conditions:
  91. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  92. - or: *BRANCHES
  93. - -files~=^(?!.*\.(md)).*$
  94. actions:
  95. label:
  96. add:
  97. - ci-passed
  98. - name: Test passed for non go or c++ code changed
  99. conditions:
  100. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  101. - or: *BRANCHES
  102. - 'status-success=cpu-e2e'
  103. - *no_source_code_files
  104. actions:
  105. label:
  106. add:
  107. - ci-passed
  108. - name: Test passed for go unittest code changed-master
  109. conditions:
  110. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  111. - or: *BRANCHES
  112. - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  113. - 'status-success=Code Checker AMD64 Ubuntu 22.04'
  114. - 'status-success=Code Checker MacOS 12'
  115. # - 'status-success=Code Checker Amazonlinux 2023'
  116. - 'status-success=UT for Go'
  117. - or:
  118. - -files~=^(?!pkg\/.*_test\.go).*$
  119. - -files~=^(?!internal\/.*_test\.go).*$
  120. actions:
  121. label:
  122. add:
  123. - ci-passed
  124. - name: Test passed for go unittest code changed -2.2.*
  125. conditions:
  126. - *2X_BRANCH
  127. - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  128. - 'status-success=Code Checker AMD64 Ubuntu 22.04'
  129. - 'status-success=Code Checker MacOS 12'
  130. - -files~=^(?!internal\/.*_test\.go).*$
  131. actions:
  132. label:
  133. add:
  134. - ci-passed
  135. - name: Test passed for mergify changed
  136. conditions:
  137. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  138. - or: *BRANCHES
  139. - -files~=^(?!\.github\/mergify\.yml).*$
  140. actions:
  141. label:
  142. add:
  143. - ci-passed
  144. - name: Test passed for title skip e2e
  145. conditions:
  146. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  147. - or: *BRANCHES
  148. - title~=\[skip e2e\]
  149. - label=kind/enhancement
  150. - *no_source_code_files
  151. actions:
  152. label:
  153. add:
  154. - ci-passed
  155. - name: Blocking PR if missing a related issue or doesn't have kind/enhancement label
  156. conditions:
  157. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  158. - or: *BRANCHES
  159. - and:
  160. - -body~=\#[0-9]{1,6}(\s+|$)
  161. - -body~=https://github.com/milvus-io/milvus/issues/[0-9]{1,6}(\s+|$)
  162. - or:
  163. - and:
  164. - label=kind/enhancement
  165. - or:
  166. - label=size/L
  167. - label=size/XL
  168. - label=size/XXL
  169. - label=kind/bug
  170. - label=kind/feature
  171. - -label=kind/doc
  172. - -label=kind/test
  173. - -title~=\[automated\]
  174. actions:
  175. label:
  176. add:
  177. - do-not-merge/missing-related-issue
  178. comment:
  179. message: |
  180. @{{author}} Please associate the related issue to the body of your Pull Request. (eg. “issue: #<xyz>”)
  181. - name: Dismiss block label if related issue be added into PR
  182. conditions:
  183. - and:
  184. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  185. - or: *BRANCHES
  186. - or:
  187. - body~=\#[0-9]{1,6}(\s+|$)
  188. - body~=https://github.com/milvus-io/milvus/issues/[0-9]{1,6}(\s+|$)
  189. actions:
  190. label:
  191. remove:
  192. - do-not-merge/missing-related-issue
  193. - name: Blocking PR if missing a related master PR or doesn't have kind/branch-feature label
  194. conditions:
  195. - *2X_BRANCH
  196. - and:
  197. - -body~=pr\:\ \#[0-9]{1,6}(\s+|$)
  198. - -body~=https://github.com/milvus-io/milvus/pull/[0-9]{1,6}(\s+|$)
  199. - -label=kind/branch-feature
  200. - -title~=\[automated\]
  201. actions:
  202. label:
  203. add:
  204. - do-not-merge/missing-related-pr
  205. comment:
  206. message: |
  207. @{{author}} Please associate the related pr of master to the body of your Pull Request. (eg. “pr: #<xyz>”)
  208. - name: Dismiss block label if related pr be added into PR
  209. conditions:
  210. - *2X_BRANCH
  211. - or:
  212. - body~=pr\:\ \#[0-9]{1,6}(\s+|$)
  213. - body~=https://github.com/milvus-io/milvus/pull/[0-9]{1,6}(\s+|$)
  214. - label=kind/branch-feature
  215. actions:
  216. label:
  217. remove:
  218. - do-not-merge/missing-related-pr
  219. - name: Dismiss block label if automated create PR
  220. conditions:
  221. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  222. - or: *BRANCHES
  223. - title~=\[automated\]
  224. actions:
  225. label:
  226. remove:
  227. - do-not-merge/missing-related-issue
  228. - do-not-merge/missing-related-pr
  229. - name: Test passed for skip e2e-master
  230. conditions:
  231. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  232. - or: *BRANCHES
  233. - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  234. - title~=\[skip e2e\]
  235. - 'status-success=Code Checker AMD64 Ubuntu 22.04'
  236. - 'status-success=UT for Cpp'
  237. - 'status-success=UT for Go'
  238. - 'status-success=Integration Test'
  239. - 'status-success=Code Checker MacOS 12'
  240. # - 'status-success=Code Checker Amazonlinux 2023'
  241. - *source_code_files
  242. actions:
  243. label:
  244. add:
  245. - ci-passed
  246. - name: Test passed for skip e2e - 2.2.*
  247. conditions:
  248. - *2X_BRANCH
  249. - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22
  250. - title~=\[skip e2e\]
  251. # - 'status-success=Code Checker AMD64 Ubuntu 20.04'
  252. - 'status-success=UT for Cpp'
  253. - 'status-success=UT for Go'
  254. - 'status-success=Integration Test'
  255. - 'status-success=Code Checker MacOS 12'
  256. - *source_code_files
  257. actions:
  258. label:
  259. add:
  260. - ci-passed
  261. - name: Assign the 'lgtm' and 'approved' labels following the successful testing of the 'Update Knowhere Commit'
  262. conditions:
  263. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  264. - or: *BRANCHES
  265. - 'title~=Update Knowhere Commit'
  266. - label=ci-passed
  267. actions:
  268. label:
  269. add:
  270. - lgtm
  271. - approved
  272. - name: Remove ci-passed label when status for code checker or ut is not success-master
  273. conditions:
  274. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  275. - or: *BRANCHES
  276. - label!=manual-pass
  277. - *source_code_files
  278. - or:
  279. - *failed_on_ubuntu_20
  280. - *failed_on_ubuntu_22
  281. - 'status-success!=Code Checker AMD64 Ubuntu 22.04'
  282. - 'status-success!=UT for Cpp'
  283. - 'status-success!=UT for Go'
  284. - 'status-success!=Integration Test'
  285. - 'status-success!=Code Checker MacOS 12'
  286. # - 'status-success!=Code Checker Amazonlinux 2023'
  287. actions:
  288. label:
  289. remove:
  290. - ci-passed
  291. - name: Remove ci-passed label when status for code checker or ut is not success-2.2.*
  292. conditions:
  293. - label!=manual-pass
  294. - base~=^2\.2\.\d+$
  295. - *source_code_files
  296. - or:
  297. - *failed_on_ubuntu_20
  298. - *failed_on_ubuntu_22
  299. # - 'status-success!=Code Checker AMD64 Ubuntu 20.04'
  300. - 'status-success!=UT for Cpp'
  301. - 'status-success!=UT for Go'
  302. - 'status-success!=Integration Test'
  303. - 'status-success!=Code Checker MacOS 12'
  304. # - 'status-success!=Code Checker CentOS 7'
  305. actions:
  306. label:
  307. remove:
  308. - ci-passed
  309. - name: Remove ci-passed label when status for jenkins job is not success
  310. conditions:
  311. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  312. - or: *BRANCHES
  313. - label!=manual-pass
  314. - -title~=\[skip e2e\]
  315. - files~=^(?!(.*_test\.go|.*\.md)).*$
  316. - 'status-success!=cpu-e2e'
  317. actions:
  318. label:
  319. remove:
  320. - ci-passed
  321. - name: Add comment when jenkins job failed
  322. conditions:
  323. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  324. - or: *BRANCHES
  325. - 'check-failure=cpu-e2e'
  326. actions:
  327. comment:
  328. message: |
  329. @{{author}} E2e jenkins job failed, comment `/run-cpu-e2e` can trigger the job again.
  330. - name: Add comment when go-sdk check failed
  331. conditions:
  332. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  333. - or: *BRANCHES
  334. - 'check-failure=go-sdk'
  335. actions:
  336. comment:
  337. message: |
  338. @{{author}} go-sdk check failed, comment `rerun go-sdk` can trigger the job again.
  339. - name: Add comment when code checker or ut failed -master
  340. conditions:
  341. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  342. - or: *BRANCHES
  343. - or:
  344. # - 'check-failure=Code Checker AMD64 Ubuntu 20.04'
  345. - 'check-failure=Build and test AMD64 Ubuntu 20.04'
  346. actions:
  347. comment:
  348. message: |
  349. @{{author}} ut workflow job failed, comment `rerun ut` can trigger the job again.
  350. - name: Add comment when code checker or ut failed -2.2.*
  351. conditions:
  352. - *2X_BRANCH
  353. - or:
  354. # - 'check-failure=Code Checker AMD64 Ubuntu 20.04'
  355. - 'check-failure=Build and test AMD64 Ubuntu 20.04'
  356. actions:
  357. comment:
  358. message: |
  359. @{{author}} ut workflow job failed, comment `rerun ut` can trigger the job again.
  360. - name: Add 'do-not-merge/invalid-pr-format' label for invalid PR titles
  361. conditions:
  362. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  363. - or: *BRANCHES
  364. - or:
  365. - '-title~=^(feat:|enhance:|fix:|test:|doc:|auto:|\[automated\])'
  366. - body=^$
  367. actions:
  368. label:
  369. add:
  370. - do-not-merge/invalid-pr-format
  371. comment:
  372. message: |
  373. @{{author}}
  374. **Invalid PR Title Format Detected**
  375. Your PR submission does not adhere to our required standards. To ensure clarity and consistency, please meet the following criteria:
  376. 1. **Title Format:** The PR title must begin with one of these prefixes:
  377. - `feat:` for introducing a new feature.
  378. - `fix:` for bug fixes.
  379. - `enhance:` for improvements to existing functionality.
  380. - `test`: for add tests to existing functionality.
  381. - `doc`: for modifying documentation.
  382. - `auto`: for the pull request from bot.
  383. 2. **Description Requirement:** The PR must include a non-empty description, detailing the changes and their impact.
  384. **Required Title Structure:**
  385. ```
  386. [Type]: [Description of the PR]
  387. ```
  388. Where `Type` is one of `feat`, `fix`, `enhance`, `test` or `doc`.
  389. **Example:**
  390. ```
  391. enhance: improve search performance significantly
  392. ```
  393. Please review and update your PR to comply with these guidelines.
  394. - name: Remove 'do-not-merge/invalid-pr-format' label for valid PRs
  395. conditions:
  396. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  397. - or: *BRANCHES
  398. - 'title~=^(feat:|enhance:|fix:|test:|doc:|auto:|\[automated\])'
  399. - '-body=^$'
  400. - 'label=do-not-merge/invalid-pr-format'
  401. actions:
  402. label:
  403. remove:
  404. - do-not-merge/invalid-pr-format
  405. - name: Label bug fix PRs
  406. conditions:
  407. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  408. - or: *BRANCHES
  409. - 'title~=^fix:'
  410. actions:
  411. label:
  412. add:
  413. - kind/bug
  414. - name: Label feature PRs
  415. conditions:
  416. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  417. - or: *BRANCHES
  418. - 'title~=^feat:'
  419. actions:
  420. label:
  421. add:
  422. - kind/feature
  423. - name: Label enhancement PRs
  424. conditions:
  425. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  426. - or: *BRANCHES
  427. - 'title~=^enhance:'
  428. actions:
  429. label:
  430. add:
  431. - kind/enhancement
  432. - name: Label test PRs
  433. conditions:
  434. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  435. - or: *BRANCHES
  436. - 'title~=^test:'
  437. actions:
  438. label:
  439. add:
  440. - kind/test
  441. - name: Label doc PRs
  442. conditions:
  443. # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
  444. - or: *BRANCHES
  445. - 'title~=^doc:'
  446. actions:
  447. label:
  448. add:
  449. - kind/doc