chore: release notes preparator
What does this PR do?
Adds script which can automatically generate the release notes for the user
Screenshot / video of UI
What issues does this PR fix or reference?
Closes #455
How to test this PR?
Export GITHUB_TOKEN run e.g.
ollama run gemma3:27b, when downloaded & started runpnpm releasenotes --username name --milestone 1.19.0 --ollama --model gemma3:27b- Start service in AI Lab e.g. granite3.3. & run
pnpm releasenotes --username name --milestone 1.19.0 --port [port of the service]
This should create release notes for 1.19 release with generated highlighted features. If the AI model does not return data in the correct format (can happen quite often) the release notes will be created without the highlighted features
- [ ] Tests are covering the bug fix or the new feature
Codecov Report
Attention: Patch coverage is 86.49351% with 52 lines in your changes missing coverage. Please review.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| scripts/release-notes/release-notes-preparator.ts | 82.62% | 49 Missing :warning: |
| scripts/release-notes/generate-release-notes.ts | 97.08% | 3 Missing :warning: |
:loudspeaker: Thoughts on this report? Let us know!
I would remove the changes in yaml and add tests if it looks OK cc @benoitf @jeffmaury
I don't know the state of this PR. Is it in draft ?
it's missing unit tests
It should be working, Sonia and Axel have tried this.
I just need to add some unit tests for this, although it is just a script generating md file
Need to fix some mocking in one of the tests
@benoitf tests added
hello, IMHO I would start by having such tool as a 3rd party repository for now
cc @slemeur @Firewall ^^
📝 Walkthrough
Walkthrough
This change introduces a new automated system for generating GitHub release notes for a repository milestone. A new npm script, releasenotes, is added to package.json to run a TypeScript script (generate-release-notes.ts). This script parses command-line arguments and environment variables, validates required parameters, and orchestrates the release notes generation process. The core logic is implemented in the new ReleaseNotesPreparator class, which fetches pull requests, analyzes contributors, interacts with an AI service for feature highlights, and renders release notes using a Mustache template. Comprehensive test suites for both the script and the preparator class are provided. Supporting files include a Mustache template for release notes formatting, a Vite configuration for the development environment, and a TypeScript declaration for importing raw Mustache templates.
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
types/template.d.ts
Oops! Something went wrong! :(
ESLint: 9.27.0
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'svelte-eslint-parser' imported from /eslint.config.mjs at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9) at packageResolve (node:internal/modules/esm/resolve:767:81) at moduleResolve (node:internal/modules/esm/resolve:853:18) at defaultResolve (node:internal/modules/esm/resolve:983:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12) at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25) at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38) at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38) at #link (node:internal/modules/esm/module_job:202:49)
scripts/release-notes/generate-release-notes.spec.ts
Oops! Something went wrong! :(
ESLint: 9.27.0
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'svelte-eslint-parser' imported from /eslint.config.mjs at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9) at packageResolve (node:internal/modules/esm/resolve:767:81) at moduleResolve (node:internal/modules/esm/resolve:853:18) at defaultResolve (node:internal/modules/esm/resolve:983:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12) at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25) at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38) at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38) at #link (node:internal/modules/esm/module_job:202:49)
scripts/release-notes/release-notes-preparator.spec.ts
Oops! Something went wrong! :(
ESLint: 9.27.0
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'svelte-eslint-parser' imported from /eslint.config.mjs at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9) at packageResolve (node:internal/modules/esm/resolve:767:81) at moduleResolve (node:internal/modules/esm/resolve:853:18) at defaultResolve (node:internal/modules/esm/resolve:983:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12) at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25) at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38) at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38) at #link (node:internal/modules/esm/module_job:202:49)
- 3 others
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
hello @gastoner I think you should proceed on a new repo without other answer ?
Closing in favor of https://github.com/podman-desktop/tool-release-notes/pull/1 from additional repository