JACoB PR for Issue Enhance the Jira to GitHub issue conversion #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Summary
Many incoming Jira tickets lack sufficient detail for JACoB to process them effectively. This leads to wasted resources as we create plans and research items for tasks that cannot be completed due to inadequate information. To improve efficiency, we need to implement an evaluation step before converting Jira issues into GitHub issues.
Proposed Solution
Enhance the Jira to GitHub issue conversion process by introducing an issue quality evaluation step. Instead of always rewriting the Jira title and description and creating a new GitHub issue, we will first assess the quality of the Jira issue to determine if it contains enough detail for JACoB to handle.
Implementation Steps
1. Implement
evaluateJiraIssueFunction/src/server/utils/evaluateIssue.tsevaluateJiraIssuethat:2. Update the Jira Issue Conversion Process
/src/server/utils/jira.tsconvertJiraIssueToGithubIssuefunction to include the evaluation step:evaluateJiraIssuefunction with the Jira issue's title and description.3. Update the Issues Database Schema
/src/server/db/migrations/20241130000000_updateIssuesTable.tsissuestable to include the following optional fields:jiraIssueDescription:textfield to store the original description from the Jira issue.evaluationScore:numericfield to store the score fromevaluateJiraIssue.feedback:textfield to store the feedback message provided to the user.didCreateGithubIssue:booleanfield (defaultfalse) indicating whether a GitHub issue was created.4. Communicate Feedback to Users
5. Update Tests and Documentation
evaluateJiraIssuefunction for correct scoring and messaging.convertJiraIssueToGithubIssuefunction for both paths (issue created and not created).evaluateJiraIssue.Expected Outcome
By implementing this evaluation step in the Jira to GitHub issue conversion process:
@jacob-ai-bot --skip-build
Plan:
Step 1: Edit
/src/server/utils/evaluateIssue.tsTask: Implement evaluateJiraIssue function
Instructions:
In the file
/src/server/utils/evaluateIssue.ts, add a new functionevaluateJiraIssuethat accepts the title and description of a Jira issue as inputs. The function should return an evaluation score between 1 and 5 (allowing half-points), indicating how likely it is that an AI coding agent can flawlessly complete the task. If the score is less than 4, the function should also provide a one-sentence feedback message informing the user what needs to be changed to make the ticket actionable by JACoB. Define clear evaluation criteria for scoring to ensure consistent assessments.Exit Criteria:
The
evaluateJiraIssuefunction is implemented, tested, and returns appropriate evaluation scores and feedback messages based on the input title and description.Step 2: Edit
/src/server/utils/jira.tsTask: Update Jira issue conversion process to include evaluation step
Instructions:
In the file
/src/server/utils/jira.ts, modify thefetchNewJiraIssuesfunction to include the evaluation step before creating a GitHub issue. Before callingrewriteGitHubIssue, call theevaluateJiraIssuefunction with the Jira issue's title and description. If the evaluation score is less than 4, do not create a GitHub issue. Instead, save the evaluation score, feedback message, and Jira issue description in the database. If the score is 4 or higher, proceed with rewriting the Jira issue and creating a GitHub issue as usual.Exit Criteria:
The Jira issue conversion process includes the evaluation step, and behaves correctly based on the evaluation score (i.e., only creates GitHub issues for scores >= 4, otherwise saves the evaluation data).
Step 3: Create
/src/server/db/migrations/20241130000000_updateIssuesTable.tsTask: Create migration script to update issues table
Instructions:
Create a new migration script
/src/server/db/migrations/20241130000000_updateIssuesTable.tsto modify theissuestable schema. Add the following optional fields to theissuestable:jiraIssueDescription(text),evaluationScore(numeric),feedback(text), anddidCreateGithubIssue(boolean, defaultfalse). Ensure the migration handles existing data appropriately to maintain data integrity.Exit Criteria:
The migration script is created and adds the new fields to the
issuestable without affecting existing data.Step 4: Edit
/src/server/db/tables/issues.table.tsTask: Update IssuesTable schema to include new fields
Instructions:
In the file
/src/server/db/tables/issues.table.ts, update theIssuesTableclass to include the new columns added in the migration script. Add the following fields to thecolumnsdefinition:jiraIssueDescription(t.text().nullable()),evaluationScore(t.numeric().nullable()),feedback(t.text().nullable()), anddidCreateGithubIssue(t.boolean().default(false)).Exit Criteria:
The
IssuesTableschema is updated to include the new fields, matching the database schema.Step 5: Edit
/src/app/dashboard/[org]/[repo]/todos/Todo.tsxTask: Display evaluation feedback in the UI for Jira issues
Instructions:
In the file
/src/app/dashboard/[org]/[repo]/todos/Todo.tsx, modify the component to display the feedback message when a Jira issue is not converted into a GitHub issue due to a low evaluation score. The feedback message should be displayed alongside the issue in the UI, informing the user about what needs to be changed to make the ticket actionable by JACoB.Exit Criteria:
The UI component displays the feedback message for Jira issues that were not converted into GitHub issues, providing users with actionable information.
Step 6: Edit
/src/server/utils/evaluateIssue.test.tsTask: Add unit tests for evaluateJiraIssue function
Instructions:
In the file
/src/server/utils/evaluateIssue.test.ts, add new unit tests for theevaluateJiraIssuefunction. Cover various scenarios with different input titles and descriptions, ensuring the function returns the correct evaluation scores and feedback messages according to the defined criteria.Exit Criteria:
Unit tests for
evaluateJiraIssueare implemented, covering multiple scenarios, and all tests pass.Step 7: Create
/src/server/utils/jira.test.tsTask: Create tests for updated Jira issue conversion process
Instructions:
Create a new test file
/src/server/utils/jira.test.tsto add tests for the updated Jira issue conversion process. Write tests to verify the behavior when the evaluation score is less than 4 (ensuring that no GitHub issue is created and the evaluation data is saved) and when the score is 4 or higher (ensuring that a GitHub issue is created). Mock necessary dependencies and handle API calls appropriately.Exit Criteria:
Tests for the Jira issue conversion process are implemented, covering both cases based on evaluation score, and all tests pass.