fix: remove racy branch existence check in CLI coverage workflow#76
Merged
fix: remove racy branch existence check in CLI coverage workflow#76
Conversation
The clone step used `git ls-remote` then `git fetch` as separate operations, which fails when the branch is deleted between the two calls (e.g. right after a PR merge). Replace with a single `git fetch` whose exit code tells us whether the branch exists. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git ls-remote+git fetchwith a singlegit fetchthat uses its exit code to determine if the branch existsls-remoteandfetchcalls (e.g. right after a PR merge), causing the workflow to fail--state opento the PR existence check in the agent promptTest plan
cli-coverage-updatebranch does not exist (creates from main)cli-coverage-updatebranch exists (checks it out and merges main)Made with Cursor
Note
Low Risk
Workflow-only changes that improve robustness of git/gh checks without affecting production code paths.
Overview
Fixes a race in the
update-cli-coverageGitHub Actions workflow by collapsing the remote-branch existence check into a singlegit fetch origin cli-coverage-updateand branching based on its exit code, avoiding failures if the branch is deleted between separate checks.Tightens the agent instructions for managing the evergreen PR by only considering open PRs (
gh pr list --state open) when deciding whether to update or create one.Written by Cursor Bugbot for commit 32639df. This will update automatically on new commits. Configure here.