Skip to content

fix(branching): cross-repo PR builds fail#176

Draft
tbcrawford wants to merge 3 commits intoFigureTechnologies:mainfrom
tbcrawford:fix/builds-fail-cross-repo
Draft

fix(branching): cross-repo PR builds fail#176
tbcrawford wants to merge 3 commits intoFigureTechnologies:mainfrom
tbcrawford:fix/builds-fail-cross-repo

Conversation

@tbcrawford
Copy link
Copy Markdown
Contributor

@tbcrawford tbcrawford commented Sep 25, 2025

Note

Medium Risk
Changes how the current git ref is determined in CI and alters commit-count resolution fallback behavior, which can affect version strings produced on build pipelines.

Overview
Fixes version calculation in CI for forked/cross-repository GitHub pull requests where GITHUB_HEAD_REF points to a branch that doesn’t exist in the checked-out repo. Branch.currentRef now falls back to a synthetic Ref named from GITHUB_HEAD_REF (otherwise HEAD) instead of failing, and BranchList.commitCountBetween falls back to resolving HEAD when the target ref can’t be resolved.

Adds a new functional test suite (CrossRepositoryPullRequestSpec) covering: missing local branch with GITHUB_HEAD_REF, preferring GITHUB_HEAD_REF over GITHUB_REF_NAME, and falling back to GITHUB_REF_NAME when GITHUB_HEAD_REF is empty.

Written by Cursor Bugbot for commit 92867b5. This will update automatically on new commits. Configure here.

@tbcrawford tbcrawford force-pushed the fix/builds-fail-cross-repo branch from 4e6bc4a to 92867b5 Compare February 18, 2026 15:06
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


override fun getLeaf(): Ref = this

override fun getTarget(): Ref? = null
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SyntheticRef.getTarget() violates JGit Ref interface contract

Medium Severity

SyntheticRef.getTarget() returns null, but the JGit Ref interface contract specifies that when isSymbolic() is false, getTarget() must return this. All standard JGit non-symbolic ref implementations (e.g., ObjectIdRef) follow this contract. Returning null here could cause a NullPointerException if the ref is ever passed to JGit APIs or other code that relies on the documented non-null guarantee for non-symbolic refs.

Fix in Cursor Fix in Web

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.

1 participant