-
Notifications
You must be signed in to change notification settings - Fork 39
feat: implement per-repository autoPush configuration #499
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
feat: implement per-repository autoPush configuration #499
Conversation
Replace global autoPushOnComplete setting with per-repository autoPush field to enable granular control of git push behavior for agentic sessions. Each repository can now be configured independently with autoPush: true/false. ## Changes - Add autoPush field to SessionRepo type (backend, frontend, CRD) - Remove deprecated autoPushOnComplete from all components - Add type validation in runner to handle invalid autoPush values - Generate Git Push Instructions in system prompt for repos with autoPush=true - Add comprehensive test coverage (10 backend tests, 19 runner tests) - Update UI with clear help text explaining autoPush behavior ## Testing - All 351 backend tests pass - All 19 runner tests pass (including edge case type validation tests) - Frontend builds with 0 errors, 0 warnings - Manual testing verified correct behavior Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Claude Code ReviewSummaryThis PR implements per-repository autoPush configuration, replacing the global autoPushOnComplete setting. The implementation is well-architected with comprehensive test coverage (10 backend tests, 19 runner tests) and follows established patterns. The changes span backend, frontend, CRD, operator, and runner components with consistent type handling. Issues by Severity🚫 Blocker IssuesNone - this PR is ready to merge. 🔴 Critical IssuesNone identified. 🟡 Major Issues1. Operator cleanup incomplete (components/operator/internal/handlers/sessions.go:419)
grep -r "autoPushOnComplete" components/operator/🔵 Minor Issues1. Type validation edge case (adapter.py:1199-1200)
auto_push_raw = it.get('autoPush', False)
auto_push = auto_push_raw if isinstance(auto_push_raw, bool) else False
# SUGGESTION: Add logging when coercion happens
if not isinstance(auto_push_raw, bool) and auto_push_raw is not None:
logger.warning(f"Invalid autoPush type {type(auto_push_raw)} for repo {url}, defaulting to False")2. Git push instruction clarity (adapter.py:1312-1321)
3. Frontend help text could be more specific (add-context-modal.tsx:107-111)
Positive Highlights✅ Excellent test coverage
✅ Type safety across the stack
✅ Follows established patterns
✅ Clean migration path
✅ User experience improvements
Code Quality AssessmentBackend (Go) ✅
Frontend (TypeScript) ✅
Runner (Python) ✅
CRD (YAML) ✅
RecommendationsImmediate (before merge):
Future improvements (not blocking):
Security Review ✅✅ No user token misuse Architecture Compliance ✅✅ Follows ADR-0003 (Multi-Repo Support) Testing Recommendation ✅All tests passing per PR description:
Suggested manual test scenario:
Final VerdictAPPROVE ✅ This is high-quality work that demonstrates:
The per-repository autoPush granularity is a significant improvement over the global setting, enabling mixed-mode workflows where some repos are pushed automatically while others remain local-only. No blocking issues. Ready to merge after verifying operator cleanup is complete. 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| if auto_push_repos: | ||
| prompt += "## Git Push Instructions\n\n" | ||
| prompt += "The following repositories have auto-push enabled. When you make changes to these repositories, you MUST commit and push your changes:\n\n" | ||
| for repo in auto_push_repos: | ||
| repo_name = repo.get('name', 'unknown') | ||
| repo_branch = repo.get('branch', 'main') | ||
| prompt += f"- **repos/{repo_name}/** (branch: {repo_branch})\n" | ||
| prompt += "\nAfter making changes to any auto-push repository:\n" | ||
| prompt += "1. Use `git add` to stage your changes\n" | ||
| prompt += "2. Use `git commit -m \"description\"` to commit with a descriptive message\n" | ||
| prompt += "3. Use `git push origin <branch>` to push to the remote repository\n\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for context this is what cladue code web says
## Git Development Branch Requirements
You are working on the following feature branches:
**Gkrumbach07/Chores**: Develop on branch `claude/system-prompt-docs-01Eahw2gNvVU8ffDpcM48uea`
### Important Instructions:
1. **DEVELOP** all your changes on the designated branch above
2. **COMMIT** your work with clear, descriptive commit messages
3. **PUSH** to the specified branch when your changes are complete
4. **CREATE** the branch locally if it doesn't exist yet
5. **NEVER** push to a different branch without explicit permission
Remember: All development and final pushes should go to the branches specified above.
## Git Operations
Follow these practices for git:
**For git push:**
- Always use git push -u origin <branch-name>
- CRITICAL: the branch should start with 'claude/' and end with matching session id, otherwise push will fail with 403 http code.
- Only if push fails due to network errors retry up to 4 times with exponential backoff (2s, 4s, 8s, 16s)
- Example retry logic: try push, wait 2s if failed, try again, wait 4s if failed, try again, etc.
**For git fetch/pull:**
- Prefer fetching specific branches: git fetch origin <branch-name>
- If network failures occur, retry up to 4 times with exponential backoff (2s, 4s, 8s, 16s)
- For pulls use: git pull origin <branch-name>
The GitHub CLI (`gh`) is not available in this environment. For GitHub issues ask the user to provide the necessary information directly.
gitStatus: This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.
Current branch: claude/system-prompt-docs-01Eahw2gNvVU8ffDpcM48uea
Main branch (you will usually use this for PRs):
Status:
(clean)
Recent commits:
4bef2c1 Working on making the button turn and stay green
b267637 fixed chore detail view table view color strips and started on making the strip turn green when pressed.
ae1a937 First commit
6f820b8 Initial Commit
we can iterate on this prompt. for now it looks good
Replace global autoPushOnComplete setting with per-repository autoPush field to enable granular control of git push behavior for agentic sessions. Each repository can now be configured independently with autoPush: true/false.
Changes
Testing