Skip to content

Commit 6a1115e

Browse files
authored
Refine review branch prompt (supabase#37196)
1 parent dac0ee6 commit 6a1115e

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

apps/studio/components/interfaces/BranchManagement/ReviewWithAI.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const ReviewWithAI = ({
4949
if (productionSQL.trim()) {
5050
sqlSnippets.push({
5151
label: 'Production Schema',
52-
content: productionSQL,
52+
content: 'CURRENT PRODUCTION SCHEMA:\n' + productionSQL,
5353
})
5454
}
5555
}
@@ -58,26 +58,15 @@ export const ReviewWithAI = ({
5858
if (diffContent && diffContent.trim()) {
5959
sqlSnippets.push({
6060
label: 'Database Changes',
61-
content: '-- DATABASE CHANGES:\n' + diffContent,
61+
content: '-- DATABASE CHANGES TO BE MERGED IN:\n' + diffContent,
6262
})
6363
}
6464

6565
aiSnap.newChat({
6666
name: `Review merge: ${currentBranch.name}${mainBranch.name}`,
6767
open: true,
6868
sqlSnippets: sqlSnippets.length > 0 ? sqlSnippets : undefined,
69-
initialInput: `Please review this merge request from branch "${currentBranch.name}" into "${mainBranch.name || 'main'}".
70-
71-
I've included the current production schema as context, along with the proposed database changes.
72-
73-
Analyze the changes and provide feedback on:
74-
- Database schema changes and potential impacts on the production schema
75-
- Migration safety and rollback considerations
76-
- Overall code quality and best practices
77-
- Potential breaking changes or compatibility issues
78-
- Data integrity and constraint implications
79-
80-
Please be concise with your response.`,
69+
initialInput: `I want to run the attached database changes on my production database branch as part of a branch merge from "${currentBranch.name}" into "${mainBranch.name || 'main'}". I've included the current production database schema as extra context. Please analyze the proposed schema changes and provide concise feedback on their impact on the production schema including any migration concerns and potential conflicts.`,
8170
suggestions: {
8271
title: `I can help you review the database schema changes from "${currentBranch.name}" to "${mainBranch.name}", here are some specific areas I can focus on:`,
8372
prompts: [

0 commit comments

Comments
 (0)