Skip to content

Conversation

Miles-hxy
Copy link
Collaborator

@Miles-hxy Miles-hxy 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.10%. Comparing base (40edc03) to head (a0355fe).
Report is 4 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3027   +/-   ##
==========================================
  Coverage      86.10%   86.10%           
==========================================
  Files            277      277           
  Lines          18406    18408    +2     
  Branches        2807     2807           
==========================================
+ Hits           15849    15851    +2     
  Misses          2552     2552           
  Partials           5        5           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 的方式,进行处理。
避免被动拉取数据和主动拉取数据的混淆,给维护带来太多成本。

@Miles-hxy Miles-hxy requested a review from xiaoyatong March 4, 2025 01:49
@Miles-hxy Miles-hxy requested review from oasis-cloud and removed request for oasis-cloud March 7, 2025 10:05
REPO_URL: 'https://github.com/jdf2e/nutui-react/',
HEADERS: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${TOKEN}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个 token 怎么弄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://github.com/settings/tokens. 在这里生成Generate new token(classic)复制进去

Copy link
Collaborator

Choose a reason for hiding this comment

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

这个json的修改时机,可以管控一下,比如每周发版时拉取新数据?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

理论上应该这样,只不过现在运行这个脚本需要一个个人token。在仓库的commit中不允许提交token,依赖本地运行。得看看还能不能通过其他方式注入

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.

1、使用文档补充一下
2、不需要区分issues和提交记录
3、没有内容的就不用展示整个节点了

@xiaoyatong xiaoyatong merged commit e947ab1 into jdf2e:feat_v3.x Mar 12, 2025
8 checks passed
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