Skip to content

git-cli: run watch --branch misses PR-gate runs (pull_request event has empty branch) #134

Description

@St0nefish

Summary

git-tools run watch --branch <feature-branch> reports

status: no-workflow
CI workflow runs exist but none correlate to branch '<feature-branch>' after 120s

even though CI did run for the pushed commit. This makes the ship skill's "watch CI" step (step 5) ineffective on repos whose CI triggers on pull_request rather than on the branch push.

Root cause

run watch correlates runs by branch name. But for a repo whose CI runs on on: pull_request:, the resulting run carries an empty branch field (and a pull_request event), so a feature-branch-name match finds nothing. Any post-merge runs are on master (push event), which also don't match the feature branch.

Observed via run list for my pushed SHA 8061c52…:

run id event branch
1073 pull_request ""
1074 push master
1075 push master

run watch --branch worktree-feature-306-… matched none of these → no-workflow, despite run 1073 being the PR gate for exactly that commit.

Impact

In the ship flow on such a repo, the watch step is a no-op; I had to fall back to polling run list filtered by head_sha to actually watch CI to completion.

Suggested fix

Correlate by head_sha of the current HEAD commit (in addition to / as a fallback for branch name). The pushed commit SHA is stable across pull_request and push events and across the feature→master merge, so it reliably identifies the relevant run(s) where the branch name does not.

Environment

  • git-tools 2.0.10 (plugin cache)
  • tea 0.14.1
  • Platform: Gitea; CI model: on: pull_request: branches: [master] with an auto-merge job

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions