From cb02d0bbc213867ac845b7e8a0fb337f723d396a Mon Sep 17 00:00:00 2001 From: Chiichen Date: Sun, 21 Apr 2024 23:23:21 +0800 Subject: [PATCH] ci: import issue checker (#750) * ci: supprot auto tag on pull request * ci: update issue checker config * ci: update issue checker & block merge while --- .github/issue-checker.yml | 62 +++++++++++++++++++++ .github/workflows/issue-checker.yml | 24 +++++++++ triagebot.toml | 83 +++++++++-------------------- 3 files changed, 110 insertions(+), 59 deletions(-) create mode 100644 .github/issue-checker.yml create mode 100644 .github/workflows/issue-checker.yml diff --git a/.github/issue-checker.yml b/.github/issue-checker.yml new file mode 100644 index 00000000..598cbbcb --- /dev/null +++ b/.github/issue-checker.yml @@ -0,0 +1,62 @@ +default-mode: + add: + remove: [pull_request_target, issues] +labels: +# skips and removes +- name: skip all + content: + regexes: '[Ss]kip (?:[Aa]ll |)[Ll]abels?' +- name: remove all + content: + regexes: '[Rr]emove (?:[Aa]ll |)[Ll]abels?' +- name: skip ambiguous + content: + regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)ambiguous(?:`|)' +- name: remove ambiguous + content: + regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)ambiguous(?:`|)' +# `feature` +- name: enhance + content: enhancement + regexes: '[Ff]eat(?:\([a-zA-Z]*\))?[\:\.\,]' + skip-if: + - skip all + remove-if: + - remove all +# `Bug fix` +- name: bug-fix + content: Bug fix + regexes: '[Ff]ix(?:\([a-zA-Z]*\))?[\:\.\,]' + skip-if: + - skip all + remove-if: + - remove all +# `document` +- name: doc + content: documentation + regexes: '[Dd]ocs(?:\([a-zA-Z]*\))?[\:\.\,]' + skip-if: + - skip all + remove-if: + - remove all +# `test` +- name: test + content: test + regexes: '[Tt]est(?:\([a-zA-Z]*\))?[\:\.\,]' + skip-if: + - skip all + remove-if: + - remove all +# `ambiguous` +- name: pr-ambiguous + # 不符合 commitizen 的 PR + content: ambiguous + regexes: '^(?!(?:build|chore|ci|docs?|feat|fix|perf|refactor|rft|style|test)(?:\([a-zA-Z]*\))?[\:\.\(\,]|[Rr]evert|[Rr]elease)' + mode: + pull_request_target: + skip-if: + - skip all + - skip ambiguous + remove-if: + - remove all + - remove ambiguous \ No newline at end of file diff --git a/.github/workflows/issue-checker.yml b/.github/workflows/issue-checker.yml new file mode 100644 index 00000000..dc526ddb --- /dev/null +++ b/.github/workflows/issue-checker.yml @@ -0,0 +1,24 @@ +name: "Issue Checker" +on: + issues: + types: [opened, edited] + pull_request_target: + types: [opened, edited] + issue_comment: + types: [created, edited] + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: zzyyyl/issue-checker@v1.7 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/issue-checker.yml + not-before: 2024-04-20T00:00:00Z + include-title: 1 \ No newline at end of file diff --git a/triagebot.toml b/triagebot.toml index 12c8d91c..e408f443 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -44,20 +44,14 @@ trigger_labels = [ "regression-from-stable-to-nightly", "I-unsound", ] -exclude_labels = [ - "P-*", - "T-release", - "requires-nightly", -] +exclude_labels = ["P-*", "T-release", "requires-nightly"] [autolabel."T-doc"] trigger_files = [ # Source code "doc", ] -exclude_labels = [ - "T-*", -] +exclude_labels = ["T-*"] [autolabel."A-meta"] @@ -70,19 +64,13 @@ trigger_files = [ ] [autolabel."A-fs"] -trigger_files = [ - "kernel/src/filesystem", -] +trigger_files = ["kernel/src/filesystem"] [autolabel."O-x86_64"] -trigger_files = [ - "kernel/src/arch/x86_64", -] +trigger_files = ["kernel/src/arch/x86_64"] [autolabel."O-riscv64"] -trigger_files = [ - "kernel/src/arch/riscv64", -] +trigger_files = ["kernel/src/arch/riscv64"] [autolabel."T-driver"] trigger_files = [ @@ -92,25 +80,20 @@ trigger_files = [ ] [autolabel."T-virtulization"] -trigger_files = [ - "kernel/src/virt", - "kernel/src/arch/x86_64/kvm" -] +trigger_files = ["kernel/src/virt", "kernel/src/arch/x86_64/kvm"] [autolabel."S-等待审查"] new_pr = true [autolabel."needs-triage"] new_issue = true -exclude_labels = [ - "A-diagnostics", -] +exclude_labels = ["A-diagnostics"] [shortcut] [no-merges] exclude_titles = ["Rollup of", "subtree update", "Subtree update"] -labels = ["S-等待作者修改"] +labels = ["S-等待作者修改", "ambiguous"] [mentions."triagebot.toml"] message = "`triagebot.toml` has been modified, there may have been changes to the review queue." @@ -133,47 +116,29 @@ users_on_vacation = [] [assign.adhoc_groups] # 驱动程序 -driver = [ - "@fslongjin", - "@YJwu2023", - "@GnoCiYeH" -] +driver = ["@fslongjin", "@YJwu2023", "@GnoCiYeH"] # 虚拟化 -virtulization = [ - "@fslongjin", - "@ZXXYy" -] +virtulization = ["@fslongjin", "@ZXXYy"] -filesystem = [ - "@fslongjin" -] +filesystem = ["@fslongjin"] -riscv64 = [ - "@fslongjin" -] +riscv64 = ["@fslongjin"] -x86_64 = [ - "@fslongjin", - "@GnoCiYeH", - "@Chiichen", -] +x86_64 = ["@fslongjin", "@GnoCiYeH", "@Chiichen"] # CI/CD -infra-ci = [ - "@fslongjin" -] +infra-ci = ["@fslongjin", "@Chiichen"] -bootstrap = [ - "@fslongjin" -] +bootstrap = ["@fslongjin"] [assign.owners] -"/.github/workflows" = ["infra-ci"] -"/kernel/src/driver" = ["driver"] -"/kernel/src/filesystem" = ["filesystem"] -"/kernel/src/virt" = ["virtulization"] -"/kernel/src/arch/x86_64/kvm" = ["virtulization"] -"/kernel/src/arch/x86_64" = ["x86_64"] -"/kernel/src/arch/riscv64" = ["riscv64"] - +"/.github/workflows" = ["infra-ci"] +"/triagebot.toml" = ["infra-ci"] +"/kernel/src/driver" = ["driver"] +"/kernel/src/filesystem" = ["filesystem"] +"/kernel/src/virt" = ["virtulization"] +"/kernel/src/arch/x86_64/kvm" = ["virtulization"] +"/kernel/src/arch/x86_64" = ["x86_64"] +"/kernel/src/arch/riscv64" = ["riscv64"] +"/tools" = ["bootstrap"]