Skip to content

Keep regenerated lockfiles when a dependency branch refresh loses its Git lease #1470

Done

Description

@chrisbbreuer

Observed

Refreshing the existing HQ.support dependency PR with the Buddy preview from 4b97662f8c753fe98b0dcfb0aa053bce02c00a3e regenerated both Bun and Pantry lockfiles. The Git push of the recreated bot branch then returned [rejected] (stale info). Buddy retried through the GitHub API, replaced the branch, and reported a successful PR update with all seven manifests and neither lockfile.

The manifest-only commit 5cd13dc fails bun --no-env-file install --frozen-lockfile --ignore-scripts with error: lockfile had changes, but lockfile is frozen. Restoring both already regenerated files as a fast-forward commit passed that same check. Affected HQ.support PR · Lockfile repair

The run used a clean standalone clone created with git clone --single-branch --branch main, an existing Buddy PR branch, and the normal update command. An initial clone with no bot remote-tracking ref and a retry with an explicitly fetched bot ref both hit the rejection. The provider's CLI refresh uses the configured fetch refspec before a bare --force-with-lease. A lease rejection must continue to protect concurrent branch changes.

Expected

  • Refresh an existing bot branch from a main-only checkout using an explicit remote lease and one commit containing the manifest edits and both regenerated lockfiles.
  • If the branch changes after the observed lease, abort or retry from a newly observed ref. A GitHub API fallback must preserve generated files and equivalent concurrency protection, or stop before changing the branch.
  • Add a regression using a disposable bare remote and main-only clone. Exercise a normal refresh and a competing branch update, and verify that rejected writes preserve the remote branch and its lockfiles.
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions