Skip to content

test: by-URL push tests set no trap on git 2.56 - #684

Open
blooop wants to merge 1 commit into
mainfrom
test/lifecycle-tests-ignore-host-git-config
Open

blooop wants to merge 1 commit into
mainfrom
test/lifecycle-tests-ignore-host-git-config

Conversation

@blooop

@blooop blooop commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Five tests failed on a host with git 2.56. They passed in CI, which has git 2.55.

The tests for #638 push a clone's commits "by URL". They expect the clone's refs/remotes/origin/* to stay stale. The fixture pushed to the bare repo's path. That path is exactly the URL of origin. git 2.56 matches a push URL against the configured remotes. On an exact match, it updates that remote's tracking refs. So the clone read clean before rm ran, and the tests failed on their own setup.

The fixture now pushes to the file:// URL of the same repo. That is a different spelling of origin. An agent's HTTPS fallback is also a different spelling of an SSH origin, so the fixture now matches the real case better. No assertion changes. No product code changes.

The tests that failed:

  • flows::lifecycle::tests::commits_pushed_by_url_do_not_stop_a_plain_rm
  • flows::lifecycle::tests::a_site_pushed_by_url_does_not_stop_a_plain_rm
  • flows::lifecycle::tests::a_remote_that_cannot_be_reached_leaves_the_refusal_standing
  • flows::lifecycle::tests::a_host_that_prunes_on_fetch_does_not_turn_a_merged_branch_into_unpushed_work
  • dl --test lifecycle a_commit_pushed_by_url_does_not_stop_rm

Note: the commit message says CI has git 2.43. That is wrong. CI's ubuntu-latest has git 2.55.0, and 2.43 is the host's /usr/bin/git. The cause in the message is correct.

How I checked it

  • I first suspected host config. The test still failed with GIT_CONFIG_GLOBAL=/dev/null, and under env -i HOME=<empty> PATH=$PATH. So the cause is not config or env.
  • With /usr/bin/git (2.43) first on PATH, the test passed. The host's default git is pixi's 2.56.0.
  • A shell repro with no config: clone a bare repo, commit, git push <bare path> HEAD:main. Then git rev-list --count origin/main..HEAD gives 1 on git 2.43 and 0 on git 2.56. With a file:// URL, both give 1.
  • Before the fix, on git 2.56: all five fail.
  • After the fix: all 186 lifecycle tests in core and the dl test pass on git 2.56 and on git 2.43. They also pass in a clean env (env -i, GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1).
  • With the fix reverted: the same five fail again, at the same lines.
  • cargo test --workspace --no-fail-fast: 3006 passed, 0 failed.
  • cargo clippy --locked --all-targets -- -D warnings and cargo fmt --check: clean.
  • prek run --from-ref origin/main --to-ref HEAD: passed.
  • pixi run test: 838 passed, 7 skipped.

Merge danger

Door: two-way. It is a test-fixture change and a revert undoes it.

Blast radius: test code only, in rust/devlaunch-core/src/flows/lifecycle/tests.rs and rust/dl/tests/lifecycle.rs. No shipped behaviour changes.

🤖 Generated with Claude Code

Summary by Sourcery

Make URL-based lifecycle tests use a distinct repository URL spelling so their stale-tracking-ref scenarios remain valid across Git versions.

Bug Fixes:

  • Prevent lifecycle tests from failing on Git 2.56 by ensuring URL-based fixture pushes do not update the clone's remote-tracking refs.

Tests:

  • Update core and dl lifecycle test fixtures to use a distinct file URL when simulating pushes by URL.

The tests for devlaunch#638 push a clone's commits "by URL" and expect
the clone's refs/remotes/origin/* to stay stale. They pushed to the bare
path, which is exactly origin's configured URL. git 2.56 matches a push
URL against the configured remotes and, on an exact match, updates that
remote's tracking refs. So on git 2.56 the clone read clean before rm
ran, and five tests failed on their own precondition. git 2.43 (CI's
ubuntu image) does not do this, so CI stayed green.

Push to the file:// URL of the same repository instead. That is a
different spelling of origin, the way an agent's HTTPS fallback is a
different spelling of an SSH origin, and both git versions leave the
tracking refs stale. No assertion changes.
@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Sorry @blooop, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates five by-URL push test fixtures to use a distinct file:// URL rather than the bare repository path, preventing Git 2.56 from treating the push as an origin push and refreshing tracking refs. This restores the intended stale-ref setup without changing assertions or product behavior.

File-Level Changes

Change Details Files
Route by-URL lifecycle test pushes through a distinct file:// spelling of the bare repository URL.
  • Added a shared helper that constructs the repository's file:// URL.
  • Updated core lifecycle setup pushes, including branch deletion and agent-site pushes, to use the helper.
  • Updated the dl lifecycle test to push via the file:// URL.
rust/devlaunch-core/src/flows/lifecycle/tests.rs
rust/dl/tests/lifecycle.rs
Preserve the tests' stale remote-tracking-ref setup across Git 2.56 while better modeling agent fallback behavior.
  • Avoided exact URL matching that causes Git 2.56 to update origin tracking refs during a direct push.
  • Kept all assertions and shipped product code unchanged.
rust/devlaunch-core/src/flows/lifecycle/tests.rs
rust/dl/tests/lifecycle.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.57%. Comparing base (7452054) to head (c9513c6).
⚠️ Report is 67 commits behind head on main.

Additional details and impacted files
Flag Coverage Δ
python 42.98% <ø> (ø)
rust 94.78% <ø> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
shipped code (rust) 94.78% <ø> (+0.16%) ⬆️
harness and tooling (python) 42.98% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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