Skip to content

fix(taskctl): createPRForJob fails — feature branch has no commits after task branch merges #318

@randomm

Description

@randomm

Problem

At job completion, createPRForJob attempts to create a PR from feature/issue-NNNdev. It fails with:

gh pr create failed: GraphQL: Head sha can't be blank, Base sha can't be blank, No commits between dev and feature/issue-262, Head ref must be a branch

The feature branch exists but has no commits relative to dev. The individual task branches (e.g. opencode/fix-model-resolution-...) were pushed correctly, but mergeTaskBranchesToFeatureBranch did not merge them into the feature branch before createPRForJob ran.

Likely root causes to investigate

  1. mergeTaskBranchesToFeatureBranch in pulse-verdicts.ts — does it actually merge the task branches locally and push? Does it fail silently?
  2. Is the feature branch created correctly by executeStart in job-commands.ts?
  3. Does createPRForJob check whether the feature branch has commits before calling gh pr create?
  4. Task branches that were committed via taskctl override --commit-as-is or --skip — are they included in the merge?

Acceptance Criteria

  • At job completion, all committed task branches are merged into the feature branch
  • createPRForJob only runs if the feature branch has at least one commit ahead of dev
  • If merge or PR creation fails, a clear error is logged (no silent failure)
  • Existing pipeline tests pass
  • No @ts-ignore or as any introduced

Quality Gates

  • TDD: tests first
  • bun run typecheck — 0 errors
  • bun test — all pass

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