Skip to content

Fix stack update push refs for skipped branches#13

Closed
Phlogistique wants to merge 9 commits into
mainfrom
codex/fix-stack-update-pr-workflow-failure
Closed

Fix stack update push refs for skipped branches#13
Phlogistique wants to merge 9 commits into
mainfrom
codex/fix-stack-update-pr-workflow-failure

Conversation

@Phlogistique

Copy link
Copy Markdown
Collaborator

Motivation

  • The PR stack update workflow failed when attempting to push branches that were never updated, causing src refspec ... does not match any errors.
  • The script used origin/ prefixed refs inconsistently which made ancestry and squash-commit checks wrong when local refs existed.
  • Only branches that were actually updated should be pushed and the merged branch still needs to be deleted.
  • Indirect merges must use the resolved ref (local vs remote) to avoid incorrect merge targets.

Description

  • Adjusted is_base_ancestor and has_squash_commit to operate on resolved refs instead of always using origin/ prefixes.
  • Added resolve_branch_ref to pick a local refs/heads/<branch> when present or fall back to origin/<branch>.
  • Introduced UPDATED_BRANCHES and add_updated_branch to track only branches that were modified and should be pushed.
  • Use resolved refs for direct and indirect merges and change the final git push to only delete the merged branch and push tracked UPDATED_BRANCHES.

Testing

  • The repository's E2E workflow (tests/test_e2e.sh) ran during the original rollout and failed with exit code 1 due to pushing non-existent refspecs (src refspec ... does not match any).
  • No automated tests were executed against the updated update-pr-stack.sh in this change set.

Codex Task

claude and others added 6 commits December 25, 2025 10:20
Run unit tests and e2e tests automatically when a PR is opened or updated.
E2E tests only run on PRs from the same repository (not forks) since they
require GitHub App credentials.
The .claude/run-e2e-tests.sh script was designed for Claude Code environment
which requires installing gh CLI. In GitHub Actions, gh is pre-installed.

Now the workflow directly:
- Generates the GitHub App token using the Python script
- Sets up gh authentication
- Runs the e2e tests

This avoids unnecessary gh installation and keeps the Claude-specific
script separate from CI.
Combine token generation, gh auth setup, and test execution into a single
step to avoid step dependencies with inputs/outputs.
The script is shared test infrastructure used by both Claude Code
and GitHub Actions, so it belongs in tests/ rather than .claude/.
@github-actions
github-actions Bot changed the base branch from claude/github-actions-tests-Xv4Km to main December 25, 2025 13:17
@Phlogistique
Phlogistique deleted the codex/fix-stack-update-pr-workflow-failure branch February 2, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants