Page MenuHomePhabricator

Add arcanist land bot workflow
ClosedPublic

Authored by jasonbcox on May 26 2020, 22:57.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC6172b1663628: Add arcanist land bot workflow
Summary

This patch adds an arcanist workflow (called with arc land-via-bot) that enables
us to land revisions through a land bot. This gives us the benefit of smoke testing and
other sanity checks immediately prior to landing changes on master and ensures these sanity
checks are run the same regardless of development environment or post-review modifications
to diffs.

Note that this patch only adds the new workflow and does not yet accomplish the following:

  • Override arc land with this behavior.
  • Actually land the revision. The land bot is currently running in --dry-run mode. You may push revisions to the land bot to test it out and see the build and smoke test progress.

The land-via-bot workflow takes recycles some of the sanity checks done by arc land to reduce
complexity and code ownership. This introduces a funny call to arc land directly, but is otherwise harmless.

The unique part of land-via-bot is the queuing call which is a simply cURL request to the land bot service.
The request includes the revision ID and your encrypted Conduit token so the land bot can land changes as you.

Test Plan

Help text:

arc help                      # shows land-via-bot
arc help land-via-bot         # shows new help text

Prep a revision for testing:

arc patch D5900
git rebase --onto master arcpatch-D5900
git cherry-pick <this-patch>
git rebase -i HEAD~2          # squash

Test land-via-bot:

arc land-via-bot --preview
arc land-via-bot --hold

git checkout arcpatch-D5900
arc land-via-bot              # Observe the build log link provided

Event Timeline

Fabien requested changes to this revision.May 29 2020, 20:50
Fabien added a subscriber: Fabien.
Fabien added inline comments.
arcanist/workflow/ArcanistLandBotWorkflow.php
89 ↗(On Diff #20630)

Note to reviewers: I searched how array_push($a, $b) differs from $a[] = $b and according to the doc there is no difference.

132 ↗(On Diff #20630)

Check for gpg early if you require it

133 ↗(On Diff #20630)

reset the $token var after encryption

This revision now requires changes to proceed.May 29 2020, 20:50
  • Check that gpg is installed
  • Unset unencrypted Conduit token after use
Fabien added inline comments.
arcanist/workflow/ArcanistLandBotWorkflow.php
142 ↗(On Diff #20763)

You should probably set it to all zeros first

173 ↗(On Diff #20763)

&guest=1

This revision is now accepted and ready to land.Jun 2 2020, 20:53

Fixes according to feedback

This revision was automatically updated to reflect the committed changes.