Skip to content

Fix e2e test scenario merge logic#4

Merged
Phlogistique merged 13 commits into
mainfrom
claude/fix-e2e-merge-scenarios-TRDrs
Dec 24, 2025
Merged

Fix e2e test scenario merge logic#4
Phlogistique merged 13 commits into
mainfrom
claude/fix-e2e-merge-scenarios-TRDrs

Conversation

@Phlogistique

Copy link
Copy Markdown
Collaborator

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.

claude and others added 13 commits December 24, 2025 10:21
- 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.
@Phlogistique
Phlogistique merged commit f79392b into main Dec 24, 2025
@github-actions
github-actions Bot deleted the claude/fix-e2e-merge-scenarios-TRDrs branch December 24, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants