Skip to content

Commit 121b496

Browse files
author
lec-bit
committed
Merge branch 'main' of https://github.com/kmesh-net/kmesh
2 parents 4cc6930 + 18ccbeb commit 121b496

File tree

367 files changed

+26392
-6927
lines changed

Some content is hidden

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

367 files changed

+26392
-6927
lines changed

.gemini/config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
have_fun: true
2+
code_review:
3+
disable: false
4+
comment_severity_threshold: HIGH
5+
max_review_comments: -1
6+
pull_request_opened:
7+
help: false
8+
summary: true
9+
code_review: true
10+
ignore_patterns: []

.githooks/pre-commit

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
#
3+
# Kmesh pre-commit hook
4+
# This hook runs 'make clean' and 'make gen-check' before each commit
5+
# to ensure generated files are up-to-date and temporary files are cleaned up.
6+
#
7+
8+
set -e
9+
10+
echo "Running pre-commit checks..."
11+
12+
# Change to repository root
13+
REPO_ROOT=$(git rev-parse --show-toplevel)
14+
cd "$REPO_ROOT"
15+
16+
# Run make clean to restore auto-generated files
17+
echo "→ Running 'make clean'..."
18+
if ! make clean; then
19+
echo "❌ 'make clean' failed"
20+
exit 1
21+
fi
22+
23+
# Run make gen-check to verify generated files are up-to-date
24+
echo "→ Running 'make gen-check'..."
25+
if ! make gen-check; then
26+
echo "❌ 'make gen-check' failed"
27+
echo ""
28+
echo "Generated files are out of date. Please run 'make gen' and commit the changes."
29+
exit 1
30+
fi
31+
32+
echo "✅ Pre-commit checks passed"
33+
exit 0

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ labels: kind/bug
1919
**Environment**:
2020

2121
- Kmesh version:
22-
- Kmesh mode(kmesh has `Kernel-Native Mode` and `Duel-Engine Mode`):
22+
- Kmesh mode(kmesh has `Kernel-Native Mode` and `Dual-Engine Mode`):
2323
- Istio version:
2424
- Kernel version:
2525
- Others:

.github/ISSUE_TEMPLATE/good-first.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Then, the issue will be assigned to you.
2828
**How to ask for help**:
2929

3030
If you need help or have questions, please feel free to ask on this issue.
31-
The issue author or other members of the community will guide you through the contribution process.
31+
The issue author or other members of the community will guide you through the contribution process.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Please make sure you have read the FAQ and searched the issue list.
1717
**Environment**:
1818

1919
- Kmesh version:
20-
- Kmesh mode(kmesh has `Kernel-Native Mode` and `Duel-Engine Mode`):
20+
- Kmesh mode(kmesh has `Kernel-Native Mode` and `Dual-Engine Mode`):
2121
- Istio version:
2222
- Kernel version:
2323
- Others:
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Chinese Grammar Check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/cn/zh/**'
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- 'docs/cn/zh/**'
12+
13+
jobs:
14+
grammar-check:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install language-tool-python
30+
31+
- name: Run grammar check with enhanced reporting
32+
run: |
33+
python -c "
34+
import os
35+
import language_tool_python
36+
from pathlib import Path
37+
import time
38+
39+
# Retry LanguageTool init
40+
tool = None
41+
for _ in range(3):
42+
try:
43+
tool = language_tool_python.LanguageTool('zh-CN')
44+
tool.enable_spellchecking()
45+
break
46+
except Exception as e:
47+
print(f'⚠️ LanguageTool init failed: {e}, retrying...')
48+
time.sleep(5)
49+
if not tool:
50+
print('📢 [Warning] Failed to initialize LanguageTool after retries. Skipping check.')
51+
exit(0)
52+
53+
def get_line_number(text, offset):
54+
return text[:offset].count('\\n') + 1
55+
56+
def classify_rule(rule_id):
57+
if 'MORFOLOGIK_RULE' in rule_id:
58+
return '🔤 Spelling'
59+
elif 'GRAMMAR' in rule_id or 'CONJUGATION' in rule_id:
60+
return '🧩 Grammar'
61+
elif 'STYLE' in rule_id:
62+
return '✍️ Style'
63+
else:
64+
return '🔍 Other'
65+
66+
files_to_check = set()
67+
for directory in ['docs', 'docs/proposal', 'docs/ctl']:
68+
for file_path in Path(directory).rglob('*.md'):
69+
if file_path.is_file():
70+
files_to_check.add(file_path)
71+
72+
error_found = False
73+
error_messages = []
74+
75+
print('🚀 Starting Chinese grammar check...\n')
76+
77+
for file_path in sorted(files_to_check):
78+
try:
79+
with open(file_path, 'r', encoding='utf-8') as f:
80+
text = f.read()
81+
except UnicodeDecodeError:
82+
msg = f'❌ Encoding error: Unable to read {file_path} with UTF-8'
83+
print(msg)
84+
error_messages.append(msg)
85+
error_found = True
86+
continue
87+
88+
print(f'📄 Checking: {file_path}')
89+
matches = tool.check(text)
90+
91+
for match in matches:
92+
line_no = get_line_number(text, match.offset)
93+
rule_type = classify_rule(match.ruleId)
94+
message = match.message
95+
context = match.context.strip()
96+
suggestion = match.replacements[0] if match.replacements else 'No suggestion'
97+
98+
# Build formatted error message with emojis and spacing
99+
error_line = f' 📂 File: {file_path}:{line_no}'
100+
error_line += f'\\n 🔖 Type: {rule_type}'
101+
error_line += f'\\n ❌ Message: {message}'
102+
error_line += f'\\n 💬 Context: \"{context}\"'
103+
error_line += f'\\n 💡 Suggestion: \"{suggestion}\"'
104+
error_line += f'\\n'
105+
106+
error_messages.append(error_line)
107+
error_found = True
108+
109+
# GitHub warning annotation (with emoji in title)
110+
print(f'::warning file={file_path},line={line_no},title=🔍 {rule_type}::{message} (💡 {suggestion})')
111+
112+
if not matches:
113+
print(f'✅ No issues found in {file_path}')
114+
115+
# Final summary with spacing and emojis
116+
print('\\n' + '─' * 60)
117+
if error_found:
118+
print('📢 Chinese Grammar Check: Potential Issues Found')
119+
print('─' * 60)
120+
for msg in error_messages:
121+
print(msg)
122+
print('─' * 60)
123+
print('📌 Tip: Review the suggestions above. Some may be false positives.')
124+
print('💡 Pro tip: Fix critical issues like “降低3倍” or “原因是因为”.')
125+
else:
126+
print('✅ All Chinese content passed grammar and spelling checks.')
127+
print('✨ Great job! No issues found.')
128+
"

.github/workflows/e2e-ipv6-istio-1.24.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- '**.png'
88
jobs:
99
e2e-ipv6-test:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
1313
go-version: [ '1.23' ]

.github/workflows/e2e-ipv6-istio-1.23.yml renamed to .github/workflows/e2e-ipv6-istio-1.25.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E IPv6 Test(istio 1.23)
1+
name: E2E IPv6 Test(istio 1.25)
22
on:
33
pull_request:
44
paths-ignore:
@@ -7,7 +7,7 @@ on:
77
- '**.png'
88
jobs:
99
e2e-ipv6-test:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
1313
go-version: [ '1.23' ]
@@ -23,4 +23,4 @@ jobs:
2323
- name: E2E IPv6 Test
2424
shell: bash
2525
run: |
26-
sudo ISTIO_VERSION="1.23.0" make e2e-ipv6
26+
sudo ISTIO_VERSION="1.25.1" make e2e-ipv6

.github/workflows/e2e-ipv6.yml renamed to .github/workflows/e2e-ipv6-istio-1.26.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E IPv6 Test(istio 1.22)
1+
name: E2E IPv6 Test(istio 1.26)
22
on:
33
pull_request:
44
paths-ignore:
@@ -7,7 +7,7 @@ on:
77
- '**.png'
88
jobs:
99
e2e-ipv6-test:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
1313
go-version: [ '1.23' ]
@@ -23,4 +23,4 @@ jobs:
2323
- name: E2E IPv6 Test
2424
shell: bash
2525
run: |
26-
sudo make e2e-ipv6
26+
sudo ISTIO_VERSION="1.26.4" make e2e-ipv6

.github/workflows/e2e-istio-1.24.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- '**.png'
88
jobs:
99
e2e-test:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
1313
go-version: [ '1.23' ]

0 commit comments

Comments
 (0)