Fix e2e test scenario merge logic#4
Merged
Conversation
- Fix workflow run matching to use headBranch instead of unavailable eventPayload field - Reorganize conflict scenario to introduce conflicts in correct order - Update step numbering for clarity - Add GitHub API call to update PR branch before merging in conflict scenario The initial merge test now passes successfully. The conflict scenario test reveals an issue with updating branches that have synthetic merge commits, which needs further investigation.
- Create .claude/run-e2e-tests.sh that idempotently: - Installs gh CLI if not present - Acquires GitHub App token - Configures git and gh auth - Runs e2e tests - Restores git config on exit - Move get_github_app_token.py to .claude directory - Add .claude/README.md documenting the scripts - Script includes colored output and proper error handling
Bots don't need pretty colors, just clear logging
- Cache tokens to /tmp/gh_app_token_cache.json with expiration time - Reuse cached tokens if they're still valid (with 5-minute buffer) - Only generate new tokens when cache is missing or expired - Log cache status to stderr (using cached/generating new) Tokens are now reused across multiple script runs, reducing API calls and improving performance.
Only GH_TOKEN is needed - gh CLI uses it, and gh auth setup-git configures git to use gh credentials
No need for duplicate timeout mechanisms
GitHub's mergeability computation can take a few seconds after base branch changes, causing transient "not mergeable" errors. Instead of updating the branch before merging (as was done in install-gh-cli branch), add retry logic to handle these transient failures gracefully.
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
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.
GitHub's mergeability computation can take a few seconds after base branch changes, causing transient "not mergeable" errors. Instead of updating the branch before merging (as was done in install-gh-cli branch), add retry logic to handle these transient failures gracefully.