kaizen icon indicating copy to clipboard operation
kaizen copied to clipboard

[WIP] feat: Add class and prompts for issue label generator

Open MashyBasker opened this issue 1 year ago โ€ข 3 comments

Enhance Issue Analysis and Improve Output Formatting

Overview

This pull request introduces a new module for issue analysis, enhancing the functionality for generating issue labels and descriptions based on provided prompts. It also includes minor formatting improvements across existing code for better readability.

Changes

  • Key Changes:

    • Added a new file issue_analysis.py that contains the IssueAnalysisGenerator class for generating issue labels and descriptions using a language model.
    • Introduced two new data classes, IssueLabelOutput and IssueDescOutput, to encapsulate the outputs of the label and description generation processes.
    • Implemented methods generate_issue_labels and generate_issue_desc to handle the respective functionalities, including error handling for missing inputs.
  • New Features:

    • The IssueAnalysisGenerator class provides functionality to generate labels and descriptions for GitHub issues, utilizing prompts defined in issue_analysis_prompts.py.
    • New prompts for issue analysis have been added, allowing for structured feedback generation based on issue titles and descriptions.
  • Refactoring:

    • Improved string formatting in existing print statements across multiple files for consistency and readability.
    • Added a placeholder function create_issue_description in output.py for future implementation, ensuring the structure is in place for generating issue descriptions.
Additional Notes
  • Error Handling: The new methods include checks for missing issue labels and descriptions, raising exceptions as necessary. This is a good practice to ensure that the methods fail gracefully when provided with invalid input.

  • Logging: The use of logging within the processing methods enhances traceability and debugging capabilities, which is beneficial for maintaining the code.

  • Maintainability: The introduction of data classes improves the organization of output data, making it easier to manage and extend in the future.

  • Performance: The methods for processing issues leverage the language model efficiently, but consider implementing caching mechanisms if the same issues are processed frequently to reduce API calls.

  • Testing: Ensure that unit tests are created for the new functionalities in issue_analysis.py to validate the behavior and output of the new methods.

โœจ Generated with love by Kaizen โค๏ธ

Original Description

MashyBasker avatar Aug 14 '24 17:08 MashyBasker

Is this task ready for review or are we waiting on anything specific?

sauravpanda avatar Aug 20 '24 21:08 sauravpanda

The issue analysis generation is done. I'm still working on adding it to the github app.

MashyBasker avatar Aug 21 '24 05:08 MashyBasker

Maybe we should merge this and create a separate task for github app?

sauravpanda avatar Aug 24 '24 04:08 sauravpanda

That sounds good. I'll put this PR up for review.

MashyBasker avatar Aug 25 '24 05:08 MashyBasker

@sauravpanda Do I need to make anymore changes to this PR? I'm still working on the GitHub app integration for issue analysis and will make a PR soon.

MashyBasker avatar Aug 28 '24 19:08 MashyBasker

๐Ÿ” Code Review Summary

โœ… All Clear: This commit looks good! ๐Ÿ‘

๐Ÿ“Š Stats

  • Total Feedbacks: 0
  • Suggested Refinements: 0
  • Files Affected: 0

๐Ÿ† Code Quality

[โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘] 90% (Excellent)

๐Ÿงช Test Cases

Test Cases need updates: Run !unittest to generate
Tests Not Found

The following files are missing corresponding test files:

  1. kaizen/generator/issue_analysis.py
  2. kaizen/generator/unit_test.py
  3. kaizen/reviewer/code_scan.py
  4. kaizen/generator/e2e_tests.py
  5. kaizen/llms/prompts/issue_analysis_prompts.py
  6. kaizen/helpers/output.py
Tests Found But May Need Update

The following test files may need to be updated to reflect recent changes:

Generate Unit Tests

To generate unit test cases for the code, please type !unittest in a comment. This will create a new pull request with suggested unit tests.

---------------------------------------

โœจ Generated with love by Kaizen โค๏ธ

Useful Commands
  • Feedback: Reply with !feedback [your message]
  • Ask PR: Reply with !ask-pr [your question]
  • Review: Reply with !review
  • Explain: Reply with !explain [issue number] for more details on a specific issue
  • Ignore: Reply with !ignore [issue number] to mark an issue as false positive
  • Update Tests: Reply with !unittest to create a PR with test changes

kaizen-bot[bot] avatar Aug 28 '24 19:08 kaizen-bot[bot]