.ai: add "add-related-resources" skill#22912
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new AI skill, add-related-resources, designed to automate the generation and validation of 'Related resources' sections in TiDB documentation. The implementation includes a skill definition, a metadata fetching script for various resource types (blogs, videos, and labs), and a validation script to maintain formatting consistency across English, Chinese, and Japanese docs. Review feedback suggests enhancing the attribute parsing regex to handle escaped quotes, improving Python compatibility for HTTP response handling, and removing redundant conditional logic in the duration formatting helper.
|
|
||
| HEADING_RE = re.compile(r"^## (Related resources|相关资源|関連リソース(?: \{#related-resources\})?)$") | ||
| CARD_RE = re.compile(r'^ <ResourceCard (.+) />$') | ||
| ATTR_RE = re.compile(r'([A-Za-z][A-Za-z0-9]*)="([^"]*)"') |
There was a problem hiding this comment.
The current regex for attributes does not account for escaped double quotes within attribute values (e.g., title="What is \"AI\"?"). This will cause the validation to fail for such titles. Consider updating the regex to handle escaped characters.
| ATTR_RE = re.compile(r'([A-Za-z][A-Za-z0-9]*)="([^"]*)"') | |
| ATTR_RE = re.compile(r'([A-Za-z][A-Za-z0-9]*)="((?:[^"\\\\]|\\\\.)*)"') |
[LGTM Timeline notifier]Timeline:
|
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Oreoxmt The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
In response to a cherrypick label: new pull request created to branch |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?