Skip to content

Fix checkpoint_remote silently falling back to origin on owner mismatch #149

@jcleira

Description

@jcleira

Description

When a user configures checkpoint_remote in .partio/settings.json (e.g. {"provider": "github", "repo": "alice/checkpoints"}) and the origin remote belongs to a different owner (e.g. org/work-repo), Partio silently ignores the configured checkpoint remote and pushes to origin instead. The fallback messages are written only to debug/warn logs — the user has no visible indication their config is being ignored.

This was reported in entireio/cli#800 and fixed in entireio/cli#805.

What to fix

In the pre-push hook logic that resolves push settings:

  1. When checkpoint_remote is explicitly configured, respect it regardless of owner mismatch between push remote and checkpoint remote. Owner mismatch should not trigger a silent fallback.
  2. For all fallback paths (remote URL lookup failure, URL parse failure, URL derivation failure), print a user-visible warning to stderr so users know their checkpoint_remote config is being ignored and why.
  3. Add a test case covering the scenario where checkpoint_remote owner differs from origin owner — verify the checkpoint push goes to the configured remote.

Acceptance Criteria

  • When checkpoint_remote is configured with a different owner than origin, pushes go to checkpoint_remote, not origin
  • When checkpoint_remote push fails, a user-visible warning is printed to stderr (not silently swallowed to a log file)
  • Existing behavior for matching-owner checkpoint_remote configs is unchanged
  • make test passes
  • make lint passes

Source

Inspired by entireio/cli#805 (fixes entireio/cli#800)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions