Skip to content

Commit 97ac896

Browse files
authored
Merge branch 'main' into cryptographic_hash_blake3
Signed-off-by: Robert Palmer <robd003@users.noreply.github.com>
2 parents 27863d9 + 52ee60c commit 97ac896

1,222 files changed

Lines changed: 53204 additions & 19567 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ If yes, please specify the type of change:
4040
- [ ] 4.1
4141
- [ ] 4.0
4242
- [ ] 3.5
43-
- [ ] 3.4

.github/workflows/ai-sr-skills.yml

Lines changed: 138 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,87 @@ jobs:
2424
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
2525
if: >
2626
github.event.action == 'opened' &&
27-
!startsWith(github.head_ref, 'mergify/')
27+
!startsWith(github.head_ref, 'mergify/') &&
28+
!contains(github.head_ref, '-sync-pr-')
2829
steps:
30+
- name: Compute skip rule
31+
id: gate
32+
env:
33+
PR: ${{ github.event.number }}
34+
REPO: ${{ github.repository }}
35+
TITLE: ${{ github.event.pull_request.title }}
36+
run: |
37+
set -x
38+
# Skip AI reviewer assignment for small/test-only PRs to reduce noise.
39+
# Adjust BUGFIX_LINE_THRESHOLD as needed (non-test add+del lines).
40+
BUGFIX_LINE_THRESHOLD=30
41+
TEST_PATTERN='(Test\.(java|kt)$|_test\.(cpp|cc|h)$|/test/|^test/|^fe-test/|^regression-test/|/__test__/)'
42+
43+
skip=false
44+
reason=""
45+
46+
# Rule 1: [UT] / [Doc] title prefix
47+
if echo "$TITLE" | grep -qE '^\[(UT|Doc)\]'; then
48+
skip=true
49+
reason="title prefix [UT] or [Doc]"
50+
fi
51+
52+
# Rule 2: all changed files match test pattern
53+
if [ "$skip" = "false" ]; then
54+
files=$(gh pr diff "$PR" -R "$REPO" --name-only 2>/dev/null || true)
55+
total=$(echo "$files" | grep -cv '^$' || true)
56+
non_test=$(echo "$files" | grep -v '^$' | grep -cvE "$TEST_PATTERN" || true)
57+
if [ "$total" -gt 0 ] && [ "$non_test" -eq 0 ]; then
58+
skip=true
59+
reason="all $total changed files are tests"
60+
fi
61+
fi
62+
63+
# Rule 3: [BugFix] with non-test add+del < threshold
64+
# NOTE: jq's regex needs \\. for a literal dot (the pattern must match TEST_PATTERN above).
65+
if [ "$skip" = "false" ] && echo "$TITLE" | grep -qE '^\[BugFix\]'; then
66+
non_test_lines=$(gh pr view "$PR" -R "$REPO" --json files --jq '
67+
[.files[]
68+
| select(.path | test("(Test\\.(java|kt)$|_test\\.(cpp|cc|h)$|/test/|^test/|^fe-test/|^regression-test/|/__test__/)") | not)
69+
| (.additions + .deletions)]
70+
| add // 0
71+
' 2>/dev/null || echo 0)
72+
if [ "${non_test_lines:-0}" -lt "$BUGFIX_LINE_THRESHOLD" ]; then
73+
skip=true
74+
reason="[BugFix] non-test lines=$non_test_lines < $BUGFIX_LINE_THRESHOLD"
75+
fi
76+
fi
77+
78+
echo "skip=$skip" >> "$GITHUB_OUTPUT"
79+
echo "reason=$reason" >> "$GITHUB_OUTPUT"
80+
echo "=== gate result: skip=$skip, reason='$reason' ==="
81+
82+
- name: Sync skills to latest
83+
if: steps.gate.outputs.skip != 'true'
84+
run: |
85+
set -e
86+
SKILL_REPO="$HOME/starrocks-skills"
87+
SKILL_DEST="$HOME/.claude/skills"
88+
89+
if [ -d "$SKILL_REPO/.git" ]; then
90+
cd "$SKILL_REPO" && git pull --ff-only --quiet \
91+
|| echo "WARN: git pull failed, using current checkout"
92+
else
93+
echo "WARN: $SKILL_REPO is not a git checkout, skip pull"
94+
fi
95+
96+
mkdir -p "$SKILL_DEST"
97+
for skill_dir in "$SKILL_REPO"/*/; do
98+
[ -d "$skill_dir" ] || continue
99+
name=$(basename "$skill_dir")
100+
rsync -a --delete "$skill_dir" "$SKILL_DEST/$name/"
101+
done
102+
103+
echo "Skills synced to $SKILL_DEST:"
104+
ls -1 "$SKILL_DEST"
105+
29106
- name: Assign PR Reviewer
107+
if: steps.gate.outputs.skip != 'true'
30108
run: |
31109
echo "=== DEBUG ==="
32110
echo "PR: ${{ github.event.number }}"
@@ -36,8 +114,66 @@ jobs:
36114
echo "CLAUDE_CODE_OAUTH_TOKEN length: ${#CLAUDE_CODE_OAUTH_TOKEN}"
37115
echo "GITHUB_TOKEN length: ${#GITHUB_TOKEN}"
38116
echo "=== RUN ==="
117+
# tee captures the skill's stdout for the Notify Slack step to parse
39118
docker exec -i -u claudeuser \
40119
-e GITHUB_TOKEN="${GITHUB_TOKEN}" \
41120
-e CLAUDE_CODE_OAUTH_TOKEN="${CLAUDE_CODE_OAUTH_TOKEN}" \
42121
claude-cli claude --dangerously-skip-permissions \
43-
-p "/starrocks-assign-pr-reviewer https://github.com/${{ github.repository }}/pull/${{ github.event.number }}" || true
122+
-p "/starrocks-assign-pr-reviewer https://github.com/${{ github.repository }}/pull/${{ github.event.number }}" \
123+
2>&1 | tee "${RUNNER_TEMP}/ai_output.txt" || true
124+
125+
- name: Notify Slack
126+
if: steps.gate.outputs.skip != 'true'
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
130+
PR: ${{ github.event.number }}
131+
REPO: ${{ github.repository }}
132+
TITLE: ${{ github.event.pull_request.title }}
133+
PR_URL: ${{ github.event.pull_request.html_url }}
134+
CHANNEL_ID: C0B4GU36HJN
135+
run: |
136+
set -e
137+
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool
138+
cd ci-tool && git pull
139+
140+
# Parse the primary reviewer from the skill's output.
141+
# The skill prints: "Recommended reviewer: <login>"
142+
# (see starrocks-skills/starrocks-assign-pr-reviewer/SKILL.md "Output Template").
143+
# The LLM often wraps the line/value in markdown bold or italics
144+
# (e.g. **Recommended reviewer: kevincai**, Recommended reviewer: **kevincai**).
145+
# Tolerate optional leading *, then extract only valid GitHub login chars
146+
# ([A-Za-z0-9-]) to drop @, **, backticks, etc.
147+
ai_output="${RUNNER_TEMP}/ai_output.txt"
148+
reviewers=""
149+
if [ -f "$ai_output" ]; then
150+
reviewers=$(grep -iE '^\**Recommended reviewer:' "$ai_output" | tail -1 \
151+
| sed -E 's/^\**[Rr]ecommended reviewer:\**[[:space:]]*//' \
152+
| grep -oE '[A-Za-z0-9][A-Za-z0-9-]*' | head -1 || true)
153+
fi
154+
155+
if [ -z "$reviewers" ]; then
156+
echo "Could not extract AI-assigned reviewers from output, skip Slack notification"
157+
exit 0
158+
fi
159+
echo "AI assigned: $(echo "$reviewers" | tr '\n' ' ')"
160+
161+
# GitHub login -> Slack ID; unmapped users fall back to plain @login
162+
mentions=""
163+
while IFS= read -r login; do
164+
[ -z "$login" ] && continue
165+
slack_id=$(jq -r --arg k "$login" '.[$k] // empty' conf/member_slack.json)
166+
if [ -n "$slack_id" ]; then
167+
mentions="${mentions}<@${slack_id}> "
168+
else
169+
mentions="${mentions}@${login} "
170+
fi
171+
done <<< "$reviewers"
172+
173+
text="${mentions}You were assigned as reviewer for <${PR_URL}|#${PR} ${TITLE}>"
174+
175+
python3 lib/slack_notify.py \
176+
--mode channel \
177+
--token "$SLACK_BOT_TOKEN" \
178+
--channel "$CHANNEL_ID" \
179+
--text "$text"

.github/workflows/approve-checker.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
info:
2626
if: >
2727
(github.event.pull_request && github.event.requested_team) ||
28-
(github.event.pull_request.requested_teams && github.event.review && github.event.review.state == 'approved')
28+
(github.event.pull_request.requested_teams && github.event.review && github.event.review.state == 'approved') ||
29+
github.event.review.state == 'approved'
2930
runs-on: ubuntu-latest
3031
env:
3132
REPO: ${{ github.repository }}
@@ -116,3 +117,25 @@ jobs:
116117
run: |
117118
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
118119
./scripts/check-approve.sh
120+
121+
global-review:
122+
needs: info
123+
runs-on: [ self-hosted, normal ]
124+
if: >
125+
github.event_name == 'pull_request_review' &&
126+
needs.info.outputs.BASE_REF == 'main' &&
127+
!contains(needs.info.outputs.LABELS, 'sync') &&
128+
!startsWith(needs.info.outputs.HEAD_REF, 'mergify/')
129+
name: GLOBAL REVIEW
130+
131+
env:
132+
PR_NUMBER: ${{ needs.info.outputs.PR_NUMBER }}
133+
REPO: ${{ github.repository }}
134+
TEAM: global-reviewer
135+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
137+
steps:
138+
- name: GLOBAL REVIEW
139+
run: |
140+
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null
141+
./scripts/check-approve.sh

.github/workflows/ci-clang-format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ jobs:
174174
git reset HEAD~1
175175
echo "::error::Auto-push failed. Files that need formatting:"
176176
git diff --name-only
177+
echo "::group::Full clang-format diff (apply locally with 'git apply' to fix)"
178+
git --no-pager diff
179+
echo "::endgroup::"
177180
if [ "${HEAD_REPO}" != "${{ github.repository }}" ]; then
178181
echo "::error::This is a fork PR. Please enable 'Allow edits from maintainers' on your PR."
179182
else

.github/workflows/ci-doc-checker.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,61 @@ jobs:
5959
github_token: ${{ secrets.GITHUB_TOKEN }}
6060
labels: documentation
6161

62+
link-check:
63+
runs-on: ubuntu-latest
64+
needs: add-doc-label
65+
env:
66+
PR_NUMBER: ${{ github.event.number }}
67+
steps:
68+
- name: clean
69+
run: |
70+
rm -rf ${{ github.workspace }}
71+
mkdir -p ${{ github.workspace }}
72+
73+
- name: BRANCH INFO
74+
id: branch
75+
run: echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT
76+
77+
- uses: actions/checkout@v4
78+
with:
79+
fetch-depth: 0
80+
81+
- name: Checkout PR
82+
run: |
83+
BRANCH=${{steps.branch.outputs.branch}}
84+
git config --global user.name "docs-automation[bot]"
85+
git config --global user.email "docs-automation[bot]@starrocks.io"
86+
git checkout $BRANCH
87+
git pull
88+
BRANCH_NAME="${BRANCH}-${PR_NUMBER}"
89+
git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}
90+
git checkout $BRANCH_NAME
91+
git checkout -b merge_pr
92+
git merge --squash --no-edit ${BRANCH} || (echo "::error::Merge conflict, please check." && exit -1)
93+
94+
- uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
95+
id: changed-files
96+
with:
97+
files: |
98+
docs/en/**/*.md
99+
docs/en/**/*.mdx
100+
docs/ja/**/*.md
101+
docs/ja/**/*.mdx
102+
docs/zh/**/*.md
103+
docs/zh/**/*.mdx
104+
separator: " "
105+
106+
- name: Check links in changed files
107+
if: steps.changed-files.outputs.any_changed == 'true'
108+
uses: lycheeverse/lychee-action@v2.8.0
109+
with:
110+
fail: true
111+
args: >
112+
--config docs/lychee.toml
113+
--scheme https
114+
--scheme file
115+
${{ steps.changed-files.outputs.all_changed_files }}
116+
62117
markdownlint:
63118
runs-on: ubuntu-latest
64119
needs: add-doc-label

.github/workflows/ci-pipeline-branch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ jobs:
464464
github_token: ${{ secrets.GITHUB_TOKEN }}
465465
fail_on_error: true
466466
level: error
467+
reviewdog_flags: "-tee"
467468

468469
fe-ut:
469470
runs-on: [self-hosted, normal]

.github/workflows/ci-pipeline.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,18 @@ jobs:
249249
- 'be/test/**'
250250
- 'build-support/README.md'
251251
- 'build-support/check_be_module_boundaries.py'
252+
- 'build-support/check_common_config_header_includes.sh'
253+
- 'build-support/config_header_include_allowlist.txt'
254+
- 'build-support/gen_config_fwd_headers.py'
252255
- 'build-support/render_be_agents.py'
253256
- 'build-support/test_check_be_module_boundaries.py'
257+
- 'build-support/test_gen_config_fwd_headers.py'
254258
- 'build-support/test_render_be_agents.py'
255259
- 'build-support/be_module_boundary_baseline.json'
256260
- 'build-support/exec_env_header_include_allowlist.txt'
257261
- 'build-support/exec_env_singleton_allowlist.txt'
258262
- 'build-support/runtime_state_header_include_allowlist.txt'
263+
- 'be/src/common/config_fwd_headers_manifest.json'
259264
260265
- uses: dorny/paths-filter@v3
261266
id: linux-thirdparty-filter
@@ -379,8 +384,14 @@ jobs:
379384
run: |
380385
python3 -m unittest \
381386
build-support/test_check_be_module_boundaries.py \
387+
build-support/test_gen_config_fwd_headers.py \
382388
build-support/test_render_be_agents.py
383389
390+
- name: Config Forward Header Check
391+
run: |
392+
python3 build-support/gen_config_fwd_headers.py --check
393+
bash build-support/check_common_config_header_includes.sh
394+
384395
- name: AGENTS Drift Check
385396
run: |
386397
python3 build-support/render_be_agents.py --check
@@ -754,6 +765,7 @@ jobs:
754765
github_token: ${{ secrets.GITHUB_TOKEN }}
755766
fail_on_error: true
756767
level: error
768+
reviewdog_flags: "-tee"
757769

758770
fe-ut:
759771
runs-on: [self-hosted, normal]

.github/workflows/ci-report.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: CI Report
2-
run-name: CI Report(#${{ github.event.workflow_run.id }})
2+
run-name: >-
3+
CI Report —
4+
${{ github.event.workflow_run.pull_requests[0].number
5+
&& format('PR #{0} ({1})', github.event.workflow_run.pull_requests[0].number, github.event.workflow_run.head_branch)
6+
|| github.event.workflow_run.head_branch }}
7+
(parent #${{ github.event.workflow_run.id }})
38
49
on:
510
workflow_run:
@@ -39,6 +44,20 @@ jobs:
3944
BUCKET_PREFIX: ${{ steps.bucket_info.outputs.bucket_prefix }}
4045
SKIP_COV: ${{ steps.pr_details.outputs.SKIP_COV }}
4146
steps:
47+
- name: Surface parent CI PIPELINE link
48+
env:
49+
PARENT_RUN_ID: ${{ github.event.workflow_run.id }}
50+
PARENT_RUN_URL: ${{ github.event.workflow_run.html_url }}
51+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
52+
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
53+
run: |
54+
{
55+
echo "## Parent CI PIPELINE run"
56+
echo ""
57+
printf '[Run #%s](%s) - branch `%s` @ `%s`\n' \
58+
"$PARENT_RUN_ID" "$PARENT_RUN_URL" "$HEAD_BRANCH" "$HEAD_SHA"
59+
} >> "$GITHUB_STEP_SUMMARY"
60+
4261
- run: |
4362
sleep 10
4463

.github/workflows/weekly-docs-feedback.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,29 @@ jobs:
8989
echo " ${manual_dependabot_url}" >> feedback.md
9090
echo " " >> feedback.md
9191
92+
- name: Check for broken external links
93+
continue-on-error: true
94+
uses: lycheeverse/lychee-action@v2.8.0
95+
with:
96+
fail: false
97+
args: >
98+
--config docs/lychee.toml
99+
--format markdown
100+
--output lychee-broken-links.md
101+
"docs/en/**/*.md*"
102+
"docs/zh/**/*.md*"
103+
"docs/ja/**/*.md*"
104+
105+
- name: Append broken links to feedback
106+
run: |
107+
echo " " >> feedback.md
108+
echo "## Broken external links" >> feedback.md
109+
if [ -f lychee-broken-links.md ] && grep -q "Errors per input" lychee-broken-links.md; then
110+
cat lychee-broken-links.md >> feedback.md
111+
else
112+
echo "No broken links detected." >> feedback.md
113+
fi
114+
92115
- name: Create issue from file
93116
if: always()
94117
id: weekly-feedback-report

0 commit comments

Comments
 (0)