Skip to content

fix(doctor): honor --yes for repo fingerprint fix in doctor --fix#1782

Merged
steveyegge merged 1 commit into
gastownhall:mainfrom
Thankyou-Cheems:fix/doctor-fix-yes-noninteractive
Feb 16, 2026
Merged

fix(doctor): honor --yes for repo fingerprint fix in doctor --fix#1782
steveyegge merged 1 commit into
gastownhall:mainfrom
Thankyou-Cheems:fix/doctor-fix-yes-noninteractive

Conversation

@Thankyou-Cheems
Copy link
Copy Markdown
Contributor

Summary

Fixes #1772.

bd doctor --fix --yes is documented as non-interactive, but Repo Fingerprint fix still prompted for Choice [1/2/s] and blocked automation (or failed with EOF in non-interactive environments).

This PR makes --yes fully non-interactive for the fingerprint fix path by auto-selecting the recommended action (update-repo-id) and passing --yes through to migrate.

Related report: #1772

Background / Root Cause

applyFixList(...) in cmd/bd/doctor_fix.go called fix.RepoFingerprint(path) without passing doctorYes.

Inside cmd/bd/doctor/fix/repo_fingerprint.go, RepoFingerprint always read from stdin (Choice [1/2/s]) before deciding an action.

So even with bd doctor --fix --yes, the fingerprint fix path remained interactive.

What This PR Changes

  1. Thread --yes into fingerprint fix flow
  • cmd/bd/doctor_fix.go
  • Repo Fingerprint case now calls:
    • fix.RepoFingerprint(path, doctorYes)
  1. Add explicit non-interactive auto path
  • cmd/bd/doctor/fix/repo_fingerprint.go
  • RepoFingerprint(path, autoYes bool) now:
    • when autoYes=true, skips prompt
    • auto-runs bd migrate --update-repo-id --yes
  1. Preserve existing interactive behavior when --yes is not set
  • Existing [1]/[2]/[s] flow remains unchanged for interactive runs.
  1. Add regression tests
  • cmd/bd/doctor/fix/repo_fingerprint_test.go
    • TestRepoFingerprint_AutoYesSkipsPromptAndPassesYesToMigrate
    • TestRepoFingerprint_ChoiceOneRunsUpdateRepoIDWithoutYes

Scope / Non-goals

This PR only addresses non-interactive semantics for Repo Fingerprint in doctor --fix.

It does not change:

  • fingerprint detection logic,
  • migrate repo-id computation behavior,
  • unrelated doctor checks.

Tests

Added:

  • cmd/bd/doctor/fix/repo_fingerprint_test.go

Validated locally with:

  • go build -tags gms_pure_go ./cmd/bd
  • go test -tags gms_pure_go ./cmd/bd/doctor/fix -run RepoFingerprint -count=1

Why this is safe

  • --yes is explicitly intended for non-interactive operation.
  • Auto path chooses the existing recommended safe action ([1] update repo ID), not destructive reset.
  • Interactive workflow is preserved when --yes is absent.
@steveyegge steveyegge merged commit 9fb58a2 into gastownhall:main Feb 16, 2026
3 of 8 checks passed
@Thankyou-Cheems Thankyou-Cheems deleted the fix/doctor-fix-yes-noninteractive branch February 16, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants