Page MenuHomePhabricator

[land-bot] Bail early if there's nothing to land
ClosedPublic

Authored by jasonbcox on Apr 22 2020, 19:42.

Details

Reviewers
Fabien
deadalnix
Group Reviewers
Restricted Project
Commits
rABCf9c450dbf502: [land-bot] Bail early if there's nothing to land
Summary

In the case of trying to land something that already landed, we shouldn't waste time
running smoke tests on an empty patch. arc land will still bail, so this isn't a bug fix,
however we don't want to accidentally wait for re-runs while other changes are in the
land queue. This also avoids smoke testing when no changes were made in the automated
commits pipeline.

Depends on D5801

Test Plan
git checkout master
git checkout <this-branch> land-patch.sh
./land-patch.sh --dry-run   # Bails early

git commit -m "TEST"
./land-patch.sh --dry-run   # Does not bail early

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.Apr 28 2020, 20:55
Fabien added a subscriber: Fabien.
Fabien added inline comments.
contrib/source-control-tools/land-patch.sh
85 ↗(On Diff #19027)

This prevent from landing twice if the commit is already in the remote, but is not the last one.
You can try to use git branch -r --contains HEAD for this.

This revision now requires changes to proceed.Apr 28 2020, 20:55
jasonbcox added inline comments.
contrib/source-control-tools/land-patch.sh
85 ↗(On Diff #19027)

autopatch will have rebased the change onto master. Since the change is already on master (at any point), the change set will be empty at the end of the rebase, so HEAD will point to origin/master regardless of when the change was landed.

contrib/source-control-tools/land-patch.sh
85 ↗(On Diff #19027)

That's only true if the code has not changed in between (and the rebase can occur with no conflict). I agree it's an unlikely edge case though.

jasonbcox retitled this revision from [land-patch] Bail early if there's nothing to land to [land-bot] Bail early if there's nothing to land.Sep 18 2020, 23:36
jasonbcox edited the summary of this revision. (Show Details)
jasonbcox edited the test plan for this revision. (Show Details)
jasonbcox added inline comments.
contrib/source-control-tools/land-patch.sh
85 ↗(On Diff #19027)

I tried git branch -r --contains HEAD and it outputs multiple lines which then require a grep or similar step. I don't really see the value of using it over this check.

This revision is now accepted and ready to land.Sep 21 2020, 06:35