-
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-sharing-sofarpc-community-open-s… #1311
base: master
Are you sure you want to change the base?
Conversation
…ource-is-more-than-just-code
WalkthroughAn article written by Zheng Jiali, a graduate student from the National University of Defense Technology, is added. The article details her experience during the 2024 Open Source Summer program with SOFARPC. It discusses enhancements to dynamic configuration capabilities—enabling runtime configuration changes without service restarts—and the integration of multiple configuration centers (Apollo, Nacos, and Zookeeper). The document also includes diagrams illustrating the storage structure and update processes for configuration changes, along with reflections on overcoming compatibility challenges. Changes
Sequence Diagram(s)sequenceDiagram
participant ConfigCenter as Config Center (Apollo/Nacos/Zookeeper)
participant Listener as Config Listener
participant DynamicModule as Dynamic Config Module
participant Service as Service Interface
ConfigCenter->>+Listener: Detect configuration change
Listener->>+DynamicModule: Forward update event
DynamicModule->>+Service: Apply new configuration dynamically
Service-->>-DynamicModule: Confirm update
DynamicModule-->>-Listener: Acknowledge change
Listener-->>-ConfigCenter: Report success
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: 2
🧹 Nitpick comments (2)
content/zh/blog/open-source-summer-experience-sharing-sofarpc-community-open-source-is-more-than-just-code (2)
1-10
: Consider using standard Markdown formatting throughout the document.The document uses unusual formatting for text emphasis, with what appears to be zero-width spaces () around bold text markers (**). This non-standard formatting might cause rendering issues in some Markdown processors. Using standard Markdown formatting would improve consistency and compatibility.
For example, instead of:
**项目名称**
Use standard Markdown:
**项目名称**
This applies to all similar formatting throughout the document.
Also applies to: 18-20, 22-22, 31-34, 38-38, 44-44, 50-50, 68-68, 74-74, 80-80, 86-86, 88-88, 92-92, 96-96, 100-100, 104-104
106-107
: Consider adding a call-to-action or community resources.The article ends abruptly after the message to new open-source contributors. Consider adding a call-to-action section with links to:
- The SOFARPC GitHub repository
- Community channels (Slack, Discord, mailing lists)
- Documentation for getting started
- Future Open Source Summer opportunities
This would provide clear next steps for readers inspired by the article.
开源之路充满挑战,但也极富回报。勇于尝试,保持对技术的热情,你将在这个过程中不断成长! +## 加入 SOFAStack 社区 + +如果你也对 SOFAStack 感兴趣,欢迎通过以下方式了解更多或参与贡献: + +- GitHub:[https://github.com/sofastack/sofa-rpc](https://github.com/sofastack/sofa-rpc) +- 官方文档:[https://www.sofastack.tech/projects/sofa-rpc/overview/](https://www.sofastack.tech/projects/sofa-rpc/overview/) +- 开源之夏:[https://summer-ospp.ac.cn/](https://summer-ospp.ac.cn/)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/zh/blog/open-source-summer-experience-sharing-sofarpc-community-open-source-is-more-than-just-code
(1 hunks)
🔇 Additional comments (2)
content/zh/blog/open-source-summer-experience-sharing-sofarpc-community-open-source-is-more-than-just-code (2)
1-106
: Well-structured and comprehensive article - ready for publication.This is a well-organized article that effectively communicates the student's experience with the SOFARPC dynamic configuration project. The content has:
- Clear introduction and project background
- Detailed technical implementation with supporting diagrams
- Personal reflections on challenges and solutions
- Insights into the open-source community experience
These elements create a compelling narrative that will be valuable for readers interested in both the technical aspects of SOFARPC and the open-source contribution experience.
52-54
:❓ Verification inconclusive
Ensure technical accuracy of configuration structure visualization.
The diagram showing interface-level configuration storage structure and the explanation of using properties format for storing multiple configuration items is a key technical detail that should be verified for accuracy before publication.
🏁 Script executed:
#!/bin/bash # Description: Check if the properties format mentioned is consistent with SOFARPC code # Look for references to properties format in configuration handling echo "Checking for properties format usage in configuration:" rg -A 3 -B 3 "properties" --glob "*.java" # Look for evidence of interface-level configuration structures echo -e "\nChecking for interface-level configuration structures:" rg -A 2 "interface.+config" --glob "*.java"Length of output: 627
Action Required: Manual Verification for Technical Accuracy
The diagram and description of the interface-level configuration using the properties format should be manually verified against the actual SOFARPC configuration implementation. The automated search did not yield any matching Java files—likely due to filtering issues or file organization—so we cannot conclusively confirm the technical details through the script alone.
- Please confirm that the configuration management in SOFARPC indeed stores interface-level configurations in a properties format.
- Verify that the diagram accurately reflects how multiple configuration items are handled per interface.
- If discrepancies are found between the blog content and the actual implementation, update the content accordingly.
|
||
今天 SOFAStack 邀请到了开源之夏 2024 SOFARPC 社区的中选学生**郑佳莉**同学!在本项目中,她参与完成了 **SOFARPC 动态配置能力完善**。希望她分享的这段经历,能让更多人了解到 SOFARPC 开源社区,感受开源的魅力~ | ||
|
||
**项目链接**:[*https://summer-ospp.ac.cn/org/prodetail/2495a0307*](*https://summer-ospp.ac.cn/org/prodetail/2495a0307*) |
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.
🛠️ Refactor suggestion
Fix link formatting syntax.
The link format has unusual asterisks both inside and outside the brackets and parentheses, which may cause rendering issues. Markdown links should follow the format [text](url)
without asterisks.
- **项目链接**:[*https://summer-ospp.ac.cn/org/prodetail/2495a0307*](*https://summer-ospp.ac.cn/org/prodetail/2495a0307*)
+ **项目链接**:[https://summer-ospp.ac.cn/org/prodetail/2495a0307](https://summer-ospp.ac.cn/org/prodetail/2495a0307)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
**项目链接**:[*https://summer-ospp.ac.cn/org/prodetail/2495a0307*](*https://summer-ospp.ac.cn/org/prodetail/2495a0307*) | |
**项目链接**:[https://summer-ospp.ac.cn/org/prodetail/2495a0307](https://summer-ospp.ac.cn/org/prodetail/2495a0307) |
|
||
各配置中心内,请求维度配置信息的存储结构设计如下图,其中每个配置节点的数据对应着单个配置项的值: | ||
|
||
 |
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.
💡 Verification agent
🧩 Analysis chain
Verify image availability and consider using relative paths.
The article uses absolute URLs for all images, pointing to img.alicdn.com. While these might work currently, using absolute URLs from external domains creates dependencies on external services. If the external service changes its URL structure or becomes unavailable, the images will break.
Also applies to: 48-48, 54-54, 60-60, 64-64
🏁 Script executed:
#!/bin/bash
# Description: Check if the images referenced in the article are accessible
# Create an array of image URLs
declare -a image_urls=(
"https://img.alicdn.com/imgextra/i1/O1CN01uam04Y1vr6Xyhl4qr_!!6000000006225-0-tps-1080-654.jpg"
"https://img.alicdn.com/imgextra/i3/O1CN01bTopnq1F8U669LruX_!!6000000000442-0-tps-1048-264.jpg"
"https://img.alicdn.com/imgextra/i4/O1CN01ICkkAC1hBVxddRJ89_!!6000000004239-0-tps-1080-617.jpg"
"https://img.alicdn.com/imgextra/i3/O1CN01BfI96r1YNZqmoPYHV_!!6000000003047-0-tps-821-320.jpg"
"https://img.alicdn.com/imgextra/i2/O1CN01kfVMPK20WYrRRGTdr_!!6000000006857-0-tps-760-291.jpg"
)
# Check if each image is accessible
for url in "${image_urls[@]}"; do
response=$(curl -s -o /dev/null -w "%{http_code}" "$url")
if [ "$response" == "200" ]; then
echo "✅ Image accessible: $url"
else
echo "❌ Image not accessible (HTTP $response): $url"
fi
done
# Check if the repository has local images for similar blog posts
echo -e "\nChecking repository for image storage patterns:"
fd -t f -e jpg -e png -e jpeg -e gif -e svg -d 3 . | head -n 5
Length of output: 2901
🌐 Web query:
What is the recommended image storage practice for blog posts in Hugo-based static sites?
💡 Result:
For Hugo-based static sites, the recommended image storage practices for blog posts emphasize leveraging Hugo's built-in processing capabilities while maintaining organizational efficiency. Here are the key strategies:
Page Bundles (Preferred Method)
Store images within content directories using Hugo's page bundles:
content/
└── posts/
└── my-post/
├── index.md
├── featured-image.jpg
└── gallery/
├── image1.jpg
└── image2.jpg
This approach enables:
- Native image processing with
resources.Resize
and format conversion [4][7][10] - Simplified asset management through
.Resources.GetMatch
[4][7] - Automatic responsive image generation [1][6]
- Version control-friendly structure [6][10]
Image Optimization Techniques
- Responsive Images
{{ with .Resources.GetMatch "featured-image.jpg" }}
{{ $webp := .Resize "800x webp" }}
{{ $jpeg := .Resize "800x jpeg" }}
<picture>
<source srcset="{{ $webp.RelPermalink }}" type="image/webp">
<img src="{{ $jpeg.RelPermalink }}"
loading="lazy"
width="{{ $jpeg.Width }}"
height="{{ $jpeg.Height }}"
alt="Post featured image">
</picture>
{{ end }}
- Automatic Format Conversion
- Generate WebP alongside JPEG/PNG [1][6]
- Use Hugo Extended version for AVIF support [6]
- Performance Best Practices
- Lazy loading with
loading="lazy"
[1][6] - Width/height attributes to prevent layout shifts [6][10]
- Fingerprinting for cache busting [1][10]
Alternative Storage Options
- Static Directory (
/static/images/
)
- Simple reference:
/images/photo.jpg
- Bypasses Hugo processing [1][3]
- Best for site-wide assets like logos [3][4]
- External Hosting
- CDNs like imgix or Cloudflare Images [8]
- Decouples assets from codebase [2][8]
- Requires additional configuration [8]
Workflow Recommendations
- Maintain original high-res images in page bundles [6][10]
- Let Hugo generate optimized versions during build [1][6]
- Use Git LFS for large binary storage [9][10]
- Implement caching headers for CDN-hosted assets [5][8]
For most Hugo blogs, page bundles combined with responsive image processing provide the best balance of performance, maintainability, and Hugo integration. This approach reduced one user's image storage by 44% while improving site speed [6].
Citations:
- 1: https://devtidbits.com/2022/08/13/image-optimization-in-hugo/
- 2: https://dev.to/yugjadvani/optimal-strategies-for-storing-images-in-react-applications-best-practices-and-examples-3050
- 3: https://discourse.gohugo.io/t/newbie-where-do-people-store-images-to-posts/4630
- 4: https://discourse.gohugo.io/t/storing-image-as-asset-or-page-resource/31692
- 5: https://requestmetrics.com/web-performance/high-performance-images/
- 6: https://mikaelahonen.com/en/data/image-optimization-in-hugo/
- 7: https://discourse.gohugo.io/t/best-practices-on-image-file-locations/22635
- 8: https://docs.imgix.com/en-US/getting-started/best-practices/optimize-and-boost-static-site
- 9: https://discourse.gohugo.io/t/whats-the-recommended-workflow-for-blogging-with-images/31783
- 10: https://github.com/spech66/hugo-best-practices
Action: Update image paths to use Hugo page bundles or relative paths
The images are currently accessible via absolute URLs from an external host, which works at the moment but introduces a dependency on an external service. To improve long-term maintainability and leverage Hugo’s built-in image processing, consider migrating these images into your content structure (e.g., as page bundles) and referencing them via relative paths. This change will help prevent potential breakage if the external URL structure changes or becomes unavailable.
- File(s):
content/zh/blog/open-source-summer-experience-sharing-sofarpc-community-open-source-is-more-than-just-code
- Affected lines: 42, 48, 54, 60, 64
…ource-is-more-than-just-code
Summary by CodeRabbit