Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Feature Request: AI-Powered GitHub Issue Generator (using o3-mini) #3311

Open
DonnieBLT opened this issue Feb 1, 2025 · 13 comments · May be fixed by #3322
Open

✨ Feature Request: AI-Powered GitHub Issue Generator (using o3-mini) #3311

DonnieBLT opened this issue Feb 1, 2025 · 13 comments · May be fixed by #3322

Comments

@DonnieBLT
Copy link
Collaborator

We propose adding a new feature to the BLT website that leverages OpenAI’s o3-mini model to automatically generate detailed GitHub issues from a simple user-provided description. Users will be able to input a brief summary of a feature, bug, issue, or task, and the system will use the o3-mini model to produce a fully detailed GitHub issue complete with AI agent instructions for further development or resolution.

Feature Details:
• User Input:
• A text input area where users can describe a feature, bug, issue, or task in plain language.
• AI Integration:
• Integration with the OpenAI API using the o3-mini model.
• The model processes the user’s input and generates a detailed GitHub issue that includes:
• A comprehensive description.
• Steps to reproduce (if applicable).
• Suggested tasks or subtasks.
• Detailed AI agent instructions for potential automation or further processing.
• Output Display:
• The generated GitHub issue will be presented on the website for review.
• Users will have the option to directly copy or submit the issue to a GitHub repository via an authenticated integration.
• Configuration:
• API keys and model parameters should be managed securely using environment variables.
• The prompt template used by the o3-mini model for generating issue details should be easily configurable.

Technical Requirements:
• Frontend:
• A simple, user-friendly form component on the BLT website.
• A display area for the AI-generated GitHub issue preview.
• Backend:
• A new Django endpoint that:
• Accepts user input.
• Calls the OpenAI API using the o3-mini model.
• Returns the generated issue text.
• Robust error handling for API failures or unexpected input.
• Testing:
• Unit tests for the API integration with the o3-mini model.
• Integration tests ensuring the generated issues meet the expected format and content.
• Documentation:
• Clear instructions on configuring the OpenAI API integration and adjusting the prompt template.
• A user guide explaining how to use the AI-powered issue generator feature.

AI Coding Agent Instructions:

To assist in building this feature, use the following prompt for your AI coding agent:

You are tasked with building a Django web application feature called "AI-Powered GitHub Issue Generator" for the BLT website. The feature should allow a user to input a short description of a feature, bug, issue, or task, and then use the OpenAI API with the o3-mini model to generate a detailed GitHub issue complete with a comprehensive description, reproduction steps, subtasks, and detailed AI agent instructions.

Requirements:

  • Create a Django app (e.g., named "issue_generator") with the following:
    • A model (if necessary) to store user submissions and generated issues.
    • A view that handles a form submission (using a Django form) from the homepage where the user enters their description.
    • A Django view (or API endpoint) that takes the user input, calls the OpenAI API (using the o3-mini model), and returns the generated GitHub issue.
    • Template(s) to display the input form and the output preview of the generated issue.
    • Error handling to manage API failures gracefully.
    • Unit tests for the API integration and view logic.

Additional notes:

  • All API keys and model parameters should be read from environment variables.
  • Ensure that the code is modular so that the prompt template for the OpenAI API can be easily updated.
  • Provide comments in the code to explain the logic and data flow.
  • Follow best practices for Django project structure.

Generate the scaffolding code, including models (if any), views, forms, templates, and unit tests, for this feature.

Acceptance Criteria:
1. Functionality:
• A user can enter a brief description on the BLT website.
• The system sends this description to the OpenAI API using the o3-mini model and retrieves a detailed GitHub issue.
• The generated issue includes a comprehensive description, reproduction steps (if applicable), subtasks, and clear AI agent instructions.
2. Usability:
• The feature is integrated with a clean, intuitive UI.
• Users can easily review and copy/submit the generated issue.
3. Reliability:
• The API integration handles errors gracefully and provides informative feedback to the user.
• All configurations (API keys, model parameters, prompt templates) are securely managed.
4. Testing & Documentation:
• Comprehensive unit and integration tests cover the new feature.
• Documentation is updated with setup instructions, configuration details, and usage examples.

Additional Considerations:
• Monitor potential rate limits or usage costs associated with the OpenAI API and implement safeguards as needed.
• Consider future enhancements such as saving past generated issues, allowing in-browser edits before submission, or providing multiple generation options based on user preferences.

@krrish-sehgal
Copy link
Contributor

/assign

Copy link
Contributor

github-actions bot commented Feb 1, 2025

Hello @krrish-sehgal! You've been assigned to OWASP-BLT/BLT issue #3311. You have 24 hours to complete a pull request.

Copy link
Contributor

github-actions bot commented Feb 2, 2025

⏰ This issue has been automatically unassigned due to 24 hours of inactivity.
The issue is now available for anyone to work on again.

@krrish-sehgal
Copy link
Contributor

/assign

Copy link
Contributor

github-actions bot commented Feb 2, 2025

Hello @krrish-sehgal! You've been assigned to OWASP-BLT/BLT issue #3311. You have 24 hours to complete a pull request.

@krrish-sehgal
Copy link
Contributor

@DonnieBLT sir , in the requirements section , its mentioned to "Create a Django app (e.g., named "issue_generator")" , I wanted to double check if this is what needs to be done, as it can be implemented under the website app only.

@DonnieBLT
Copy link
Collaborator Author

No separate app. 👍 only the website app with organized files

@krrish-sehgal krrish-sehgal linked a pull request Feb 2, 2025 that will close this issue
Copy link
Contributor

github-actions bot commented Feb 4, 2025

⏰ This issue has been automatically unassigned due to 24 hours of inactivity.
The issue is now available for anyone to work on again.

Copy link
Contributor

github-actions bot commented Feb 4, 2025

⏰ This issue has been automatically unassigned due to 24 hours of inactivity.
The issue is now available for anyone to work on again.

@krrish-sehgal
Copy link
Contributor

krrish-sehgal commented Feb 4, 2025

@DonnieBLT sir, I have been trying to figure out a lot , about making the exsisting django allauth functionality work with github.

I have went through numerous resources including stackoverflow and documentations to figure out , where does the allauth token is stored , everywhere it was suggested that it automatically stores in Social token model, but this access token is not getting stored. Moreover all auth is offering a really bad UX , and each time we will have to go to the dummy allauth page , to login.

Can i make customised functions to our usecase and remove allauth for github login, it will allow us to have more control.

@DonnieBLT
Copy link
Collaborator Author

Allauth was working before. I would suggest first removing the custom code and adding it back one by one so we can still use it and keep a standardized code

@krrish-sehgal
Copy link
Contributor

Sure sir , I'll make it work .

@krrish-sehgal
Copy link
Contributor

krrish-sehgal commented Feb 5, 2025

@DonnieBLT sir , figured out the configs after taking some help from the django community.
Its working now. Can you please review the PR?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants