Skip to content

Commit 143c85a

Browse files
committed
add merge
Signed-off-by: sweeywu <sweetwx6@gmail.com>
2 parents 62fc327 + 0847367 commit 143c85a

File tree

81 files changed

+4247
-256
lines changed

Some content is hidden

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

81 files changed

+4247
-256
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: []

.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/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+
"
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Sync kmeshctl Docs to Website (via PR)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- docs/ctl/**
9+
- .github/workflows/sync-kmeshctl-docs.yml
10+
11+
jobs:
12+
sync-docs:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: 🧭 Checkout website repository
17+
uses: actions/checkout@v4
18+
with:
19+
repository: kmesh-net/website
20+
token: ${{ secrets.GH_PAT }}
21+
path: website
22+
ref: main
23+
fetch-depth: 1
24+
25+
- name: 🧭 Checkout kmesh repository
26+
uses: actions/checkout@v4
27+
with:
28+
repository: kmesh-net/kmesh
29+
token: ${{ secrets.GH_PAT }}
30+
path: kmesh
31+
fetch-depth: 1
32+
33+
- name: 🔁 Sync kmeshctl Docs Using rsync
34+
run: |
35+
set -e
36+
37+
# Define source and target directories
38+
KMESH_CTL_DIR="kmesh/docs/ctl"
39+
WEBSITE_KMESHCTL_DIR="website/docs/kmeshctl"
40+
41+
echo "🔍 Source directory: $KMESH_CTL_DIR"
42+
echo "🎯 Target directory: $WEBSITE_KMESHCTL_DIR"
43+
44+
# Check if source directory exists
45+
if [ ! -d "$KMESH_CTL_DIR" ]; then
46+
echo "❌ ERROR: Source directory does not exist!"
47+
exit 1
48+
fi
49+
50+
# Create target directory if it doesn't exist
51+
if [ ! -d "$WEBSITE_KMESHCTL_DIR" ]; then
52+
echo "📁 Creating $WEBSITE_KMESHCTL_DIR..."
53+
mkdir -p "$WEBSITE_KMESHCTL_DIR"
54+
fi
55+
56+
# Sync files using rsync
57+
echo "🔄 Syncing files with rsync..."
58+
rsync -avc --delete --exclude='.git' --exclude='.*' "$KMESH_CTL_DIR/" "$WEBSITE_KMESHCTL_DIR/"
59+
60+
# Navigate to the website repository
61+
cd website
62+
63+
# Stage changes
64+
git add -A docs/kmeshctl/
65+
66+
# Check if there are any changes
67+
if git diff --cached --quiet; then
68+
echo "✅ No changes detected."
69+
exit 0
70+
else
71+
echo "✨ Changes detected. Creating commit..."
72+
git config user.name "github-actions[bot]"
73+
git config user.email "github-actions[bot]@users.noreply.github.com"
74+
git commit -m 'docs: sync kmeshctl docs from kmesh-net/kmesh'
75+
fi
76+
77+
- name: 🤝 Create Pull Request
78+
uses: peter-evans/create-pull-request@v5
79+
with:
80+
token: ${{ secrets.GH_PAT }}
81+
path: website
82+
branch-suffix: timestamp
83+
base: main
84+
title: "docs: sync latest kmeshctl documentation (commit ${{ github.sha }})"
85+
body: |
86+
This PR syncs the latest changes from [kmesh/docs/ctl](https://github.com/kmesh-net/kmesh/tree/main/docs/ctl).
87+
88+
**Triggered by commit:** ${{ github.sha }}
89+
90+
Please review and merge.
91+
commit-message: "docs: sync kmeshctl docs"
92+
delete-branch: true

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ After that, run these local verifications before submitting pull request to pred
9595
fail of continuous integration.
9696

9797
- Run and pass `make gen-check`, if want to run with sudo privileges `sudo env PATH=$PATH make gen-check`
98-
- To compile, refer to [Compile and Build Kmesh](https://kmesh.net/en/docs/developer/build-guide/)
99-
- To run unit test, refer to [Run Unit Test](https://kmesh.net/en/docs/developer/run-ut/)
100-
- To run e2e test, refer to [Run E2E Test](https://kmesh.net/en/docs/developer/e2e-guide/)
98+
- To compile, refer to [Compile and Build Kmesh](https://kmesh.net/docs/setup/develop-with-kind/)
99+
- To run unit test, refer to [Run Unit Test](https://kmesh.net/docs/developer-guide/tests/unit-test/)
100+
- To run e2e test, refer to [Run E2E Test](https://kmesh.net/docs/developer-guide/tests/e2e-test/)
101101

102102
### Code Review
103103

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Kmesh innovatively sinks Layer 4 and Simple Layer 7 (HTTP) traffic governance to
4040
Kmesh also provide a Dual-Engine Mode, which makes use of eBPF and waypoint to process L4 and L7 traffic separately, thus allow you to adopt Kmesh incrementally, enabling a smooth transition from no mesh, to a secure L4, to full L7 processing.
4141

4242
<div align="center">
43-
<img src="docs/pics/dual-engine-mode.png" alt="duel-engine-mode" width="800" />
43+
<img src="docs/pics/dual-engine-mode.png" alt="dual-engine-mode" width="800" />
4444
<p>Dual-Engine Mode</p>
4545
</div>
4646

bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)