Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tangtang-0521
Copy link
Contributor

@tangtang-0521 tangtang-0521 commented Mar 5, 2025

…ource-is-more-than-just-code

Summary by CodeRabbit

  • Documentation
    • Published a new article featuring insights and experiences on enhancing dynamic configuration capabilities in a popular RPC framework, including integration with multiple configuration centers and real-time update processes.

Copy link

coderabbitai bot commented Mar 5, 2025

Walkthrough

An 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

File Path Change Summary
content/zh/blog/open-source-summer-experience-sharing-…-open-source-is-more-than-just-code Added an article detailing dynamic configuration enhancements in SOFARPC, integration of multiple config centers, implementation plans, and illustrative diagrams.

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
Loading

Poem

I’m a hopping rabbit on a code-filled spree,
Dancing through configs with charm and glee.
From Apollo to Zookeeper and Nacos in the mix,
Dynamic changes flow like magic tricks.
With every update, my joy increases—let’s hop in code bliss!


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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:

  1. The SOFARPC GitHub repository
  2. Community channels (Slack, Discord, mailing lists)
  3. Documentation for getting started
  4. 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

📥 Commits

Reviewing files that changed from the base of the PR and between d0809f8 and bd42595.

📒 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:

  1. Clear introduction and project background
  2. Detailed technical implementation with supporting diagrams
  3. Personal reflections on challenges and solutions
  4. 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*)
Copy link

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.

Suggested change
​**项目链接**​:[*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)


各配置中心内,请求维度配置信息的存储结构设计如下图,其中每个配置节点的数据对应着单个配置项的值:

![图片](https://img.alicdn.com/imgextra/i1/O1CN01uam04Y1vr6Xyhl4qr_!!6000000006225-0-tps-1080-654.jpg)
Copy link

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

  1. 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 }}
  1. Automatic Format Conversion
  • Generate WebP alongside JPEG/PNG [1][6]
  • Use Hugo Extended version for AVIF support [6]
  1. 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

  1. Static Directory (/static/images/)
  • Simple reference: /images/photo.jpg
  • Bypasses Hugo processing [1][3]
  • Best for site-wide assets like logos [3][4]
  1. 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:


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant