-
Notifications
You must be signed in to change notification settings - Fork 2
fix: improve mergebot /update command with better fork handling and checkout #19
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
Merged
vilsonrodrigues
merged 8 commits into
msgflux:main
from
vilsonrodrigues:fix/mergebot-update-branch-issue
Dec 1, 2025
Merged
fix: improve mergebot /update command with better fork handling and checkout #19
vilsonrodrigues
merged 8 commits into
msgflux:main
from
vilsonrodrigues:fix/mergebot-update-branch-issue
Dec 1, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Complete project structure overview - Common commands and workflows - Release process (always use ./scripts/release.sh) - Architecture details and optimizations - Linting, testing, and CI/CD guides - Troubleshooting tips This file provides context for Claude Code to work more effectively with the project without repeating instructions.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add field name to env name mapping cache for faster lookups - Add absolute path cache to avoid repeated pathlib operations - Add type introspection cache for complex types (Union/Optional) - Optimize _preprocess_env_value with fast paths for primitive types - Optimize _get_env_name with fast path for no transformations - Optimize _decode_from_dict with atomic encoder/decoder cache - Add comprehensive benchmark suite with cold vs warm analysis - Move profile_settings.py to benchmark/ directory - All tests passing (22/22) and lint/format checks clean Performance improvements: - Main benchmark: 0.023ms per load (excellent consistency) - Cold start: 1.489ms (1.3x faster than pydantic) - Warm cached: 0.011ms (117.5x faster than pydantic) - 129.6x speedup from cold to warm caching
- Update benchmark results: 0.023ms per load (down from 2.271ms) - Add cold vs warm performance comparison: 117.5x faster when cached - Document advanced caching strategies implemented - Update comparison table with new performance metrics - Reflect 129.6x internal speedup from cold to warm caching
…ork support - Add branch existence validation before attempting checkout - Add proper handling for PRs from forks with clear messaging - Add detailed error messages for branch deletion, permission issues - Add branch comparison logic to check if update is actually needed - Add comprehensive debug logging for troubleshooting - Handle edge cases where branch was deleted after merge - Provide helpful instructions for manual updates when automation fails
…heckout This commit fixes several issues with the `/update` command in the mergebot workflow: **Problems fixed:** 1. Checkout was trying to fetch branch from base repo instead of head repo 2. Branch comparison used incorrect reference format for same-repo PRs 3. Fork validation happened too late, causing unnecessary operations **Changes:** - Add early exit for fork PRs in "Get PR info" step with clear error message - Specify repository parameter in checkout action to fetch from correct repo - Simplify branch comparison to use simple branch reference for same-repo PRs - Update validation conditions to skip unnecessary steps for fork PRs - Remove redundant "Handle fork PR" step (now handled earlier) - Add better logging for debugging **Benefits:** - Fork PRs now get immediate, clear feedback that update is not supported - Same-repo PRs can now be updated correctly without checkout errors - Better performance by skipping unnecessary operations for forks - Cleaner code flow and easier maintenance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Dec 1, 2025
vilsonrodrigues
added a commit
to vilsonrodrigues/msgspec-ext
that referenced
this pull request
Dec 2, 2025
…heckout (msgflux#19) * docs: Add CLAUDE.md with project guidelines - Complete project structure overview - Common commands and workflows - Release process (always use ./scripts/release.sh) - Architecture details and optimizations - Linting, testing, and CI/CD guides - Troubleshooting tips This file provides context for Claude Code to work more effectively with the project without repeating instructions. * Add CHANGELOG.md for release tracking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: optimize env parser latency with advanced caching - Add field name to env name mapping cache for faster lookups - Add absolute path cache to avoid repeated pathlib operations - Add type introspection cache for complex types (Union/Optional) - Optimize _preprocess_env_value with fast paths for primitive types - Optimize _get_env_name with fast path for no transformations - Optimize _decode_from_dict with atomic encoder/decoder cache - Add comprehensive benchmark suite with cold vs warm analysis - Move profile_settings.py to benchmark/ directory - All tests passing (22/22) and lint/format checks clean Performance improvements: - Main benchmark: 0.023ms per load (excellent consistency) - Cold start: 1.489ms (1.3x faster than pydantic) - Warm cached: 0.011ms (117.5x faster than pydantic) - 129.6x speedup from cold to warm caching * docs: update README with new performance metrics and optimizations - Update benchmark results: 0.023ms per load (down from 2.271ms) - Add cold vs warm performance comparison: 117.5x faster when cached - Document advanced caching strategies implemented - Update comparison table with new performance metrics - Reflect 129.6x internal speedup from cold to warm caching * fix: improve mergebot update command with better error handling and fork support - Add branch existence validation before attempting checkout - Add proper handling for PRs from forks with clear messaging - Add detailed error messages for branch deletion, permission issues - Add branch comparison logic to check if update is actually needed - Add comprehensive debug logging for troubleshooting - Handle edge cases where branch was deleted after merge - Provide helpful instructions for manual updates when automation fails * fix: improve mergebot /update command with better fork handling and checkout This commit fixes several issues with the `/update` command in the mergebot workflow: **Problems fixed:** 1. Checkout was trying to fetch branch from base repo instead of head repo 2. Branch comparison used incorrect reference format for same-repo PRs 3. Fork validation happened too late, causing unnecessary operations **Changes:** - Add early exit for fork PRs in "Get PR info" step with clear error message - Specify repository parameter in checkout action to fetch from correct repo - Simplify branch comparison to use simple branch reference for same-repo PRs - Update validation conditions to skip unnecessary steps for fork PRs - Remove redundant "Handle fork PR" step (now handled earlier) - Add better logging for debugging **Benefits:** - Fork PRs now get immediate, clear feedback that update is not supported - Same-repo PRs can now be updated correctly without checkout errors - Better performance by skipping unnecessary operations for forks - Cleaner code flow and easier maintenance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR fixes several critical issues with the
/updatecommand in the mergebot workflow that were causing checkout failures when trying to update PR branches.Problems Fixed
Checkout was fetching from wrong repository
actions/checkout@v4didn't specify the repository parameterA branch or tag with the name 'xxx' could not be foundBranch comparison used incorrect reference format
${context.repo.owner}/${context.repo.repo}:${headBranch}format unnecessarilyFork validation happened too late
Changes Made
1. Early Exit for Fork PRs (lines 407-430)
2. Explicit Repository in Checkout (line 553)
3. Simplified Branch Comparison (line 515)
4. Optimized Validation Conditions
Benefits
✅ Better error handling: Fork PRs get immediate, clear feedback
✅ Fixes checkout errors: Same-repo PRs can now be updated correctly
✅ Better performance: Skips unnecessary operations for fork PRs
✅ Cleaner code: Simplified flow and reduced redundancy
Testing
To test this PR:
/updateon PR #[test-pr-number]/updateon a fork PR to see the clear error messageRelated Issues
Fixes the issue where
/updatecommand would fail with:🤖 Generated with Claude Code