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

docs: Relative Issues & Component Update Logs Connected to Each Component #3027

Open
wants to merge 14 commits into
base: feat_v3.x
Choose a base branch
from

Conversation

Alex-huxiyang
Copy link
Collaborator

@Alex-huxiyang Alex-huxiyang commented Feb 27, 2025

描述

对所有组件文档的四个语言版本,自动生成Issues列表和组件更新日志模块及url。

关键实现

如何获取到最新的issues和版本日志,和无token访问Github API的频率限制

通过GitHub API和Authorization PAT可以打开速率限制,将获取、处理、更新等逻辑都在脚本中实现,本地通过脚本一键更新所有文档。

如何判断issues / update logs与组件等关联性呢

在实现过程中,直接通过title.includes(comName) 或者路由params拼接搜索的方式 实际匹配结果关联率低,如
'fix(dialog): 关闭按钮默认在底部,24px白色图标 (#2118) @irisSong', 应匹配dialog,但因包含“按钮”,依然会匹配到button组件
'feat(calendar): support renderBottomButton props (#2645) ', 同上,包含renderBottomButton
'希望Dialog组件内置的确认以及取消按钮对异步自带loading或者可以手动设置loading #1202', 同上,包含按钮
希望Dialog组件内置的确认以及取消按钮对异步自带loading或者可以手动设置loading #1202', 到底是Dialog还是loading?简单的字符串包含关系不能满足需求。

解决方法

实现analyzeTitleRelevance 函数通过组件库提交信息的特点,进行了赋分算法用于计算每个组件与标题信息的相关分数。如feat(xxx),括号中的组件内容为作者意图,+100分。完整包含组件英文/中文,+20分。字母拼写错误但部分包含字符串,如Uploade,+3分。等一系列规则。匹配出分数最高且等分的组件数组,对该数组范围的组件进行关联。

This comment was marked as off-topic.

@github-actions github-actions bot added 3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) labels Feb 27, 2025
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.05%. Comparing base (827ab5c) to head (3f12670).

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3027   +/-   ##
==========================================
  Coverage      86.05%   86.05%           
==========================================
  Files            281      281           
  Lines          18255    18255           
  Branches        2749     2749           
==========================================
  Hits           15709    15709           
  Misses          2541     2541           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@oasis-cloud oasis-cloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档上的处理逻辑太重,我认为 issue 和 log 只给筛选链接就行。我们实际要给用户的是 FAQ (提供对用户最常提出的问题及其答案的汇总),最主要关注的是高频问题,而不是组件和 Issue 标题的相关性。

Copy link
Collaborator

@xiaoyatong xiaoyatong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue部分当做一个 块结构,类似 demo 的 codeblock 的方式,进行处理。
避免被动拉取数据和主动拉取数据的混淆,给维护带来太多成本。

@Alex-huxiyang Alex-huxiyang requested a review from xiaoyatong March 4, 2025 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants