Skip to content

Squash & Approve - #828

Merged
Kobzol merged 1 commit into
rust-lang:mainfrom
medzernik:691/impl-bors-squash-r-plus
Sep 27, 2026
Merged

Kobzol merged 1 commit into
rust-lang:mainfrom
medzernik:691/impl-bors-squash-r-plus

Conversation

@medzernik

@medzernik medzernik commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Added a Squash and Approve function. This should fix #691.

Please let me know anything I can do to improve the code if needed.

I would add that in
https://github.com/medzernik/bors/blob/ab07984372498f757ab06438e926a6a6c0424c2b/src/bors/handlers/squash.rs#L25-L27

I wanted to use some more differentiated error states, but with anyhow and the general practice of returning Ok(X) even if an error technically occurs, I just wrapped the sha in an Option<sha>

Mentored by: @Kobzol

@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from 7fbdf0b to ab07984 Compare August 23, 2026 09:43
@medzernik
medzernik marked this pull request as draft August 24, 2026 14:01
@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from ab07984 to d1b84ce Compare September 6, 2026 21:37
@medzernik

Copy link
Copy Markdown
Contributor Author

Thanks! I'll try to fix the remaining errors in tests and get it cleaned up today or tommorow.

@medzernik
medzernik marked this pull request as ready for review September 9, 2026 17:32

@Kobzol Kobzol left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Left some comments.

There is one race condition that we'll need to handle in handle_push_to_pull_request. If we push the squashed commit, GitHub will send us a webhook about the push, which will unapprove the PR in handle_push_to_pull_request. Of course that is not ideal if we just approved it after the squash :)

I will push some unrelated refactoring towards that.

View changes since this review

Comment thread src/bors/mod.rs Outdated
Comment thread src/bors/handlers/mod.rs Outdated
Comment thread src/bors/handlers/squash.rs Outdated
Comment thread src/bors/handlers/squash.rs Outdated
Comment thread src/bors/command/mod.rs Outdated
Comment thread src/bors/command/parser.rs Outdated
@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from 33f8e57 to dbbf7f9 Compare September 19, 2026 08:17
@rustbot

This comment has been minimized.

@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from 2edd30e to cbf2076 Compare September 19, 2026 11:04
@rustbot

This comment has been minimized.

@medzernik
medzernik requested a review from Kobzol September 24, 2026 19:03
@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from 9afb35e to c2a1c1f Compare September 24, 2026 19:44
@rustbot

This comment has been minimized.

@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from c2a1c1f to 6a57d73 Compare September 24, 2026 19:53

@Kobzol Kobzol left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, left some comments. Let's wait for #859 to merge and then do another rebase (sorry 😅).

View changes since this review

Comment thread src/bors/command/parser.rs Outdated
Comment thread src/bors/command/parser.rs Outdated
Comment thread src/bors/command/parser.rs Outdated
Comment thread src/bors/command/parser.rs
Comment thread src/bors/handlers/mod.rs Outdated
Comment thread src/bors/handlers/squash.rs
@rustbot

This comment has been minimized.

@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch 2 times, most recently from 1bee16c to 61bc261 Compare September 25, 2026 22:19
@rustbot

rustbot commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@medzernik
medzernik requested a review from Kobzol September 25, 2026 22:21
@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from 3200f7b to 68001a4 Compare September 26, 2026 12:05
Added a new command that can squash and, if successful, approve a the latest resulting commit
Signed-off-by: David Manca <1900179+medzernik@users.noreply.github.com>

# Conflicts:
#	src/bors/handlers/review.rs

# Conflicts:
#	src/bors/handlers/review.rs
@medzernik
medzernik force-pushed the 691/impl-bors-squash-r-plus branch from e171f24 to 6f4d388 Compare September 27, 2026 13:50

@Kobzol Kobzol left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kobzol
Kobzol added this pull request to the merge queue Sep 27, 2026
Merged via the queue into rust-lang:main with commit 676ddb7 Sep 27, 2026
6 checks passed
@medzernik
medzernik deleted the 691/impl-bors-squash-r-plus branch September 27, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement @bors r+ squash

3 participants