Skip to content

.ai: add "add-related-resources" skill#22912

Merged
ti-chi-bot[bot] merged 3 commits into
pingcap:masterfrom
Oreoxmt:add-related-resources-skills
May 20, 2026
Merged

.ai: add "add-related-resources" skill#22912
ti-chi-bot[bot] merged 3 commits into
pingcap:masterfrom
Oreoxmt:add-related-resources-skills

Conversation

@Oreoxmt

@Oreoxmt Oreoxmt commented May 20, 2026

Copy link
Copy Markdown
Contributor

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.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@Oreoxmt Oreoxmt self-assigned this May 20, 2026
@Oreoxmt Oreoxmt added translation/no-need No need to translate this PR. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels May 20, 2026
@ti-chi-bot ti-chi-bot Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 20, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]*)="([^"]*)"')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
ATTR_RE = re.compile(r'([A-Za-z][A-Za-z0-9]*)="([^"]*)"')
ATTR_RE = re.compile(r'([A-Za-z][A-Za-z0-9]*)="((?:[^"\\\\]|\\\\.)*)"')

Comment thread .ai/skills/add-related-resources/scripts/fetch_resource_metadata.py
Comment thread .ai/skills/add-related-resources/scripts/fetch_resource_metadata.py
Comment thread .ai/AI-README.md Outdated
Comment thread .ai/skills/add-related-resources/SKILL.md Outdated
Comment thread .ai/skills/add-related-resources/SKILL.md Outdated
@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 20, 2026
@ti-chi-bot

ti-chi-bot Bot commented May 20, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-05-20 07:29:49.801437974 +0000 UTC m=+335719.305568640: ☑️ agreed by lilin90.

@Oreoxmt Oreoxmt added the lgtm label May 20, 2026
@Oreoxmt

Oreoxmt commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@ti-chi-bot

ti-chi-bot Bot commented May 20, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label May 20, 2026
@ti-chi-bot ti-chi-bot Bot merged commit d72c7a1 into pingcap:master May 20, 2026
11 of 12 checks passed
@ti-chi-bot

Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #22916.

@Oreoxmt Oreoxmt deleted the add-related-resources-skills branch May 20, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants