run-offload.sh: a commit that is not on main cannot be given by SHA ("not found on GitHub" for a pushed branch)

Đang mở
#1,314 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, github, shell
Lĩnh vực
cli, devops

Hướng nghiên cứu

Start with the ref resolution and fetch case in tools/offload/remote-run.sh, especially lines 48–53. Reproduce the failure with a pushed commit on a non-main branch and a bare SHA, then check how branch refs and missing refs are reported. Done means the SHA resolves when reachable from a pushed branch, with a useful error when it cannot be fetched.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

tools/offload/remote-run.sh resolves the ref by fetching, then git rev-parse origin/$ref || git rev-parse $ref. The fetch case list (line 49-53) sends a bare hex SHA down the *) arm, which runs git fetch --depth 50 origin <sha>. GitHub refuses a fetch by object id (uploadpack.allowReachableSHA1InWant is off), so nothing is fetched and the rev-parse fails with

FAIL: ref e0e25622b not found on GitHub (push it first)

even though the commit is pushed and git ls-remote shows it as a branch tip.

It only works today for a SHA that happens to be reachable from main, because line 48 always fetches main; that is why a SHA on main looks fine and a SHA on a wip/* branch does not.

The message is the worst part: it tells you to do the one thing you have already done, so the natural response is to push again and re-queue, which fails the same way. Two queued jobs were lost to this today before the cause was found.

Suggested fix: when the ref is a bare SHA that rev-parse cannot resolve after the fetch, fetch the branches that contain it (or simply git fetch --depth 50 origin '+refs/heads/*:refs/remotes/origin/*' as a fallback) before failing; and make the failure say whether the ref was not found at all or found but not fetchable by id.

Workaround: pass the branch name (wip/rundir-default) instead of the SHA.

Ngôn ngữ chính
C
Star
10
Fork
8
Merge trung bình
6 giờ 32 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FriendsofECCE/ECCE

Tất cả issue của FriendsofECCE/ECCE

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.