Skip to content
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

Triagebot: merge-conflicts #783

Merged
merged 1 commit into from
Dec 5, 2024
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 @@ -24,6 +24,7 @@
- [Labeling](./triagebot/labeling.md)
- [Major Changes](./triagebot/major-changes.md)
- [Mentions](./triagebot/mentions.md)
- [Merge Conflicts](./triagebot/merge-conflicts.md)
- [No Merge Policy](./triagebot/no-merge.md)
- [Nominate](./triagebot/nominate.md)
- [Note](./triagebot/note.md)
Expand Down
38 changes: 38 additions & 0 deletions src/triagebot/merge-conflicts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Merge Conflicts

The `merge-conflicts` feature detects if a Pull Request has a merge conflict, and will post a comment asking the author to resolve the conflicts.

## Usage

This is triggered automatically when a commit is made to a branch that causes existing, open PRs to have a merge conflict. The bot will post a comment to the PR that roughly looks like this:

> ☔ The latest upstream changes (possibly #152) made this pull request unmergeable. Please [resolve the merge conflicts](https://rustc-dev-guide.rust-lang.org/git.html#rebasing-and-conflicts).

Note that it may take a minute or so for the comments to be posted.

## Configuration

This feature is enabled on a repository by having a `[merge-conflicts]` table in `triagebot.toml`:

```toml
[merge-conflicts]
```

There are several optional keys that you can include:

- `remove` --- A list of labels to remove from the PR when a conflict is detected.
- `add` --- A list of labels to add to the PR when a conflict is detected.
- `unless` --- A list of labels that, if already present on the PR, will prevent triagebot from adding or removing labels.

## Example

```toml
[merge-conflicts]
remove = ['S-waiting-on-bors']
add = ['S-waiting-on-author']
unless = ['S-blocked', 'S-waiting-on-crater', 'S-waiting-on-team', 'S-waiting-on-review']
```

## Implementation

See [`src/handlers/merge_conflicts.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/merge_conflicts.rs).
Loading