Skip to content

fix(cli): repos sync and branches sync report a failed fetch or pull instead of printing success #1399

Closed

Description

@dan-petty

Problem

fetch_all and pull_tracking in src/devops_cli/git/operations.py (:202-219 at release/v0.2.29) catch GitCommandError and pass. So devops repos sync and devops branches sync report success after a fetch or pull that failed (a rejected credential, an unreachable remote, a pull that cannot fast-forward), and the person works on a stale clone without knowing. Found during #1124 on 2026-10-08.

Acceptance criteria

  • A failed fetch or pull raises a GitOperationError that names the repository, the remote and git's reason; neither function swallows GitCommandError.
  • devops repos sync and devops branches sync report each failed repository with git's reason, finish the rest, and exit non-zero when any failed.
  • Tests use local bare remotes (a remote that refuses the fetch, a branch that cannot fast-forward), each call phase stays under 1 s, and uv run devops ci passes.

Strategic alignment


Found on 2026-10-08 while delivering #1124. Filed directly with no priority; the roadmap service's intake sets Priority, Value and Effort.

Update 2026-10-08: refinement

#900 wraps create_branch and #1114 wraps clone_repo (git/operations.py:194-230). This item's errors take the same shape: operation, repository, remote and git's stderr through mask_secrets (security/sanitizer.py:269); whichever lands later reuses it.

Activity

  1. added
    type/bug
    scope/cli
    source/agent
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. Users silently work on stale clones, violating the repository's fail-closed rule, but the impact is limited to sync commands the user can verify manually and does not corrupt data or block releases.
    • Value: High. Silent failure in a sync command misleads every user into believing their clone is current, risking wasted work or incorrect decisions based on stale code.
    • Effort: Medium. The code change is small (replace pass with raise in two functions, add per-repo error reporting and non-zero exit), but acceptance criteria require local bare-remote tests covering refused fetch and non-fast-forward pull.
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

    scope/clisource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions