Skip to content

test: stabilize Windows development checks - #14155

Draft
scarletkc wants to merge 1 commit into
cli:trunkfrom
scarletkc:scarletkc/fix-windows-test-stability
Draft

test: stabilize Windows development checks#14155
scarletkc wants to merge 1 commit into
cli:trunkfrom
scarletkc:scarletkc/fix-windows-test-stability

Conversation

@scarletkc

@scarletkc scarletkc commented Aug 15, 2026

Copy link
Copy Markdown

Fixes #14156

Description

Windows development checks had four platform-specific failure modes:

  • Git's default core.autocrlf=true checkout converted Go files to CRLF, so the gofmt formatter reported hundreds of unchanged files.
  • The pager test inherited GH_PAGER and PAGER from the invoking shell when a test case did not set them.
  • The Huh test harness used io.Pipe, which prevented Bubble Tea forms from completing on Windows.
  • The credential updater test passed an unquoted Windows path with backslashes to Git's credential helper configuration, causing Git to write test credentials into the repository root.

This change pins Go files to LF in .gitattributes, isolates pager environment variables, uses an OS pipe for the Huh event loop, and quotes a slash-normalized temporary credential path.

The changes affect development and test behavior only. Production gh behavior is unchanged.

How did you test this change?

On Windows with Git's global core.autocrlf=true, I checked out the committed branch into a fresh worktree and inspected representative Go files with git ls-files --eol. Their index and worktree forms were both LF, and the repository-wide linter no longer proposed formatter changes.

I kept GH_PAGER=cat and PAGER=cat in the outer shell while exercising the full test suite. The pager cases used their own declared environments, the Huh form interactions completed, and the credential updater left its file in the temporary directory instead of creating path-shaped files in the repository root.

Key points

  • The LF rule is limited to *.go; this avoids changing line-ending policy for unrelated file types.
  • The PR does not contain a bulk line-ending rewrite. Renormalizing the index changed only the four intended files.
  • os.Pipe preserves the real Bubble Tea event-loop coverage while providing a native cross-platform pipe.
  • Converting the temporary credential path to slash form before quoting supports Windows drive paths and paths containing spaces.

Notes for reviewers

Start with .gitattributes and internal/prompter/huh_prompter_test.go; those address the two failures that prevented repository-wide Windows checks from completing. The pager and credential changes isolate the remaining test-only leaks discovered by that run.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @username will read and reply directly. Name the account.
  • An agent will draft replies and @scarletkc will read them before they are posted.
  • Nobody has explicitly committed to replying.

@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team needs-triage needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows development checks fail in a fresh checkout

1 participant