diff --git a/.roo/rules-pr-fixer/1_workflow.xml b/.roo/rules-pr-fixer/1_workflow.xml index 845a05d4ea2..4b43e992177 100644 --- a/.roo/rules-pr-fixer/1_workflow.xml +++ b/.roo/rules-pr-fixer/1_workflow.xml @@ -41,17 +41,24 @@ Execute the user's chosen course of action. - Check out the PR branch locally using 'gh pr checkout'. - Apply code changes based on review feedback. - Fix failing tests. - Resolve conflicts by rebasing the PR branch and force-pushing. + Check out the PR branch locally using 'gh pr checkout --force'. + Determine if the PR is from a fork by checking 'gh pr view --json isCrossRepository'. + Apply code changes based on review feedback using file editing tools. + Fix failing tests by modifying test files or source code as needed. + For conflict resolution: Use GIT_EDITOR=true for non-interactive rebases, then resolve conflicts via file editing. + If changes affect user-facing content (i18n files, UI components, announcements), delegate translation updates using the new_task tool with translate mode. + Commit changes using git commands. + Push changes to the correct remote (origin for same-repo PRs, fork remote for cross-repo PRs) using 'git push --force-with-lease'. Verify that the pushed changes resolve the issues. - Use 'gh pr checks --watch' to monitor the CI/CD pipeline and ensure all workflows execute successfully. + Use 'gh pr checks --watch' to monitor check status in real-time until all checks complete. + If needed, check specific workflow runs with 'gh run list --pr' for detailed CI/CD pipeline status. + Verify that all translation updates (if any) have been completed and committed. + Confirm PR is ready for review by checking mergeable state with 'gh pr view --json'. @@ -60,5 +67,6 @@ All actionable review comments have been addressed. All tests are passing. The PR is free of merge conflicts. + All required translations have been completed and committed (if changes affect user-facing content). \ No newline at end of file diff --git a/.roo/rules-pr-fixer/2_best_practices.xml b/.roo/rules-pr-fixer/2_best_practices.xml index 1576daa3c1f..e9ef4a8b27d 100644 --- a/.roo/rules-pr-fixer/2_best_practices.xml +++ b/.roo/rules-pr-fixer/2_best_practices.xml @@ -10,6 +10,16 @@ Address issues one at a time (e.g., fix tests first, then address comments). This makes the process more manageable and easier to validate. Tackling all issues at once can be complex and error-prone. + + Handle Fork Remotes Correctly + Always check if a PR comes from a fork (cross-repository) before pushing changes. Use 'gh pr view --json isCrossRepository' to determine the correct remote. + Pushing to the wrong remote (e.g., origin instead of fork) will fail for cross-repository PRs. + + PR from a fork + Check isCrossRepository, add fork remote if needed, push to fork + Always push to origin without checking PR source + + diff --git a/.roo/rules-pr-fixer/3_common_patterns.xml b/.roo/rules-pr-fixer/3_common_patterns.xml index 659aa7d07f3..5d2c7f033f7 100644 --- a/.roo/rules-pr-fixer/3_common_patterns.xml +++ b/.roo/rules-pr-fixer/3_common_patterns.xml @@ -24,31 +24,87 @@ - - A sequence of commands to resolve merge conflicts locally using rebase. + + Commands to detect merge conflicts. + + + + + Rebase operations using GIT_EDITOR to prevent interactive prompts. + + + + Check current conflict status without interactive input. + - Command to check out a pull request branch locally. + Check out a pull request branch locally. + + + + + Determine the correct remote to push to (handles forks). + + + + + Monitor PR checks in real-time as they run. + + + + + Push operations that handle both origin and fork remotes correctly. - - After pushing changes, use this command to monitor the CI/CD pipeline in real-time. + + + Commit operations that work in automated environments. diff --git a/.roo/rules-pr-fixer/4_tool_usage.xml b/.roo/rules-pr-fixer/4_tool_usage.xml index 10361dc3ec9..15833f3dd7d 100644 --- a/.roo/rules-pr-fixer/4_tool_usage.xml +++ b/.roo/rules-pr-fixer/4_tool_usage.xml @@ -11,6 +11,11 @@ Quickly identifies if there are failing automated checks that need investigation. + new_task (mode: translate) + When changes affect user-facing content, i18n files, or UI components that require translation. + Ensures translation consistency across all supported languages when PR fixes involve user-facing changes. + + gh pr checks --watch After pushing a fix, to confirm that the changes have resolved the CI/CD failures. Provides real-time feedback on whether the fix was successful. @@ -35,6 +40,41 @@ Use this command to get the exact error messages from failing tests. Search the log for keywords like 'error', 'failed', or 'exception' to quickly find the root cause. + Always specify run ID explicitly to avoid interactive selection prompts. + + + + + + Use --force flag: 'gh pr checkout --force' + If gh checkout fails, use: git fetch origin pull//head: + + + + + + Use --force-with-lease for safer force pushing. + Use GIT_EDITOR=true to prevent interactive prompts during rebases. + Always determine the correct remote before pushing (origin vs fork). + + + Check if PR is from a fork: 'gh pr view --json isCrossRepository' + If isCrossRepository is true, add fork remote if needed + Push to appropriate remote: 'git push --force-with-lease ' + + + Use 'GIT_EDITOR=true git rebase main' to start rebase + If conflicts occur, edit files to resolve them + Use 'git add .' and 'git rebase --continue' to proceed + + + + + + Use --watch flag to monitor checks in real-time: 'gh pr checks --watch' + For one-time status checks, use --json flag: 'gh pr checks --json state,conclusion,name' + The --watch flag automatically updates the display as check statuses change. + Use 'gh run list --pr ' to get detailed workflow status if needed. @@ -45,5 +85,34 @@ Example suggestions: "Address review comments first.", "Tackle the failing tests.", "Resolve merge conflicts." + + + + Use when PR fixes involve changes to user-facing strings, i18n files, or UI components. + Provide specific details about what content needs translation in the message. + Include file paths and descriptions of the changes made. + List all affected languages that need updates. + Wait for translation completion before proceeding to validation phase. + + + Changes to webview-ui/src/i18n/locales/en/*.json files + Changes to src/i18n/locales/en/*.json files + Modifications to UI components with user-facing text + Updates to announcement files or documentation requiring localization + Addition of new error messages or user notifications + + +translate +Translation updates needed for PR #1234 fixes. Please translate the following changes: + +Files modified: +- webview-ui/src/i18n/locales/en/common.json: Added new error message "connection_failed" +- webview-ui/src/components/settings/ApiSettings.tsx: Updated button text from "Save" to "Save Configuration" + +Please ensure all supported languages (ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW) are updated with appropriate translations for these changes. + + ]]> + \ No newline at end of file diff --git a/.roo/rules-pr-fixer/5_examples.xml b/.roo/rules-pr-fixer/5_examples.xml index e34a79421ff..0ff98de2508 100644 --- a/.roo/rules-pr-fixer/5_examples.xml +++ b/.roo/rules-pr-fixer/5_examples.xml @@ -62,7 +62,7 @@ Check out the pull request branch. - gh pr checkout 4365 + gh pr checkout 4365 --force The PR branch is now ready for local edits. @@ -82,13 +82,13 @@ - After pushing the changes, watch the PR checks to confirm the fix. + After pushing the changes, monitor PR checks in real-time. - gh pr checks --watch + gh pr checks 4365 --watch - Confirm that all checks are passing after the fix. + Monitor checks continuously until all complete. The --watch flag provides real-time updates as check statuses change. @@ -97,4 +97,112 @@ Use a combination of the GitHub MCP server and the `gh` CLI to get a complete picture of the PR's status. + + + + A pull request has review comments requesting UI text changes that require translation updates across all supported languages. + + + + Fix PR #1234 in RooCodeInc/Roo-Code - the reviewer asked to change button text and there are some failing tests. + + + + + Get PR details and analyze changes. + + + github + get_pull_request + + { + "owner": "RooCodeInc", + "repo": "Roo-Code", + "pullNumber": 1234 + } + + + + Identify the files changed and review feedback requiring UI text modifications. + + + + Check out PR and apply the requested changes. + + +gh pr checkout 1234 --force + + + Make the requested button text changes in the UI components. + + + + Identify translation requirements and delegate to translate mode. + + +translate +Translation updates needed for PR #1234 fixes. The following changes were made based on review feedback: + +Files modified: +- webview-ui/src/components/settings/ApiSettings.tsx: Changed button text from "Save" to "Save Configuration" +- webview-ui/src/i18n/locales/en/common.json: Updated key "save_button" to "save_config_button" + +Please update all supported languages (ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW) with appropriate translations for: +- New key "save_config_button" with translation equivalent to "Save Configuration" +- Any other text changes that affect user-facing content + +Ensure consistency across all language files and maintain the same context and tone as existing translations. + + + Translation subtask created and all language files updated. + + + + Commit all changes including translations with automated git configuration. + + +git add . && git commit -m "fix: update button text and translations as requested in review" + + + All code changes and translation updates are now committed. + + + + Check if PR is from a fork and push to correct remote. + + +gh pr view 1234 --json isCrossRepository,headRepositoryOwner,headRefName + + + Determine if this is a cross-repository PR to know which remote to push to. + + + + Push changes to the appropriate remote. + + +git push --force-with-lease origin + + + Push changes safely to update the pull request. Use 'fork' remote instead if PR is from a fork. + + + + Monitor CI status in real-time. + + +gh pr checks 1234 --watch + + + Watch CI checks continuously until all tests pass. The --watch flag provides automatic updates as check statuses change. + + + + + Always check if PR fixes involve user-facing content that requires translation. + Use new_task with translate mode to ensure consistent translation updates. + Include detailed context about what changed and why in translation requests. + Verify translation completeness before considering the PR fix complete. + +