You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): improve conflict resolver prompt to prevent bad merge commits (calcom#26699)
- Remove explicit git commands from the prompt to avoid Devin reproducing changes
- Add validation step before pushing to detect if merge commit incorrectly includes changes from target branch
- Add guidance to use git's merge functionality properly instead of manually copying content
- Add rule to never reproduce or recreate changes from the target branch
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Run: git diff --stat HEAD^2...HEAD (shows changes relative to base branch parent)
257
+
- The changes relative to the base branch parent (HEAD^2) should be SIMILAR to the original PR changes, NOT include all the new commits from ${pr.base_ref}
258
+
- If your merge commit shows hundreds of files changed or includes changes that were already in ${pr.base_ref}, STOP IMMEDIATELY
259
+
- A proper merge commit only contains conflict resolutions, not reproduced changes from the target branch
260
+
- If validation fails: DO NOT PUSH. Log the error, explain what went wrong, and abort the task.
261
+
5. Push the resolved changes to the PR branch only after validation passes.
262
+
6. After successfully pushing the resolved changes, remove the \`devin-conflict-resolution\` label from the PR using the GitHub API.
256
263
257
264
Rules and Guidelines:
258
265
1. Be careful when resolving conflicts - understand the context of both changes.
259
266
2. Follow the existing code style and conventions in the repository.
260
267
3. Run lint and type checks before pushing to ensure the code is valid.
261
268
4. If a conflict seems too complex or risky to resolve automatically, explain the situation in a PR comment instead.
262
269
5. Never ask for user confirmation. Never wait for user messages.
263
-
6. CRITICAL: If this is a fork PR and you encounter ANY error when pushing (permission denied, authentication failure, etc.), you MUST fail the task immediately. Do NOT attempt to push to a new branch in the main ${owner}/${repo} repository as a workaround. Simply report the error and stop.`;
270
+
6. CRITICAL: If this is a fork PR and you encounter ANY error when pushing (permission denied, authentication failure, etc.), you MUST fail the task immediately. Do NOT attempt to push to a new branch in the main ${owner}/${repo} repository as a workaround. Simply report the error and stop.
271
+
7. CRITICAL: Never reproduce or recreate changes from the target branch. Your merge commit should ONLY contain conflict resolutions. If you find yourself manually copying file contents from ${pr.base_ref} or creating changes that mirror what's already in ${pr.base_ref}, you are doing it wrong. Use git's merge functionality properly - it handles bringing in changes automatically.`;
0 commit comments