[Tool] Add issue checker for feature prs (#44542)

Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
This commit is contained in:
andyziye 2024-04-22 19:53:47 +08:00 committed by GitHub
parent 1bb5371411
commit acd0ba76e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 29 additions and 74 deletions

View File

@ -93,21 +93,3 @@ jobs:
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
./scripts/check-approve.sh
feature-review:
needs: info
runs-on: [ self-hosted, normal ]
if: github.event_name == 'pull_request_review' && contains(needs.info.outputs.LABELS, 'feature') && !contains(needs.info.outputs.LABELS, 'sync')
name: FEATURE-REVIEW
env:
PR_NUMBER: ${{ needs.info.outputs.PR_NUMBER }}
REPO: ${{ github.repository }}
TEAM: feature-reviewer
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: FEATURE-REVIEW
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
./scripts/check-approve.sh

View File

@ -11,6 +11,8 @@ permissions:
pull-requests: write
issues: write
actions: write
env:
PR_NUMBER: ${{ github.event.number }}
jobs:
backport:
@ -192,6 +194,8 @@ jobs:
github.base_ref != 'main' && github.event.pull_request.merged == true
env:
PR_NUMBER: ${{ github.event.number }}
outputs:
VERSION_LABEL: ${{ steps.prepare_version_label.outputs.LABEL }}
steps:
- name: prepare merge label
if: >
@ -235,3 +239,14 @@ jobs:
run: |
gh pr edit ${PR_NUMBER} -R ${GITHUB_REPOSITORY} --add-label "${VERSION_LABEL}"
update_feature_issue:
runs-on: [ self-hosted, quick ]
needs: update_backport_merged_msg
if: !contains(github.event.pull_request.labels.*.name, 'sync') && startsWith(github.event.pull_request.title, '[Feature]')
env:
VERSION_LABEL: ${{ needs.update_backport_merged_msg.outputs.VERSION_LABEL }}
steps:
- name: Update Issue Body & Label
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
python3 scripts/get_pr_issue.py update_issue ${GITHUB_REPOSITORY} ${PR_NUMBER} ${VERSION_LABEL}

View File

@ -43,6 +43,12 @@ jobs:
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
./scripts/check-blacklist.sh
- name: Check Feature Issue
id: check_issue
run: |
cd ci-tool
python3 scripts/get_pr_issue.py check_issue ${GITHUB_REPOSITORY} ${PR_NUMBER}
be-checker:
runs-on: ubuntu-latest
needs: basic-checker

View File

@ -58,6 +58,12 @@ jobs:
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
./scripts/check-blacklist.sh
- name: Check Feature Issue
id: check_issue
run: |
cd ci-tool
python3 scripts/get_pr_issue.py check_issue ${GITHUB_REPOSITORY} ${PR_NUMBER}
be-checker:
runs-on: ubuntu-latest
needs: basic-checker

View File

@ -101,7 +101,7 @@ jobs:
all_linux=false
elif [[ "${{ github.event.schedule }}" == "0 0 * * 1-5" ]]; then
branch=main
if [[ `date +%u` -eq 1 ]]; then
if [[ `date +%u` -eq 1 || `date +%u` -eq 4 ]]; then
all_linux=true
fi
else

View File

@ -80,33 +80,3 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/pulls/${PR_NUMBER}/requested_reviewers \
-f "reviewers[]=" -f "team_reviewers[]=${PROTO_TEAM}" 1>/dev/null
feature-review:
name: FEATURE REVIEW LABEL
if: github.event.label.name == 'feature'
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
TEAM: feature-reviewer
GH_TOKEN: ${{ secrets.PAT }}
steps:
- name: ADD REVIEWER
if: github.event.action == 'labeled'
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/pulls/${PR_NUMBER}/requested_reviewers \
-f "reviewers[]=" -f "team_reviewers[]=${TEAM}" 1>/dev/null
- name: REMOVE REVIEWER
if: github.event.action == 'unlabeled'
run: |
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/pulls/${PR_NUMBER}/requested_reviewers \
-f "reviewers[]=" -f "team_reviewers[]=${TEAM}" 1>/dev/null

View File

@ -19,9 +19,3 @@ jobs:
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
python3 lib/notify_outer_issue_pr.py
- name: feature notification
if: always()
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
python3 lib/notify_feature_pr.py

View File

@ -278,24 +278,6 @@ jobs:
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: squash
feature-label-check:
runs-on: ubuntu-latest
steps:
- name: add feature label
id: add
if: startsWith(github.event.pull_request.title, '[Feature]')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'feature'
github_token: ${{ secrets.PAT }}
- name: remove feature label
if: always() && steps.add.outcome == 'skipped'
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: 'feature'
github_token: ${{ secrets.PAT }}
changelist-check:
runs-on: [self-hosted, normal]
if: >

View File

@ -294,7 +294,7 @@ class StarrocksSQLApiLib(object):
def get_crash_log(self, ip):
log.warning("Get crash log from %s" % ip)
cmd = (
f'cd {self.cluster_path}/be/log/; grep -B100 -A10000 "*** Check failure stack trace: ***\|ERROR: AddressSanitizer:" be.out'
f'cd {self.cluster_path}/be/log/; grep -A10000 "*** Check failure stack trace: ***\|ERROR: AddressSanitizer:" be.out'
)
crash_log = shell.expect.go_ex(ip, self.host_user, self.host_password, cmd, timeout=20, b_print_stdout=False)
return crash_log["result"]