in devai-cli/src/devai/commands/document.py [0:0]
def update_releasenotes(context, tag, file):
"""Update release notes based on the context passed!
"""
click.echo('Reviewing and updating release notes ....')
version_info = f"The version number {tag} should be used." if tag else ""
# open the file passed and add to variable called current
try:
with open(file, 'r') as f:
current = f.read()
# click.echo(f"Current release notes: {current}")
except FileNotFoundError:
click.echo(f"Error: Release Notes file provided not found: {file}")
return
source='''
### Context (code) ###
CURRENT RELEASE NOTES:
{current}
NEW CODE:
{context}
'''
qry = get_prompt('document_update_releasenotes') or f'''
### Instruction ###
Review the CURRENT release notes and ensure they are comprehensive for the specified software project and version. The release notes should adhere to industry best practices, be suitable for both technical users and non-technical stakeholders.
Should be a two part output. Part 1 discussion of the existing release notes.
Part 2 should update the release notes incorporating the discussion points and and any changes to the code accurately reflect the changes and improvements introduced in this release.
{version_info}
### Output Format ###
Split into two parts.
Part 1: Discussion
Seperate the sections with a line of -------------- FEEDBACK ^^ -------- NEW VERSION vv -----------. Part 1 should be above this line and part 2 should be below this line.
The updated version sould be well-structured release notes document (in Markdown format by default) that updates the CURRENT version, incorporateing the discussion findings in part 1.
Ensure the release notes are clear, concise, and easy to understand for both technical and non-technical audiences.
Use appropriate formatting (e.g., headings, lists, code blocks) for readability.
Accurately reflect the changes and improvements made in the release.
Are professionally written and convey the value of the new version effectively.
### Example Dialogue ###
## Release Notes Review:
**Good:**
* The release notes clearly state the version number and project name.
* They provide a brief overview of the release's highlights in the introduction.
* The changes are categorized appropriately (New Features, Enhancements, Bug Fixes, Other Changes).
* The document mentions known issues, even if there are none.
**Bad/Unclear:**
* **Technical Detail:** The release notes lack specific technical details about the new caching mechanism. Providing more context, like the type of caching used (e.g., in-memory, distributed) or any configuration options available, would be helpful for technically-savvy users.
* **User Impact:** While the introduction mentions performance enhancements, it would be beneficial to quantify these improvements. For example, state an estimated percentage reduction in balance retrieval times or mention the impact on database load. This makes the value proposition clearer for all audiences.
* **Code References:** Linking the release notes to specific commits or pull requests that implement the changes would be helpful for developers who want to delve deeper into the codebase modifications.
-------------- FEEDBACK ^^ -------- NEW VERSION vv -----------
## Updated Release Notes:
## Balance Reader Service - Version coffee-1.2.3
This release introduces a new in-memory caching mechanism to significantly enhance the performance of balance retrieval, reducing the load on the backend database and speeding up balance retrieval times. Additional improvements have been made to logging and monitoring for better clarity and system insights.
### Changes
**New Features:**
* **In-Memory Caching:** To improve performance and reduce database load, we've implemented an in-memory cache for storing and retrieving account balances. This change is expected to reduce balance retrieval times significantly, especially under high load. (See code changes: [link to commit/PR])
**Enhancements:**
* **Improved Logging:** Logging messages have been refined to provide more detailed information, making it easier to troubleshoot issues and understand system behavior. (See code changes: [link to commit/PR])
* **Enhanced Monitoring:** Integration with Stackdriver metrics provides more comprehensive monitoring of the new caching layer and overall application performance. This enhancement enables better visibility into the service's health and performance. (See code changes: [link to commit/PR])
**Bug Fixes:**
* **Addressed Potential Race Condition:** A potential race condition that could occur during concurrent transaction processing has been identified and resolved, ensuring data integrity and system stability. (See code changes: [link to commit/PR])
**Other Changes:**
* Updated documentation to provide guidance on the new caching mechanism and its implications for users and developers.
**Known Issues:**
* None known at this time.
'''
source=source.format(current=current, context=format_files_as_string(context))
code_chat_model = GenerativeModel(MODEL_NAME)
with telemetry.tool_context_manager(USER_AGENT):
code_chat = code_chat_model.start_chat()
code_chat.send_message(qry)
response = code_chat.send_message(source)
click.echo(f"{response.text}")