Skip to content

Add doc for triagebot [behind-upstream] handler #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 30 additions & 0 deletions src/triagebot/behind-upstream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Behind Upstream

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.

## 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
[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).