release notes: add ai generator for improvements and bug fixes - #22850
Conversation
|
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new set of scripts to automate the generation of TiDB release notes using AI. The changes include modules for GitHub data fetching, Excel workbook processing, and AI prompt generation. Feedback provided includes suggestions for memory-efficient text processing and adding logging for truncated file summaries.
|
|
||
|
|
||
| def tail_output(text: str, max_lines: int = 40, max_chars: int = 4000) -> str: | ||
| tail = "\n".join(text.strip().splitlines()[-max_lines:]) |
| lines: list[str] = [] | ||
| page = 1 | ||
| total_chars = 0 | ||
| while len(lines) < max_files: |
ee6c21e to
2750b34
Compare
…and removed the --start-row/--end-row feature:
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a two-phase release-note generator. It processes Excel workbooks, filters release scope, retrieves GitHub data, generates and validates AI results, persists checkpoints, and exports grouped Markdown release notes. ChangesRelease Notes Generator
Estimated code review effort: 5 (Critical) | ~120 minutes Mergeability Score: 🟡 Moderate · up to This PR adds an AI release-note generator, but the current implementation can misclassify pull requests, write workbook data under the wrong columns, fail or misreport AI generation, accept vulnerable dependency versions, and use the wrong default output filename. These bounded correctness and security risks should be fixed or explicitly accepted before merging. Sequence Diagram(s)sequenceDiagram
participant Operator
participant CLI
participant ExcelWorkbook
participant GitHubClient
participant AIClient
participant MarkdownWriter
Operator->>CLI: run generate
CLI->>ExcelWorkbook: load and preprocess workbook
ExcelWorkbook->>GitHubClient: fetch issues and pull requests
GitHubClient-->>ExcelWorkbook: return cached metadata
ExcelWorkbook->>AIClient: generate validated row result
AIClient-->>ExcelWorkbook: return release note and documentation impact
ExcelWorkbook-->>CLI: save processed workbook
Operator->>CLI: run export-markdown
CLI->>ExcelWorkbook: collect Markdown entries
ExcelWorkbook-->>CLI: return entries
CLI->>MarkdownWriter: write release file
MarkdownWriter-->>Operator: write Markdown output
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 15
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0a49cb05-195e-4962-b6fe-265fa8d63f52
📒 Files selected for processing (16)
scripts/release-notes-ai-generator/__main__.pyscripts/release-notes-ai-generator/ai_client.pyscripts/release-notes-ai-generator/cli.pyscripts/release-notes-ai-generator/constants.pyscripts/release-notes-ai-generator/excel_workbook.pyscripts/release-notes-ai-generator/github_client.pyscripts/release-notes-ai-generator/markdown_writer.pyscripts/release-notes-ai-generator/models.pyscripts/release-notes-ai-generator/prompts/doc-impact.mdscripts/release-notes-ai-generator/prompts/generation.mdscripts/release-notes-ai-generator/prompts/release-note.mdscripts/release-notes-ai-generator/release-notes-generator-readme.mdscripts/release-notes-ai-generator/requirements.txtscripts/release-notes-ai-generator/scope_filter.pyscripts/release-notes-ai-generator/tests/test_doc_impact.pyscripts/release-notes-ai-generator/utils.py
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a7ce6cf7-7a91-433e-938a-6bea1264a09e
📒 Files selected for processing (5)
scripts/release-notes-ai-generator/__main__.pyscripts/release-notes-ai-generator/cli.pyscripts/release-notes-ai-generator/excel_workbook.pyscripts/release-notes-ai-generator/release-notes-generator-readme.mdscripts/release-notes-ai-generator/tests/test_doc_impact.py
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiancai 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 |
What is changed, added or deleted? (Required)
scripts/release_notes_generate_ai.py.scripts/release_notes_ai/package for workbook preprocessing, scope filtering, duplicate release note reuse, AI/non-AI generation, Markdown rendering, and GitHub API helpers.release-<version>.mdwhen the release note file does not exist, and torelease-<version>-updated-by-ai.mdwhen it already exists.Validation:
git diff --checkPYTHONPATH=scripts PYTHONDONTWRITEBYTECODE=1 python3 scripts/release_notes_generate_ai.py --helpPYTHONPATH=scripts PYTHONDONTWRITEBYTECODE=1 python3 - <<EOFcheck fordefault_output_release_fileWhich TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?
Summary by CodeRabbit
New Features
Documentation