Skip to content

fix: read an SSH device's pull requests with this machine's login - #2008

Merged
yansfil merged 1 commit into
mainfrom
fix/device-github-read
Nov 2, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/device-github-read

Conversation

@yansfil

@yansfil yansfil commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

SSH로 연결한 장치(예: mini)의 프로젝트는 GitHub를 한 번도 읽지 않았습니다.
이 Mac의 gh 로그인을 장치 쪽 동기화에 넘겨주는 일이 이 core에 접속해 오는 노드와 WSL에만 있었고, 읽어 온 답도 그 둘의 것만 받아들였기 때문입니다.
이제 모든 장치가 이 Mac의 로그인으로 저장소 이름에 따라 읽히고, 그 답이 반영됩니다: 체크아웃에 PR이 붙고, 링크 기록(links.sqlite3)의 Project에 저장소가 채워집니다.
SSH 장치의 이슈, 소스, PRs 탭은 D-29대로 지금처럼 꺼진 채입니다. 장치에서 gh가 도는 일은 없습니다.

스크린샷 없음: core만 바뀌었고 web/src는 그대로입니다. 체크아웃 행에 PR 표시가 붙는 것은 지금 있는 표시 그대로입니다.

Review

  • 판단해 주세요: SSH 장치의 PR 답이 이제 노드의 답과 같은 곳으로 흘러갑니다(행의 PR 칩, 미션 기준, 제안의 실패 CI 관찰, 머지 판정). 모두 읽기 전용이지만, SSH 장치에 제안이 생겨도 되는지 판단이 필요합니다.
  • 조심해서 볼 파일: herdr-core/src/session_sync.rs - 이제 remote()가 login을 반드시 받으므로, login 없이 장치 동기화를 만들 수 없습니다(원인이 다시 생기지 않게 막은 자리).
  • 조심해서 볼 파일: herdr-core/src/runtime/projects.rs ingest_device_github - origin 검사 대신 등록된 장치인지만 봅니다. 그래서 지운 장치에 늦게 도착한 답은 버려집니다.
  • 비용 검토: SSH 장치마다 이 Mac에서 gh 읽기가 늘어납니다. 저장소마다 한 번 읽고 그다음 5분마다 읽으며, GITHUB_PROJECT_LIMIT가 상한입니다. 락 밖의 리더 스레드에서 돌고, 락 안에서는 요청을 만들고 답을 반영하는 일만 합니다(노드와 같은 경로).

Evidence

  • 원인 확인: 운영자 상태에서 mini는 ssh_alias 등록(Dialed)이었고, core*.jsonl에 mini 경로의 pull_requests.* 줄은 0건이었습니다. 이는 devices.rs가 reports_own_facts()일 때만 login을 넘기는 것과 맞습니다.
  • 재현 테스트: a_device_this_core_dials_has_its_pull_requests_read_with_this_machine_s_login은 고치기 전 pull_request None으로 실패했고, 고친 뒤 통과합니다. 요청에는 acme/app이 담기고, 체크아웃 PR Bump swift-actions/setup-swift from 2.4.0 to 3 #7, 링크 fact의 repository, 이슈가 비어 있는 상태를 확인합니다.
  • 확인한 것: verify-cargo.sh nextest -p herdr-core는 3920개 통과, 실패 0개입니다. clippy -p herdr-core --all-targets도 경고가 없습니다.
  • 확인하지 못한 것: 실제 SSH 장치(mini)에서 PR이 읽히는지는 보지 못했습니다. 운영자 앱과 mini는 건드리지 않는다는 규칙 때문이고, 설치 후 links.sqlite3의 mini repo와 로그의 mini pull_requests.read로 확인할 수 있습니다.
  • 확인하지 못한 것: 장치 동기화 쪽 연결(login 전달)을 직접 보는 테스트는 없습니다. 대신 타입으로 막았습니다(remote()의 필수 인자).
Verification record

A device the core dials over SSH never had its checkouts' pull requests
read: only a node that dials in and a WSL distribution got this
machine's gh login on their coordinator, and their answers alone were
kept. Every device's coordinator now takes the login, and a dialed
device's answer lands, so its checkouts carry their pull requests and
its Project names its repository for the link record. Its issues,
source and PRs tab stay as before.
@yansfil
yansfil merged commit 73732d2 into main Nov 2, 2026
35 checks passed
@yansfil
yansfil deleted the fix/device-github-read branch November 2, 2026 07:16
yansfil added a commit that referenced this pull request Nov 2, 2026
…#2012)

Related: #2008

## Summary

#2008 이후 mini 같은 SSH 장치 프로젝트의 PR 목록은 읽히는데, 같은 읽기 안의 `gh repo view`가 실패해서
읽기 전체가 실패로 남았습니다.
`gh repo view`는 `GH_REPO`를 무시하고 현재 폴더의 git remote를 읽기 때문입니다(gh 2.76). 장치
체크아웃은 이 Mac에 폴더가 없으니 `not a git repository`로 끝납니다.
이제 gh 실행기가 저장소 이름이 있는 호출에서는 `repo view`에 그 이름을 인자로 붙입니다.

```
pull_requests.failed project=/Users/grab/projects/modakbul pull_requests=75
message="failed to run git: fatal: not a git repository (or any of the parent directories): .git"
```

## Review

- **조심해서 볼 파일**: `hide-host/src/gh.rs` - 허용 목록 검사는 원래 인자로 하고, 실행할 때만 저장소
이름을 넣습니다.

## Evidence

- **확인한 것**: 설치한 1.1.1-main.73732d2f에서 core 로그에 mini 프로젝트 3개의 읽기가 위 메시지로
실패하는 것을 봤습니다.
- **확인한 것**: `cd / && GH_REPO=with-hide/hide gh repo view --json
nameWithOwner`는 같은 메시지로 실패하고, `issue list`와 `pr list`는 성공합니다.
- **확인한 것**: 새 테스트
`a_repository_view_named_by_its_repository_needs_no_checkout`는 고치기 전에는
실패하고 고친 뒤에는 통과합니다. hide-host 275개 통과, clippy 깨끗.
- **확인하지 못한 것**: 고친 빌드로 mini 읽기가 성공하는지는 아직 보지 못했습니다. 머지 후 재설치해서 확인합니다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant