From 1266f7b8253432e22ae3206067bf74c089dffc65 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Fri, 25 Apr 2025 15:09:25 +0800 Subject: [PATCH 1/3] Add doc for triagebot [behind-upstream] handler Signed-off-by: xizheyin --- src/SUMMARY.md | 1 + src/triagebot/behind-upstream.md | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/triagebot/behind-upstream.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 532631db..625206b2 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -16,6 +16,7 @@ - [PR Assignment](./triagebot/pr-assignment.md) - [Tracking PR assignment](./triagebot/pr-assignment-tracking.md) - [Autolabels](./triagebot/autolabels.md) + - [Behind Upstream](./triagebot/behind-upstream.md) - [Canonicalize Issue Links](./triagebot/canonicalize-issue-links.md) - [Close](./triagebot/close.md) - [Documentation Updates](./triagebot/doc-updates.md) diff --git a/src/triagebot/behind-upstream.md b/src/triagebot/behind-upstream.md new file mode 100644 index 00000000..514fbf8f --- /dev/null +++ b/src/triagebot/behind-upstream.md @@ -0,0 +1,26 @@ +# Behind Upstream + +This is what happens when a PR's code is based on a very old commit from an upstream branch: +It passes when tested locally, but fails when the PR is submitted for testing through CI. + +This is because the CI applies the commit patches to the current upstream branch, +which may have new test cases, so it won't pass. We need to rebase the PR to the nearest upstream branch. + +This option checks if a PR is based on an older branch upstream. + +## Configuration + +This feature is enabled on a repository by having a `[behind-upstream]` table in `triagebot.toml`: + +```toml +[behind-upstream] +``` +or, you can set the day threshold, +```toml +[behind-upstream] +days-threshold = 7 +``` + +## Implementation + +See [`src/handlers/check_commits/behind_upstream.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/check_commits/behind_upstream.rs). \ No newline at end of file From 2224fb6264fbf624e28836eefed2bede009e7f5d Mon Sep 17 00:00:00 2001 From: xizheyin Date: Sat, 26 Apr 2025 01:06:15 +0800 Subject: [PATCH 2/3] Update src/triagebot/behind-upstream.md Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com> --- src/triagebot/behind-upstream.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/triagebot/behind-upstream.md b/src/triagebot/behind-upstream.md index 514fbf8f..74f4e518 100644 --- a/src/triagebot/behind-upstream.md +++ b/src/triagebot/behind-upstream.md @@ -1,13 +1,15 @@ # Behind Upstream -This is what happens when a PR's code is based on a very old commit from an upstream branch: +This handler checks if a PR is based on an *X* days old commit. + +## Context + +When a PR's code is based on a very old commit from an upstream branch: It passes when tested locally, but fails when the PR is submitted for testing through CI. This is because the CI applies the commit patches to the current upstream branch, which may have new test cases, so it won't pass. We need to rebase the PR to the nearest upstream branch. -This option checks if a PR is based on an older branch upstream. - ## Configuration This feature is enabled on a repository by having a `[behind-upstream]` table in `triagebot.toml`: From b98672d3ad84e46c9d072ae958422a737d575bc3 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Sat, 26 Apr 2025 01:07:09 +0800 Subject: [PATCH 3/3] Update src/triagebot/behind-upstream.md Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com> --- src/triagebot/behind-upstream.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/triagebot/behind-upstream.md b/src/triagebot/behind-upstream.md index 74f4e518..cef45188 100644 --- a/src/triagebot/behind-upstream.md +++ b/src/triagebot/behind-upstream.md @@ -12,6 +12,8 @@ which may have new test cases, so it won't pass. We need to rebase the PR to the ## Configuration +> The default threshold is currently set at **7 days**. + This feature is enabled on a repository by having a `[behind-upstream]` table in `triagebot.toml`: ```toml