Skip to content

fix(strategy): require fetch URLs for checkpoint sync remote election - #2370

Open
MuskanPaliwal wants to merge 4 commits into
entireio:mainfrom
MuskanPaliwal:fix-checkpoint-push-remote-election-2360
Open

fix(strategy): require fetch URLs for checkpoint sync remote election#2370
MuskanPaliwal wants to merge 4 commits into
entireio:mainfrom
MuskanPaliwal:fix-checkpoint-push-remote-election-2360

Conversation

@MuskanPaliwal

Copy link
Copy Markdown
Contributor

Closes #2360

Trail: https://entire.io/gh/MuskanPaliwal/cli/trails/4

A Git remote can be configured with only a pushurl and no fetch URL. Such a remote can receive pushes, but Entire cannot read checkpoint history or reconcile checkpoint state from it.

ResolveCheckpointSyncRemote previously treated this configuration inconsistently:

  • Explicit and previously captured remote selections were validated with git remote get-url.
  • Git reports success for a pushurl-only remote鈥攅ven returning the remote name when no fetch URL exists.
  • Automatic election used remote.*.url entries and therefore correctly excluded the same remote.

This allowed an explicit checkpoint_push_remote to select a destination that automatic election considered unusable. entire status then presented that remote as the active checkpoint destination even though checkpoint reads and reconciliation could not work against it.

Use one eligibility rule throughout election

Remote election now builds the set of remotes with configured fetch URLs once and uses that set for every election tier.

The behavior differs deliberately based on who owns the selection:

Election source Previous behavior New behavior
Explicit checkpoint_push_remote Elected a pushurl-only remote Fails closed and explains that the remote has no fetch URL
Captured automatic selection Re-elected a pushurl-only remote Discards the stale selection and falls through to normal defaults
Automatic default election Already excluded pushurl-only remotes Unchanged
Gated-sync hint Could recommend a pushurl-only remote Stays silent because the suggested destination would be unusable

An explicit setting fails closed because it represents a user decision that should be corrected rather than silently replaced. Captured state remains fail-soft because it was produced automatically and may become stale when remotes are renamed or reconfigured.

Status and diagnostics

When the explicit remote has no fetch URL, entire status now:

  • Reports that checkpoints are not syncing.
  • Names the invalid remote.
  • Explains that it lacks a configured fetch URL.
  • Does not also print a misleading Checkpoints sync to: destination.

The gated-sync hint uses the same fetchability rule, ensuring it never recommends a destination that checkpoint sync cannot read from.

Regression coverage

The new tests construct real isolated Git repositories with:

[remote "pushonly"]
    pushurl = https://example.com/pushonly.git

and deliberately omit remote.pushonly.url.

They verify that:

  • An explicit pushurl-only remote fails closed.
  • The error names the remote and its missing fetch URL.
  • A captured pushurl-only remote falls back to origin.
  • Status reports the failure without advertising a sync destination.
  • The gated-sync hint remains silent for the unusable remote.

Verification

The following checks passed:

  • go test ./cmd/entire/cli/strategy -run '^TestHintGatedCheckpointSync$'
  • go test ./cmd/entire/cli/strategy
  • mise run check
    • formatting
    • lint
    • race-enabled unit and integration tests
    • Vogon E2E canary
    • Roger Roger E2E canary
  • mise run lint

Entire-Checkpoint: 01M27T1RWDBF17KCRMSQ250AA8
Entire-Checkpoint: 01M27WQF6JC2MHFMZXWQVQW7WK
Entire-Checkpoint: 01M28135FSP4SZ5JH97FDY692W
@MuskanPaliwal
MuskanPaliwal marked this pull request as ready for review September 11, 2026 11:05
@MuskanPaliwal
MuskanPaliwal requested a review from a team as a code owner September 11, 2026 11:05
Entire-Checkpoint: 01M2B04JPMA1SRJXTE0Z6J21GF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

checkpoint_push_remote: election accepts a pushurl-only remote that status then reports as working

1 participant