PR 할당
Triagebot는 GitHub 풀 리퀘스트의 자동 및 수동 할당을 처리합니다. 또한 새 사용자가 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 저장소의 경우, ad-hoc 그룹 이름 목록은triagebot.toml을 참고하십시오.r? rust-lang/libs—rust-lang/조직 이름 접두사는 선택 사항입니다.r? rustdoc— rustdoc 팀에서 무작위로 한 사람을 선택합니다. 팀 이름 목록은 팀 데이터베이스를 참조하십시오.r? rust-lang/rustdoc— 조직 이름 접두사는 선택 사항입니다.@를 사용하지 않을 것을 강력히 권장하는데, 이는 팀 전체가 해당 PR을 구독하고 알림을 받게 되기 때문입니다.
팀에서 사용자를 선택할 때 triagebot은 직접 소속된 팀 구성원만 확인합니다(하위 팀은 무시합니다).
이름을 조회할 때 triagebot은 먼저 ad-hoc 그룹을, 그다음 rust-lang 팀을 확인하며, 둘 중 어느 것과도 일치하지 않으면 GitHub 사용자로 간주합니다.
풀 리퀘스트는 저장소에 쓰기 권한이 있는 사용자, 읽기 권한이 있는 rust-lang 조직 구성원, 또는 해당 풀 리퀘스트에 댓글을 남긴 사람에게만 할당될 수 있습니다.
사용자가 r? name 형태의 댓글을 게시하여 특정 사용자에게 할당을 설정할 수 있는 기능을 활성화하려면, triagebot.toml에 [assign] 테이블을 추가하십시오.
Ghost
풀 리퀘스트를 열 때 최초의 최상위 댓글에서 r? ghost를 사용하면 triagebot의 자동 할당이 비활성화됩니다. ghost는 삭제된 계정을 위한 GitHub의 대체 계정입니다. 여기서는 편의를 위해 사용됩니다. 이는 일반적으로 롤업이나 실험처럼 할당이나 알림을 원하지 않는 경우에 사용됩니다.
다시 굴리기
파일 diff를 기반으로 풀 리퀘스트를 다른 리뷰어에게 할당하고 싶다면(다시 말해, 명시적인 r? 없이 풀 리퀘스트를 열었을 때 일어나는 일을 재현하고 싶다면) @rustbot reroll 명령을 사용할 수 있습니다.
설정
[!NOTE] 이 기능은 rust-lang 조직에서 기본적으로 활성화되어 있습니다.
r?를 사용한 PR 할당은 triagebot.toml에 [assign] 테이블을 두어 저장소에서 활성화됩니다.
[assign.owners] 테이블이 있으면 triagebot은 풀 리퀘스트에서 수정된 파일을 기준으로 리뷰어를 자동으로 선택합니다.
# 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 통합을 사용하여 휴가 상태를 설정할 수도 있습니다.
커뮤니티 리뷰
저장소는 “커뮤니티 리뷰” 우선 방식을 설정할 수 있으며, 이 경우 (누구로부터든) 최소 개수의 풀 리퀘스트 리뷰 승인이 이루어질 때까지 리뷰어의 자동 할당이 지연됩니다.
[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>"
또한 풀 리퀘스트가 서브모듈을 수정하는 경우 triagebot은 경고 댓글을 게시합니다.
기본 브랜치 경고에 대한 예외
일부 풀 리퀘스트는 나머지 풀 리퀘스트와 다른 기본 브랜치를 가질 수 있으며, 이런 경우 풀 리퀘스트 제목을 기준으로 예외를 추가할 수 있어, 풀 리퀘스트가 지정된 것과 다른 브랜치를 대상으로 할 때 경고하게 됩니다.
[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를 참고하십시오.