Skip to content

Commit dd045ba

Browse files
authored
Merge pull request #839 from xizheyin/behind-upstream
Add doc for triagebot [behind-upstream] handler
2 parents 4aebbc9 + b98672d commit dd045ba

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [PR Assignment](./triagebot/pr-assignment.md)
1717
- [Tracking PR assignment](./triagebot/pr-assignment-tracking.md)
1818
- [Autolabels](./triagebot/autolabels.md)
19+
- [Behind Upstream](./triagebot/behind-upstream.md)
1920
- [Canonicalize Issue Links](./triagebot/canonicalize-issue-links.md)
2021
- [Close](./triagebot/close.md)
2122
- [Documentation Updates](./triagebot/doc-updates.md)

src/triagebot/behind-upstream.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Behind Upstream
2+
3+
This handler checks if a PR is based on an *X* days old commit.
4+
5+
## Context
6+
7+
When a PR's code is based on a very old commit from an upstream branch:
8+
It passes when tested locally, but fails when the PR is submitted for testing through CI.
9+
10+
This is because the CI applies the commit patches to the current upstream branch,
11+
which may have new test cases, so it won't pass. We need to rebase the PR to the nearest upstream branch.
12+
13+
## Configuration
14+
15+
> The default threshold is currently set at **7 days**.
16+
17+
This feature is enabled on a repository by having a `[behind-upstream]` table in `triagebot.toml`:
18+
19+
```toml
20+
[behind-upstream]
21+
```
22+
or, you can set the day threshold,
23+
```toml
24+
[behind-upstream]
25+
days-threshold = 7
26+
```
27+
28+
## Implementation
29+
30+
See [`src/handlers/check_commits/behind_upstream.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/check_commits/behind_upstream.rs).

0 commit comments

Comments
 (0)