autosquash icon indicating copy to clipboard operation
autosquash copied to clipboard

Only auto-update with no auto-merge

Open salowenh opened this issue 6 years ago • 11 comments

Is it possible to configure the action to only auto-update the branch but not auto-merge? If it be controlled by different labels it'll be amazing (autosquash / automerge)

salowenh avatar Mar 24 '20 22:03 salowenh

This GitHub Action is best used when you have a CI and a code review process in place. When that's the case, you don't usually want to trigger too many unnecessary builds because it would be costly and wasteful. This is what would happen with a behavior of doing "auto update" but not "auto merge". I think it's a good practice to only label a PR with autosquash when it's been approved by reviewers and its author consider it ready to be merged.

tibdex avatar Apr 11 '20 20:04 tibdex

Thank you, Our case is a bit different, but even with the scenario you've described where the label is added after a PR was approved, we still want a person to make the last "merge" click from various reasons, do you think it's that exceptional?

salowenh avatar Apr 11 '20 20:04 salowenh

Our workflow allows the reviewer to make comments/suggestions that are not hard requirements for merging (gives approval + comments, new commits don't invalidate the approval). The author can decide if the PR will be merged as-is or if the comments will be addressed. In this workflow, the automerge behavior is not wanted.

Do you know how to support this workflow? Do you know perhaps of a different action that provides only the "update" part?

zbynekwinkler avatar Apr 20 '20 08:04 zbynekwinkler

Also interested in this use-case.

srolel avatar May 14 '20 02:05 srolel

Yeah, I am looking for something that keeps branches up to date with their base automatically.

If this action is expected to only be used after a PR has been approved, then what are you doing to keep your PRs up to date with the base? Also, isn't it a bad idea to approve a PR that isn't up to date with the base? If so, then I guess the expectation is that the branch is manually merged before the review process starts?

ejsmith avatar Jun 03 '20 19:06 ejsmith

@salowenh @srolel @ejsmith we have working on that feature right now. I think next week we be able to publish some first version into public. Today started to test it locally.

simonoff avatar Jul 23 '20 09:07 simonoff

Hi, any updates here? I would also like to only use the autoupdate if base branch changes.

@tibdex I have to disagree on ...you don't usually want to trigger too many unnecessary builds because it would be costly and wasteful. CI resources are plenty, but developer time is sparse. So if developers have to manually click on update buttons, just to wait for however CI takes, I'd rather have CI work for them ASAP. Of course you should be able to only do automated rebases on certain conditions (PR activity, age etc)

blackliner avatar Sep 26 '20 08:09 blackliner

we still want a person to make the last "merge" click from various reasons

What are these reasons?

Our workflow allows the reviewer to make comments/suggestions that are not hard requirements for merging (gives approval + comments, new commits don't invalidate the approval). The author can decide if the PR will be merged as-is or if the comments will be addressed.

That's similar to https://github.com/tibdex/autosquash/issues/28#issuecomment-720146658. Why don't you let the authors add the autosquash label when they're done with this suggestions?

If this action is expected to only be used after a PR has been approved, then what are you doing to keep your PRs up to date with the base?

Nothing. What's the point of keeping un-reviewed/approved PRs up to date with their base just for the sake of it? It's just needlessly burning CI credits no?

Also, isn't it a bad idea to approve a PR that isn't up to date with the base? If so, then I guess the expectation is that the branch is manually merged before the review process starts?

It's not necessarily a bad idea since the PR changes can be orthogonal to the commits that landed on base since then. The test suite will still run before the final merge so semantic conflicts can still be caught.

Also, this can be unavoidable if the repo has a lot of activity.

tibdex avatar Nov 01 '20 20:11 tibdex

I think you could have rules about what an active vs stale branch is. Don't auto update a branch that hasn't had non-automated merge updates for X days. Also, we could use the draft PR feature to keep from getting automated merges before the branch is ready to be considered for merging.

ejsmith avatar Nov 01 '20 21:11 ejsmith

We are trying to find a solution to auto-update (preferably rebase) "active" PR's only. Active could be something like "activity within last 24h", where activity = {comments, commits, ...}. Also we will use a WIP plugin that blocks automerge until that label is removed.

blackliner avatar Nov 02 '20 07:11 blackliner

This is basically what everyone here is asking for: https://github.com/tibdex/auto-update

Thanks @tibdex

brianespinosa avatar Mar 04 '21 00:03 brianespinosa