PR 할당
Triagebot은 GitHub PR의 자동 할당과 수동 할당을 처리합니다. 또한 새 사용자가 PR을 올리면 환영 인사를 보내는 일도 처리합니다.
rust-lang/rust 저장소의 기여자는 Zulip 연동을 통해 자신의 작업 큐를 추적하고 관리할 수 있습니다. 리뷰 큐 추적을 참고하십시오.
rust-lang 조직에서 자신에게 할당된 풀 리퀘스트는 이 GitHub URL에서 확인할 수 있습니다.
사용법
새 PR의 자동 할당은 아래에서 설명하는 triagebot.toml의 설정에 따라 처리됩니다.
수동 할당은 PR에 다음 텍스트로 댓글을 달면 됩니다:
r? @octocat— 특정 사용자를 할당합니다.r? octocat—@는 생략할 수 있습니다.r? libs—triagebot.toml에 정의된 libs(라이브러리) 임시 그룹에서 무작위로 한 명을 선택합니다. 예를 들어 rust-lang/rust 저장소의 임시 그룹 이름 목록은triagebot.toml을 참고하십시오.r? rust-lang/libs—rust-lang/조직 이름 접두사는 생략할 수 있습니다.r? rustdoc— rustdoc 팀에서 무작위로 한 명을 선택합니다. 팀 이름 목록은 팀 데이터베이스를 참고하십시오.r? rust-lang/rustdoc— 조직 이름 접두사는 생략할 수 있습니다.@를 사용하면 팀 전체가 해당 PR을 구독하고 알림을 받게 되므로,@는 사용하지 않을 것을 강력히 권장합니다.
팀에서 사용자를 선택할 때 triagebot은 팀에 직접 소속된 팀 구성원만 고려합니다(하위 팀은 무시합니다).
이름을 조회할 때 triagebot은 먼저 임시 그룹을 확인하고, 그다음 rust-lang 팀을 확인하며, 둘 중 어디에도 일치하지 않으면 GitHub 사용자로 간주합니다.
PR은 저장소에 쓰기 권한이 있는 사용자, 읽기 권한이 있는 rust-lang 조직 구성원, 또는 해당 PR에 댓글을 단 사람에게만 할당할 수 있습니다.
사용자가 r? name 댓글을 달아 특정 사용자에게 할당할 수 있게 하려면 triagebot.toml에 [assign] 테이블을 추가하십시오.
Ghost
PR을 열 때 첫 PR 최상위 댓글에 r? ghost를 사용하면 triagebot의 자동 할당이 비활성화됩니다. ghost는 삭제된 계정을 대신하는 GitHub의 자리 표시자 계정입니다. 여기서는 편의상 이 계정을 사용합니다. 이 방법은 보통 할당이나 불필요한 알림을 원하지 않는 롤업이나 실험에 사용됩니다.
다시 할당하기
풀 리퀘스트의 파일 diff를 기준으로 다른 리뷰어에게 할당하려면(즉, 명시적인 r? 없이 PR을 열었을 때 일어나는 동작을 재현하려면) @rustbot reroll 명령을 사용할 수 있습니다.
설정
Note
이 기능은 rust-lang 조직에서 기본적으로 활성화되어 있습니다.
저장소의 triagebot.toml에 [assign] 테이블이 있으면 해당 저장소에서 r?를 통한 PR 할당이 활성화됩니다.
[assign.owners] 테이블이 있으면 triagebot은 PR에서 수정된 파일을 기준으로 리뷰어를 자동으로 선택합니다.
# These are ad-hoc groups that can be referenced in `r?` and the `owners` table below.
# The values may contain GitHub usernames, other groups, or rust-lang teams.
# The `@` is optional.
# Group names should be lowercase.
[assign.adhoc_groups]
libs = ["@joshtriplett", "@Mark-Simulacrum", "@kenntytm", "@m-ou-se", "@thomcc"]
# Can reference other groups.
compiler = ["compiler-team", "compiler-team-contributors"]
compiler-team = ["cjgillot", "estebank"]
compiler-team-contributors = ["compiler-errors", "jackh726"]
# Can reference rust-lang teams.
libs = ["rust-lang/libs"]
# This is a special group that will be used if none of the `owners` entries matches.
fallback = ["@Mark-Simulacrum"]
# This specifies users, groups, or teams to assign for different paths.
# Triagebot will pick one person to assign.
# Paths are gitignore-style matches.
[assign.owners]
# Examples of assigning individuals.
"Cargo.lock" = ["@Mark-Simulacrum"]
"/library/std/src/sys/windows" = ["@ChrisDenton"]
# Example of assigning to a group.
"/library/std" = ["libs"]
# Supports gitignore patterns.
"*.js" = ["@octocat"]
# If you want to match all files, `*` should be sufficient.
"*" = ["@octocat"]
# Can use teams from the rust-lang teams database.
"/src/tools/cargo" = ["@rust-lang/cargo"]
휴가
리뷰어가 (자동 또는 수동으로) 할당되지 않도록 일시적으로 막고 싶다면 특별 그룹인 assign.users_on_vacation에 자신을 추가할 수 있습니다.
[assign]
users_on_vacation = ["jyn514", "ChrisDenton"]
rust-lang/rust에서는 Zulip 연동을 사용하여 휴가를 설정할 수도 있습니다.
커뮤니티 리뷰
저장소는 “커뮤니티 리뷰” 우선 방식을 설정할 수 있습니다. 이 방식에서는 (누구에게서든) PR 리뷰 승인이 최소 개수에 도달할 때까지 리뷰어 자동 할당이 미뤄집니다.
[assign.community_reviews]
# This is the minimun number of review approvals on the PR to be able to automatically assign a reviewer.
# Manual assignments (r?, reroll) are exempted from this minimum.
minimum_approvals = 2
# Label on the PR that denote the need for a community reviews (manually removing it, triggers auto assignment).
label = "S-waiting-on-community-reviews"
새 PR에 대한 추가 트리거 옵션
triagebot은 사용자에게 환영 메시지도 게시합니다. 이 동작은 몇 가지 요인에 따라 달라집니다.
- 이전에 커밋을 한 적이 없는 PR 작성자는 더 자세한 환영 메시지를 받습니다.
- 커밋을 한 적이 있는 PR 작성자는 축약된 메시지를 받습니다.
- 첫 PR 코멘트에
r?명령이 있으면 환영 메시지가 게시되지 않습니다.
triagebot.toml에는 새 PR에 대한 동작을 제어하는 여러 옵션이 있습니다.
[assign]
# If set, posts a warning message if the PR is opened against a non-default
# branch (usually main or master).
warn_non_default_branch = true
# If set, the welcome message to new contributors will include this link to
# a contributing guide.
contributing_url = "https://rustc-dev-guide.rust-lang.org/contributing.html"
# If set, the welcome message to new contributors will include this link to
# a LLM policy.
llm_policy_url = "https://<llm policy link>"
또한 PR이 서브모듈을 수정하면 triagebot이 경고가 담긴 코멘트를 게시합니다.
기본 브랜치 경고의 예외
일부 PR은 나머지 PR과 기본 브랜치가 다를 수 있습니다. 이런 경우 PR 제목을 기준으로 예외를 추가할 수 있으며, 그러면 PR이 지정된 브랜치가 아닌 다른 브랜치를 대상으로 할 때 경고합니다.
[assign]
warn_non_default_branch.enable = true
[[assign.warn_non_default_branch.exceptions]]
title = "[beta" # title contains "[beta" in it
branch = "beta"
사용자 지정 메시지
일부 저장소는 미리 설정된 메시지 대신 사용자 지정 메시지를 사용하고 싶을 수 있습니다. 리뷰어를 자동으로 할당할 때(또는 할당하지 않을 때) 표시되는 메시지를 사용자 지정할 수 있습니다. 사용자 지정 메시지를 제공하더라도 contributing_url은 계속 사용됩니다.
[assign.custom_messages]
auto-assign-someone = "Thanks for the contribution, assigning {assignee}!" # only required if auto-assign (`[assign.owners]`) is configured
auto-assign-no-one = """
Thanks for the contribution!
Unfortunately, no reviewer could be found at the moment.
"""
메시지 내용은 ({assignee}를 제외하고) 그대로 GitHub에 전달되므로 GitHub가 지원하는 모든 형식을 내용에 사용할 수 있습니다.
구현
parser/src/command/assign.rs와 src/handlers/assign.rs를 참고하십시오.