Skip to content

fix(infra): read the default branch at origin, not the working tree #5162

Closed

Description

@dan-petty

Problem Description

devops infra onboard <owner>/<name> reads the working tree of the local checkout. The project profile of an infra repo is "read at the default branch (trusted ref)" (tracker #4627), and the plan of #5124 runs check mode on an exported commit. When the checkout is on another branch, or is behind origin, the report shows the state of that branch, not the state of the repo.

On 2026-11-12 (17:3xZ) the first live run on dan-petty/homelab read a checkout on the merged branch feat/node-crash-capture. That branch is behind origin/main by homelab #19, #20 and #24. Row 9 ("Host key checks are on") reported 4 settings that turn host key checks off. origin/main has host key checks on since homelab #24.

The same reader feeds the later commands of tracker #5120 (status, plan, apply), so each of them would read the wrong tree too.

Reproduction Steps

  1. Put the checkout of dan-petty/homelab on a branch that is behind origin/main (here feat/node-crash-capture).
  2. Run uv run devops infra onboard dan-petty/homelab --kube-context homelab-k3s.
  3. Read row 9 ("Host key checks are on").

Expected vs Actual Behavior

Expected: onboarding fetches origin, reads the commit of the default branch at origin (for example git archive of origin/main into a temporary folder), prints the commit that it read, and says in one line when the checkout is on another branch or commit. The reader is shared, so status, plan and apply read the same commit.

Actual: onboarding reads the files of the working tree and the Ansible config of the working tree, and does not say which commit it read. Row 9 reports 4 findings that origin/main does not have.

Environment Diagnostics

  • DevOps CLI Version: 0.120.1
  • Python Version: 3.14.10
  • OS & Architecture: Debian devcontainer on WSL2, x86_64
  • Execution Environment: DevContainer

Logs, Traces, or Terminal Output

9. Host key checks are on: missing (4 settings turn host key checks off.)

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Activity

  1. added
    source/agent
    type/bug
    scope/infra
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 12, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 19:05 UTC

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

    effort/mediumpriority/p2-mediumscope/infrasource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions