-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create open-source-summer-experience-haring-mosn-community-weixin-doi… #1310
base: master
Are you sure you want to change the base?
Conversation
…ng-what-you-think-is-cool
WalkthroughThis pull request adds a new blog post file in the content repository. The post, authored by 韦鑫, details his experience during the 2024 Open Source Summer program. It describes the integration of Sentinel-golang traffic control capabilities into the MoE (MOSN on Envoy) ecosystem. The document outlines project objectives, includes an overview of existing HTNN community plugins, discusses specific Sentinel-golang features, and explains the plugin development process with configuration and testing procedures. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer as 韦鑫
participant HTNN as HTNN Community Plugins
participant Sentinel as Sentinel-golang
participant MoE as MoE Ecosystem
Developer->>HTNN: Review existing traffic control plugins
Developer->>Sentinel: Explore features (flow control, circuit breaking, etc.)
Developer->>MoE: Integrate Sentinel capabilities
MoE-->>Developer: Supply guidelines & structure
Developer->>MoE: Configure and test plugin development
Developer-->Developer: Document and reflect in blog post
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (11)
content/zh/blog/open-source-summer-experience-haring-mosn-community-weixin-doing-what-you-think-is-cool (11)
15-15
: Use proper markdown link formatting.The project link uses both markdown and HTML-style formatting which may cause rendering issues.
-**项目链接**:[https://github.com/mosn/htnn/tree/main/plugins/plugins/sentinel](*https://github.com/mosn/htnn/tree/main/plugins/plugins/sentinel*) +**项目链接**:[https://github.com/mosn/htnn/tree/main/plugins/plugins/sentinel](https://github.com/mosn/htnn/tree/main/plugins/plugins/sentinel)
31-50
: Clear explanation of Sentinel-golang capabilities and implementation decisions.This section effectively explains what traffic control capabilities Sentinel-golang offers and provides well-reasoned justifications for why certain features (memory-based flow control, isolation, and system adaptive protection) were not implemented in this specific project context. The technical reasoning is sound and demonstrates good architectural decision-making.
148-151
: Remove HTML span tags in code paths.Using HTML
<span>
tags inside the code paths may cause rendering issues with some markdown processors. Standard markdown formatting should be used instead.-1. 进入 `<span>types/plugins</span>` 目录,创建插件配置结构目录 `<span>sentinel</span>` -2. 在 `<span>sentinel/config.proto</span>` 中定义插件模型,即配置结构 -3. 通过根目录的 `<span>Makefile</span>`,执行 `<span>make gen-proto</span>` 生成插件的 Go 配置结构 -4. 在 `<span>sentinel/config.go</span>` 定义插件名称、类型、执行顺序等,并编写 Validate 作为配置校验逻辑 -5. 在 `<span>plugins.go</span>` 中添加配置结构 package +1. 进入 `types/plugins` 目录,创建插件配置结构目录 `sentinel` +2. 在 `sentinel/config.proto` 中定义插件模型,即配置结构 +3. 通过根目录的 `Makefile`,执行 `make gen-proto` 生成插件的 Go 配置结构 +4. 在 `sentinel/config.go` 定义插件名称、类型、执行顺序等,并编写 Validate 作为配置校验逻辑 +5. 在 `plugins.go` 中添加配置结构 package
156-161
: Remove HTML span tags in code paths.Similar to the previous comment, HTML
<span>
tags should be removed from these code paths.-2. 在 `<span>sentinel/config.go</span>` 中编写插件配置解析逻辑 -3. 在 `<span>sentinel/filter.go</span>` 中编写插件核心工作逻辑 -4. 在 `<span>sentinel/config_test.go</span>` 中编写配置解析的单元测试 -5. 在 `<span>sentinel/filter_test.go</span>` 中编写插件工作所依赖方法的单元测试 +2. 在 `sentinel/config.go` 中编写插件配置解析逻辑 +3. 在 `sentinel/filter.go` 中编写插件核心工作逻辑 +4. 在 `sentinel/config_test.go` 中编写配置解析的单元测试 +5. 在 `sentinel/filter_test.go` 中编写插件工作所依赖方法的单元测试
164-167
: Remove HTML span tags in code paths.Remove HTML
<span>
tags from code paths here as well.-1. 返回 `<span>plugins</span>` 目录 -2. 在 `<span>plugins.go</span>` 中添加插件 package -3. 在 `<span>tests/integration/sentinel_test.go</span>` 中编写集成测试 -4. 通过当前目录下的 `<span>Makefile</span>`,执行 `<span>make bulid_test_so</span>` 得到编译产物,接着进行集成测试,如GreenOpstest -v ./tests/integration/sentinel\_test.go ./tests/integration/suite\_test.go +1. 返回 `plugins` 目录 +2. 在 `plugins.go` 中添加插件 package +3. 在 `tests/integration/sentinel_test.go` 中编写集成测试 +4. 通过当前目录下的 `Makefile`,执行 `make bulid_test_so` 得到编译产物,接着进行集成测试,如GreenOpstest -v ./tests/integration/sentinel_test.go ./tests/integration/suite_test.go
174-180
: Remove HTML span tags and fix documentation link formatting.Remove HTML
<span>
tags and fix the documentation link formatting.-`<span>content/zh-hans/docs/reference/plugins/sentinel.md</span>` 中 - -3. 使用仓库提供的翻译工具得到 `<span>prompt:go run cmd/translator/main.go -f .content/zh-hans/docs/reference/plugins/sentinel.md --from zh-Hans | pbcopy</span>` -4. 将粘贴板内容提交到 LLM,如 ChatGPT 中得到英文文档,保存到 - -`<span>content/en/docs/reference/plugins/sentinel.md</span>` 中 +`content/zh-hans/docs/reference/plugins/sentinel.md` 中 + +3. 使用仓库提供的翻译工具得到 `prompt:go run cmd/translator/main.go -f .content/zh-hans/docs/reference/plugins/sentinel.md --from zh-Hans | pbcopy` +4. 将粘贴板内容提交到 LLM,如 ChatGPT 中得到英文文档,保存到 + +`content/en/docs/reference/plugins/sentinel.md` 中
184-184
: Remove HTML span tags in code paths.Remove HTML
<span>
tags from the Makefile command paths.-2. 通过根目录的 `<span>Makefile</span>`, 执行 make lint,make fmt 等命令做代码提交前的检查 +2. 通过根目录的 `Makefile`, 执行 make lint,make fmt 等命令做代码提交前的检查
188-190
: Fix link formatting.The links use an incorrect format that might not render properly. Use standard markdown link syntax.
-* 如何二次开发 HTNN:[*https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/get\_involved.md*](*https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/get\_involved.md*) -* 插件开发:[*https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin\_development.md*](*https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin\_development.md*) -* 插件集成测试框架:[*https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin\_integration\_test\_framework.md*](*https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin\_integration\_test\_framework.md*) +* 如何二次开发 HTNN:[https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/get_involved.md](https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/get_involved.md) +* 插件开发:[https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin_development.md](https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin_development.md) +* 插件集成测试框架:[https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin_integration_test_framework.md](https://github.com/mosn/htnn/blob/main/site/content/zh-hans/docs/developer-guide/plugin_integration_test_framework.md)
168-168
: Fix typo in build command.There appears to be a typo in the build command.
-4. 通过当前目录下的 `<span>Makefile</span>`,执行 `<span>make bulid_test_so</span>` 得到编译产物,接着进行集成测试,如GreenOpstest -v ./tests/integration/sentinel\_test.go ./tests/integration/suite\_test.go +4. 通过当前目录下的 `Makefile`,执行 `make build_test_so` 得到编译产物,接着进行集成测试,如GreenOpstest -v ./tests/integration/sentinel_test.go ./tests/integration/suite_test.go
97-97
: Clarify explanation with proper spacing.The explanation of circuit breaking behavior has some formatting issues where the asterisks meant to create italics are pushing against the text.
-7. 若匹配上,则以 entry 为入参调用 Sentinel API TraceError 统计错误*(当达到用户配置的错误数量时会在下一次调用 Sentinel API Entry 时触发流控,即熔断) * +7. 若匹配上,则以 entry 为入参调用 Sentinel API TraceError 统计错误 *(当达到用户配置的错误数量时会在下一次调用 Sentinel API Entry 时触发流控,即熔断)*
183-183
: Fix formatting issue with maturity level explanation.The formatting for the feature maturity level explanation has spacing issues.
-1. 在 `maintainer/feature_maturity_level.yaml` 中添加插件的成熟级别*(feature maturity level) * +1. 在 `maintainer/feature_maturity_level.yaml` 中添加插件的成熟级别 *(feature maturity level)*
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/zh/blog/open-source-summer-experience-haring-mosn-community-weixin-doing-what-you-think-is-cool
(1 hunks)
🔇 Additional comments (3)
content/zh/blog/open-source-summer-experience-haring-mosn-community-weixin-doing-what-you-think-is-cool (3)
1-13
: Well-structured introduction with clear author information.The blog post begins with a well-organized header that clearly identifies the author, their background, and sets appropriate expectations for the readers. Including the reading time estimate (7 minutes for 3756 characters) is helpful for readers.
55-55
: Verify image accessibility.The blog post contains an image without alt text. For better accessibility, consider adding descriptive alternative text to the image.
- +
192-228
: Well-written personal reflection with valuable insights.This section offers an excellent personal perspective on the author's open-source journey. It effectively communicates their motivations, challenges faced during development, and the valuable lessons learned. The discussion about solving the Sentinel Entry's Exit timing issue (lines 205-211) provides a particularly insightful technical detail that demonstrates the collaborative problem-solving process in open-source communities.
The concluding thoughts about the importance of testing, CI/CD, and encouragement for others to participate in open-source are inspiring and align well with best practices in software development.
…ng-what-you-think-is-cool
Summary by CodeRabbit