Docs say a PR from a linked branch is "automatically linked" to the issue, but it is not when the PR targets a non-default branch
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với bài viết creating-a-branch-for-an-issue được liên kết trong báo cáo và so sánh cách diễn đạt về việc tự động liên kết của bài viết đó với bài viết về pull request được liên kết. Xác nhận điều kiện về nhánh mặc định được ghi trong tài liệu và cập nhật đoạn liên quan để khớp với hành vi quan sát được. Công việc hoàn tất khi bài viết giải thích rõ thời điểm việc tự động liên kết xảy ra và các bước kiểm tra tài liệu liên quan đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
What part(s) of the article would you like to see updated?
The article states, with no condition on the pull request's base branch:
When you create a pull request for a branch that's connected to an issue, it is automatically linked to the issue, and the connection with that branch is removed with only the pull request shown in the "Development" section.
In practice this automatic linking does not happen when the pull request targets a branch other than the repository's default branch. The article should either state that the automatic linking requires the pull request to target the default branch, or the behaviour should be changed to match the current wording.
For comparison, the default-branch requirement is documented for closing keywords on Linking a pull request to an issue ("The pull request must be on the default branch."). There is no equivalent caveat on this page, so readers who create a branch from an issue reasonably expect the link to be created regardless of the base branch.
Additional information
Steps to reproduce (reproduced reliably, on a repository whose default branch is main):
- Create issue A. From its Development section, use "Create a branch" to create linked branch
feature/a. - Create issue B. Create linked branch
feature/bthe same way, based onfeature/a. - Push a commit to
feature/band open a pull request fromfeature/bwith basefeature/a(a stacked pull request).
Expected (per the article): issue B's Development section shows the pull request in place of the branch, and the pull request's closingIssuesReferences contains issue B.
Actual: issue B's Development section still shows the branch, and no pull request appears there. The pull request's closingIssuesReferences is empty, and no connected event is emitted on the issue timeline — only cross-referenced.
Repeating step 3 with base = main behaves exactly as documented: a connected event is emitted about two seconds after the pull request is created, and the branch entry is replaced by the pull request.
Notes
- Manually linking that same pull request to the issue from the Development sidebar does work with a non-default base, and the resulting link is a normal one (
closingIssuesReferencesbecomes populated). So this is not a blanket restriction on non-default base branches — only the automatic linking silently does not run. That asymmetry is what makes the current wording misleading. - Why this matters: in a stacked pull request workflow every pull request except the first one targets a non-default branch, so each one silently loses its issue link. Nothing in the UI indicates that the link is missing; it is only visible by querying
closingIssuesReferencesthrough the API, or by noticing that the Development section still lists a branch rather than a pull request. - Related, but not the same request: https://github.com/orgs/community/discussions/13240 asks for linked issues to be closed when a pull request merges into a non-default branch. This report is about the link not being created at all, which happens even before any merge.
- Ngôn ngữ chính
- TypeScript
- Star
- 20.9k
- Fork
- 68.8k
- Merge trung bình
- 13 giờ 55 phút
- Pull request đã merge (30 ngày)
- 105
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/docs
-
content triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
localization triage
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 72/100
-
content localization
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
content localization
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
content dependabot needs SME
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area:tools bug good first issue help wanted priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
newrelic-experimental/preflight#793 · 1 bình luận ·